Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script that will list package deps. that can be removed
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
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: Mon Apr 28, 2003 12:23 pm    Post subject: Reply with quote

This script preceded the depclean option in emerge (July vs. Oct. 2002). I imagine it is not needed now, but I haven't used depclean much to be certain...
garo wrote:
Why do you need this script when you have "emerge depclean" ?
Back to top
View user's profile Send private message
Crazor
Tux's lil' helper
Tux's lil' helper


Joined: 23 Apr 2003
Posts: 131

PostPosted: Mon Apr 28, 2003 1:41 pm    Post subject: Reply with quote

lol, haven't realized this being in portage now =)
have to check this when i get home and out of the windoze world
Back to top
View user's profile Send private message
rojaro
l33t
l33t


Joined: 06 May 2002
Posts: 732

PostPosted: Mon Apr 28, 2003 6:14 pm    Post subject: Reply with quote

garo wrote:
Why do you need this script when you have "emerge depclean" ?


right, but you never should use this command without the "pretend" parameter e.g. emerge depclean -p or emerge depclean --pretend. otherwise you can run in serious trouble - e.g. i got grub and lilo installed on my machine - i use grub for booting locally and lilo for stuff like bootdisks. if i run depclean it also wants to remove grub (and usbutils, pciutils and even iptables which i use every day for port redircetions and nat) - so it would be a bad idea to let it run without -p. but indeed - this command is still pretty usefull and i found two packages which i could safely remove.

but i think the whole concept behind portage is still somewhat flawed and needs to be revamped/rewritten in some parts, but it's surely the best one available for linux.
_________________
A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
Back to top
View user's profile Send private message
choenig
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 83
Location: EDDK, Germany

PostPosted: Tue Apr 29, 2003 10:26 pm    Post subject: Reply with quote

garo wrote:
Why do you need this script when you have "emerge depclean" ?


This has nothing to do with depclean!
If you call depclean, you clean (or pretend to do so) your whole installed tree.

This script only tells you, what can be unmerged safely if you get rid of ONE requested ebuild.

@Naan Yaar
I was thinking of this idea, too.
Theoreticaly a (simplyfied)
Code:

for i in `emerge -ep $EBUILD` ; do dep=$(qpkg -q $i) ; if [ ! -n "$dep" ] ; then echo  $i;fi;done

would do the thing, except that this doesn't care about the magic 'system'.
Is there any way to find out, which ebuilds are part of 'system' ?

take care, have fun
/christian
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Tue Apr 29, 2003 11:32 pm    Post subject: Reply with quote

garo wrote:
Why do you need this script when you have "emerge depclean" ?

Are you sure depclean existed in portage when this thread was started?
_________________
[Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7]
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Wed Apr 30, 2003 2:25 am    Post subject: Reply with quote

This would still need some work. qpkg -q output will contain the following:

a. the package that is going to be (potentially) uninstalled, i.e., the "parent" package
b. packages that are dependencies of the parent package and depend on the queried package; these may be packages that are not needed by anything else though
c. self

a, b, and c would need to be discounted.

In addition, there was some funkiness with masked and moved packages when I wrote the script. Hence all the shenanigans. Also "qpkg -q" did not exist when I wrote the script.
nevertheless wrote:
...

@Naan Yaar
I was thinking of this idea, too.
Theoreticaly a (simplyfied)
Code:

for i in `emerge -ep $EBUILD` ; do dep=$(qpkg -q $i) ; if [ ! -n "$dep" ] ; then echo  $i;fi;done

would do the thing, except that this doesn't care about the magic 'system'.
Is there any way to find out, which ebuilds are part of 'system' ?

take care, have fun
/christian
Back to top
View user's profile Send private message
choenig
Tux's lil' helper
Tux's lil' helper


Joined: 04 Nov 2002
Posts: 83
Location: EDDK, Germany

PostPosted: Wed Apr 30, 2003 8:55 am    Post subject: Reply with quote

Naan Yaar wrote:
This would still need some work. qpkg -q output will contain the following:

a. the package that is going to be (potentially) uninstalled, i.e., the "parent" package
b. packages that are dependencies of the parent package and depend on the queried package; these may be packages that are not needed by anything else though
c. self

a, b, and c would need to be discounted.

In addition, there was some funkiness with masked and moved packages when I wrote the script. Hence all the shenanigans. Also "qpkg -q" did not exist when I wrote the script.


I think you missunderstood my point.
My little bash-script is simplified. The real one looked like this:
Code:

for i in `emerge -ep cdrtools | grep "\[ebuild" | sed s/'\[.*] '/''/g` ; do dep=$(qpkg -q $i | egrep '^[[:space:]]') ; if [ ! -n "$dep" ] ; then echo  $i;fi;done


So, what this does is to check all ebuilds, $EBUILD depends on (emerge -ep $EBUILD) and checks for each of those, if it is dependend on by some ebuild (qpkg -q). Only if there is no package, which needs this, it will be echo'ed.

BUT: The problem with this thing is, that it also echoes packages, which are part of the 'system' thing of portage and I don't know how to find out, which packages are part of 'system'.

take care, have fun
/christian
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Wed Apr 30, 2003 12:25 pm    Post subject: Reply with quote

Once again, your script will not work correctly unless you remove dependencies (including transitive ones) that are "rooted" at the package you are trying to query, e.g., cdrtools.

"System" packages are listed in /usr/portage/profiles/default/packages, BTW.
nevertheless wrote:

I think you missunderstood my point.
My little bash-script is simplified. The real one looked like this:
Code:

for i in `emerge -ep cdrtools | grep "\[ebuild" | sed s/'\[.*] '/''/g` ; do dep=$(qpkg -q $i | egrep '^[[:space:]]') ; if [ ! -n "$dep" ] ; then echo  $i;fi;done


So, what this does is to check all ebuilds, $EBUILD depends on (emerge -ep $EBUILD) and checks for each of those, if it is dependend on by some ebuild (qpkg -q). Only if there is no package, which needs this, it will be echo'ed.

BUT: The problem with this thing is, that it also echoes packages, which are part of the 'system' thing of portage and I don't know how to find out, which packages are part of 'system'.

take care, have fun
/christian
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sat May 03, 2003 8:03 am    Post subject: Reply with quote

I have gave up a long time ago to see a decent packages clean up for gentoo.

Pretending depclean list things that makes you wonder "why?". reiserfsprogs? Why? Evolution? Why? ... and many more I installed.

Others show up that you know they must have been installed as dependencies but you have no clue to which, then start the qpkg game.

So I just forget about them. When I'll find my system way too bloated, i'll reinstall from scratch (just like in the good'il windows 98 times).

Someone mentionned that the portage system is flawed and I agree, but nothing can't be built in a nanoseconds. There are a lot of things I dislike about it, but it's the best sourced dependencies system there is... for the time being. :wink:
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
nianderson
Guru
Guru


Joined: 06 May 2003
Posts: 369
Location: Lawrence, KS

PostPosted: Mon Jun 02, 2003 5:54 pm    Post subject: Reply with quote

when i run the script i get
Code:

line 54: [: too many arguments

line 49 is
Code:

masked=`emerge -s "." | grep Masked | sed -e "$mask_        strip"`

and lits comments to line 52 which is
Quote:

or instpkg in `/usr/lib/portage/bin/pkglist | sed - e "$rev_strip" -e "$ver_strip"`; do
Code:

any ideas?
Back to top
View user's profile Send private message
infamousmrsatan
Apprentice
Apprentice


Joined: 08 Jan 2004
Posts: 201
Location: California

PostPosted: Mon Mar 22, 2004 4:12 am    Post subject: Reply with quote

I have a problem with this script -- it depends on pkglist which is no longer being included with portage?? (Or I don't have it for somereason anyway)

Naan Yaar... would it be too much to ask you to modify the script to work using qpkg -I instead ??

Thanks,

Justin
_________________
Registered Linux User 344425
Join the adopt an unanswered post initiative today!
Por favor, corrija mi espanol!
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
Goto page Previous  1, 2
Page 2 of 2

 
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