Re: Speaking of trivial tools



On Mon, Aug 28, 2006 at 09:01:13PM -0400, Mike Meyer wrote:
I realized today that this one was possible. I suspect it would be
useful to lots of people working on ports, as well as for the sysadmin
stuff I do with it. I'm just not sure where it should goes.

-------------------- checkdeps.sh
#!/bin/sh

TMPFILE=/tmp/checkdeps.$$

pkg_info -r $1 | sed -n 's/Dependency: //p' | sort -u > $TMPFILE

ldd $(pkg_info -L $1) 2>/dev/null | \
sed -e '/^\//d' -e 's/.*=> //' -e 's/(.*)//' | \
sort -u | \
xargs -n 1 pkg_info -W | \
sed 's/.* //' | \
grep -v $1 | \
sort -u | \
comm -23 - $TMPFILE

rm $TMPFILE
--------------------

Hand it a package name as an argument, and it'll print out the names
of any packages providing libraries used by binaries in the package
given as an argument that aren't listed as a dependency for that
package. I fed it my complete list of packages, and it turned up some
interesting things - like a package that had a dependency on a newer
version of itself(!).

This is just a QAD hack. It certainly got a lot of rough edges yet.

See also the sysutils/libchk port. It's also great for finding stale
leftover files from e.g. earlier versions of the port that had a
broken pkg-plist, ports that were not updated correctly, etc.

Kris

Attachment: pgpJ1I5qrxx5U.pgp
Description: PGP signature



Relevant Pages

  • ports system woes
    ... What exactly "removing dependency on package" means? ... port installs?). ... Allow it 3-5 hours per 1000 installed ports 8-) The good thing is that ...
    (freebsd-hackers)
  • Re: Using shell commands versus C equivalents
    ... processes managing the ports at the same time. ... him and since I am modifying pkg_* already, I thought it would be best ... I want to highlight the bsd.port.mk change which takes the package dependency info from the +CONTENTS file. ...
    (freebsd-hackers)
  • Re: CLARITY re: challenge: end of life for 6.2 is prematurewithbuggy 6.3
    ... If the new php package works fine on your build box, ... For most of the ports this works, ... Even debian has no plus point there (at least in our environment at ... I've had a disk down of course it was in gmirror and the situation ...
    (freebsd-stable)
  • Re: CLARITY re: challenge: end of life for 6.2 is prematurewithbuggy 6.3
    ... If the new php package works fine on your build box, ... For most of the ports this works, ... just my effort with debian is much smaller than fbsd ports. ... I've had a disk down of course it was in gmirror and the situation ...
    (freebsd-stable)
  • Re: YAPIB (was: Drawing graphics on terminal)
    ... > the whole install gets rolled back, and you have to start again ... > package sources without having to go bug the "Official FreeBSD FTP Package ... database, a remote database maintained by FBSD folks, a smaller footprint ... ports where you could specify FROM_PACKAGES or FROM_SOURCE either on the ...
    (freebsd-hackers)