Mark Knecht wrote:

>On 6/8/05, Kevin O'Gorman <[EMAIL PROTECTED]> wrote:
>  
>
>>My world file seems remarkably long to me at 129 lines.
>>I know I've added some stuff, but many of these entries
>>ring no bells in my memory.
>>
>>I think a big part of what has happened is that in various
>>throes of dealing with portage, I've emerged particular
>>things without the --oneshot flag -- I had this system for
>>quite a while before I even knew about that flag.
>>
>>So: is there an easy way to find out if a package can
>>be removed from world because it is already in there
>>as a dependency or because of the profile?  I'd like
>>to pare world down to just the things that make a
>>difference.
>>
>>++ kevin
>>    
>>
>
>Hi Kevin,
>   I don't know of an automated way to do it. I had to go through my
>machines by hand doing the emerge/depclean/revdep-rebuild process I
>outlined in an email on this subject to Grant this morning. It took me
>a while to get it done.
>
>  
>

Here is a script to do it:

cat /var/lib/portage/world | \
    while read line; do
        count=`equery depends "$line" | wc -l`
        test $count -gt 0 && echo $line
    done

This will output every package listed in world that is a dependancy of
something else.  Of course, you need a recent version of gentoolkit to
get equery.

-Richard

-- 
gentoo-user@gentoo.org mailing list

Reply via email to