Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Find packages that have a dependency on a specified package
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Sun Jul 07, 2002 5:04 am    Post subject: Find packages that have a dependency on a specified package Reply with quote

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
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Sun Jul 07, 2002 5:06 am    Post subject: Reply with quote

Moving to Tips and Tricks.
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
cpwins
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jul 2002
Posts: 130
Location: The Pandemonium Fortress

PostPosted: Wed Jul 10, 2002 12:41 pm    Post subject: Reply with quote

This is great! Just what I was looking for. 8)
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Wed Nov 13, 2002 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum