Dirk Meyer wrote:
Hallo Matthew Seaman,

The OP does have a valid point though.  I just got an e-mail from Freshpo=
rts
saying that a bunch of ports I maintain had had PORTREVISION bumps becaus=
e of
the jpeg update.  Which is all fine and dandy, except that these were the=
=20
www/p5-RT-* extension modules for RT.  First of all, they are pure perl: =
there's
no object linkage with the jpeg shlibs at all.  Secondly, they have nothi=
ng
to do with manipulating jpeg data in any way, shape or form.  One of thei=
r
dependencies links against libjpeg: that's it.

This may be, but the port has "libjpeg" as dependency listed.

ports/www/p5-RT-Authen-ExternalAuth$ make all-depends-list | grep jpeg
/usr/ports/graphics/jpeg

ports/www/p5-RT-Extension-SLA$ make all-depends-list | grep jpeg
/usr/ports/graphics/jpeg

Yeah.  That's because p5-RT-* {run-,build-} depend on www/rt38, and www/rt38
depends on graphics/p5-GD, which depends on graphics/gd, which depends on graphics/jpeg.

Of that whole dependency chain only graphics/gd and graphics/p5-GD need
a PORTREVISION bump due to the libjpeg update.

Sorry I had no way to detect if this dependecy is not needed.
I build the index with "EXPLICIT_PACKAGE_DEPENDS=yes",
which reduced the number of ports affected alot.

Sadly further work on this general problem has been suspended.

I hoped the current package tools where up to the task,
making this bump obsolete, but I have been prooven wrong.


Absolutely.  I don't what to come over as if I'm complaining about ports
I maintain in particular -- it's the general problem of finding ports that
are affected by a shlib bump which I think needs a better solution.

It seems to me that the necessary data to construct an appropriate inverse
dependency graph is simply not extracted anywhere, so port management tools
just don't have the wherewithal they need to solve this problem.

You could, for instance, run ldd(1) against each of the files a port installs
and then record in /var/db/pkg/portname-1.2.3/+SHLIBS or equivalently in the
.tbz package tarball a sorted and uniq'd list of all the shared libraries
linked against.  Or you could resolve the shlib filenames back to the ports
that supply them, and create a 'SHLIB_PORTS_NEEDED' variable in the port
Makefiles. Hmmm.... The attached script is a bit slow, and it doesn't cope with linux executables but it shows the general idea. eg:

% ./shlib-ports-needed.sh php5-gd-5.2.10 print/freetype2
graphics/jpeg
x11/libX11
x11/libXau
x11/libXdmcp
x11/libXpm
x11/libxcb
graphics/png
devel/t1lib

        Cheers,

        Matthew

--
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                 Kent, CT11 9PW
#!/bin/sh

# @(#) $Id$
#
# Given a pkgname scan all of the files installed by the package,
# and create a list of all of the shlibs linked to by any executables
# or shlibs from that package.
#

PATH=/usr/bin:/bin:/usr/sbin:/sbin ; export PATH
IFS='   
' ; export IFS
umask 022

pkgname=${1?'Please supply the name of an installed package'}
lddcmd=""

TMP=$( mktemp -t "$( basename $0 ).XXXXXX" )
if [ $? -ne 0 ]; then
    echo "$0: FATAL Can't create teporary file"
    exit 1
fi
trap "rm $TMP && exit" EXIT INT KILL

for f in $( pkg_info -qLx $pkgname ) ; do
    ldd -f "%p\n" $f 2>/dev/null >> $TMP
done

pkglist=$( for f in $( sort -u $TMP ) ; do pkg_info -qW $f ; done | sort -u )

for f in $pkglist ; do
    pkg_info -qo $f
done

#
# That's All Folks!
#

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to