Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2008 21:22:38 +0000 (UTC)
From:      Jona Joachim <jaj@hcl-club.lu>
To:        freebsd-ports@freebsd.org
Subject:   Re: detect packages which are built against missing libraries
Message-ID:  <fp2bet$dnt$1@ger.gmane.org>
References:  <20080214203217.GA88714@nirvana.my.domain>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 Feb 2008 21:32:19 +0100, Jona Joachim wrote:

> Hi!
> The last upgrade of devel/icu broke a lot of binaries for me because
> they were missing libicui18n.so.36. I quickly hacked together a python
> script which tries to indentify which packages were built against no
> longer existing libraries.
> It outputs a list of packages which can easily be combinded with
> portupgrade -f.
> It depends on portupgrade.
> I just post it here in case it can be useful for anybody. It is a good
> idea to run pkgdb -F before running it.

#!/usr/bin/env python

from subprocess import *

lddprog = "/usr/bin/ldd"
pkg_whichprog = "/usr/local/sbin/pkg_which"

def execcmd(cmd):
  p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
  return p.stdout

def pkg_which(executable):
  out = execcmd(pkg_whichprog + " " + executable)
  ret = out.readline()
  out.close()
  return ret[:-1]

pldd = execcmd(lddprog + " /usr/local/bin/* /usr/local/sbin/*")

progarr = []

for line in pldd.readlines():
  if line[0] != '\t':
    tmp = line[:-2]
  elif line.find("not found") != (-1):
    progarr.append(tmp)

concerned_pkgs = set(map(pkg_which, progarr))

print reduce(lambda x, y: x + " " + y, concerned_pkgs)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fp2bet$dnt$1>