View previous topic :: View next topic |
Author |
Message |
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Sun Jul 07, 2002 5:04 am Post subject: Find packages that have a dependency on a specified package |
|
|
Hi,
A trivial script that will tell you what packages depend on the installation of the specified one. I found this useful when I wanted to check why a specified package was installed on my system at all, e.g., rpm
It is no speed demon, but it is useful
Code: |
#/bin/bash
if [ $# == 0 ]; then
echo -e 'Usage: $0 <package>'
echo -e 'where <package> is a full or partial name of an installed package'
exit
fi
for x in `/usr/lib/portage/bin/pkglist`; do
if [ "`emerge -pue =$x | grep $1`" != "" ]; then
echo $x
fi
done
|
Last edited by Naan Yaar on Mon Jul 22, 2002 8:52 pm; edited 1 time in total |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Sun Jul 07, 2002 5:06 am Post subject: |
|
|
Moving to Tips and Tricks. _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
cpwins Tux's lil' helper
Joined: 08 Jul 2002 Posts: 130 Location: The Pandemonium Fortress
|
Posted: Wed Jul 10, 2002 12:41 pm Post subject: |
|
|
This is great! Just what I was looking for. |
|
Back to top |
|
|
lx Veteran
Joined: 28 May 2002 Posts: 1012 Location: Netherlands
|
Posted: Wed Nov 13, 2002 3:12 pm Post subject: |
|
|
Isn't it quicker to do
Code: | find /var/db/pkg -iname "*depend*" -exec grep -iH somepackage {} ';' |
Well I do it all the time, the output ain't that pretty (well you could write something for it) but it works. Well it only gives the packages which are directly depend on a package and doesn't account for virtual/x11 or similar (well if you want X11 you could search for xfree and virtual/X11). But it's sufficient in most cases and much much much much quicker.
Besides directly depend packages only has it's benefits: I tried your script on xfree and then it comes up with my kernel source, cause there's some package depending on X, but I'm sure the kernel doesn't depend on X.
Cya lX.
Ps: you could do a emerge -p -e world to get a list of packages that don't depend on the searched package, everything before the searched package doesn't depend on your package, so you only search the tail of the list. using -pe.... _________________ "Remember there's a big difference between kneeling down and bending over.", Frank Zappa |
|
Back to top |
|
|
|