On Wednesday 11 October 2006 08:47, Bo Ørsted Andresen wrote:
[SNIP]
> Yes, that's reverse dependencies.
>
> The portage way is to see if it shows up on emerge --depclean --pretend. If
> it doesn't then you have something in your world file that depends on it.
> If the package itself is in your world file then the best solution is to
> simply remove it manually by editing /var/lib/portage/world and then run
> --depclean to see if anything keeps it...

So played a bit.. ;) I think the easiest (in terms of performance) way to get 
a complete list of all installed, deep reverse depencies of a package is to 
install sys-apps/pkgcore and use this bash script (at least it seems to work 
for me):

---------------------------------------------------------------------
!/bin/bash
ATOM=$1
REV=$(pquery --vdb --revdep ${ATOM})
while [[ -n ${REV} ]];
do
    REV_OLD="$REV"
    REV=$(echo "${REV_OLD}" | \
        while read pkg_rev;
        do
            pkg=$(echo "$pkg_rev" | sed -r 's/-[^-]+(-r[0-9]+)*$//');
            if [[ ! $ALL_REV =~ "$pkg" ]];
            then
                pquery --vdb --revdep "$pkg";
            fi ;
        done)
    ALL_REV="$ALL_REV
$REV_OLD"
done
echo "$ALL_REV" | sort -u
---------------------------------------------------------------------

E.g. to find installed, deep reverse dependencies of ssmtp (which I happen to 
have installed):

# ./above_bash_script mail-mta/ssmtp

Note that you need a fully qualified atom (such as mail-mta/ssmtp) as 
argument. (A couple of places in the script altering quotation or indentation 
will influence the output). Note also that it may take a while to run...

-- 
Bo Andresen

Attachment: pgpOX6idPialL.pgp
Description: PGP signature

Reply via email to