You are not logged in.

#1 2009-01-06 23:54:20

lardon
Member
Registered: 2008-05-31
Posts: 264
Website

Finding which explicitly installed packages require some package

Wonder what you use python for? Or why this "faad2" package which just got upgraded is for?

I made this little scipt for you!

http://pastie.org/354208

It simply shows which explicitly installed packages require some package. You use it like this:

$ whoneeds pacman
pacman
pacman-contrib
pkgstats
yaourt

It wasn't exactly trivial to make, so I thought I'd share it. It's still very hackish, but I guess the basic ideas are there.


Autojump, the fastest way to navigate your filesystem from the command line!

Offline

#2 2009-01-07 00:12:39

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Finding which explicitly installed packages require some package

While it looks nice, can you tell me what you use it for?

[stijn@hermes ~]$ pacman -Qi faad2|grep Required
Required By    : ffmpeg  mpd

Does pretty much the same, although it does not differ between explicitly installed packages and packages installed as a dependency of course. Do you use the script to clean out your installation?

Since an explicitly installed package that is needed by some other package turns into a dependency, I don't know if it's still relevant to know if it was explicitly installed or not...


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2009-01-07 00:16:38

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Finding which explicitly installed packages require some package

Very nice script.

hint: replace the two seds with one:

direct_needs=$(pacman -Qi $1 | tr "\n" " " |  sed "s/.*Required By *: *//;s/Conflicts With.*//")

archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#4 2009-01-07 07:28:18

lardon
Member
Registered: 2008-05-31
Posts: 264
Website

Re: Finding which explicitly installed packages require some package

Does pretty much the same, although it does not differ between explicitly installed packages and packages installed as a dependency of course. Do you use the script to clean out your installation?

pacman -Qi gives you the direct dependencies, whereas my script is recursive and will give you all dependencies up to the top level. It's very different.

hint: replace the two seds with one:

Thanks! I knew it was possible, I just didn't remember the syntax.


Autojump, the fastest way to navigate your filesystem from the command line!

Offline

#5 2009-04-08 18:46:54

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Finding which explicitly installed packages require some package

Do you have any objection to me including this script in the next release of pkgtools? I've been meaning to write this tool, but then rson showed me that you already had!

Offline

#6 2009-04-08 18:50:45

lardon
Member
Registered: 2008-05-31
Posts: 264
Website

Re: Finding which explicitly installed packages require some package

Daenyth wrote:

Do you have any objection to me including this script in the next release of pkgtools? I've been meaning to write this tool, but then rson showed me that you already had!

I'd be very happy to see it included in pkgtools! Go ahead!


Autojump, the fastest way to navigate your filesystem from the command line!

Offline

#7 2009-04-08 19:10:46

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Finding which explicitly installed packages require some package

Added to git and to pkgtools-git in AUR

I forgot to set you as the --author when I committed it.. sorry

Last edited by Daenyth (2009-04-08 19:11:16)

Offline

Board footer

Powered by FluxBB