I wrote a shell script that has proven to be very helpful in maintaining my installed package list and keeping myself bleeding edge with portage.

first, portage has to be recent - I am using 2.0.8.

All the ^[ are escape sequences (CTRL-V + ESC) due to the fact that emerge outputs in color.

What this script does it parse the output of 'emerge -pe world' file to make it look identical to the output of qpkg (from the gentoolkit package) and sorts the two files, and outputs the difference of the files. This is helpful in that it tells you exactly what files were updated from the rsync server.

This assumes that your /var/cache/edb/world file is good. A really good thing about this also, is if you want to completely remove a file and its dependencies from your computer without removing a file that another program depends on, you can remove it from your world file and it will tell you which files you need to remove. Therefore, it is helpful if you only have programs in your world file, and not stuff like libraries and such.

Before running this script, you should do an emerge rsync to make sure your portage tree is up to date.

I usually run this script, and it tells me what has been updated, so I do an

Unfortunately, I couldn't get your original script to work. However, I fiddled around with it and got something like it working, but didn't like the diff output (guess I'm too much of a noob), so I modified it some more, and got it to print out just the packages spit out by qpkg that aren't in emerge -pe world

This runs slower than the diff did, but I find it easier to read the output (you could also grep the output if you're trying to figure out if you need a certain package).

Don't just go around killing packages this spits out, though. It tells me that I don't need some stuff that has things depending on it in qpkg -u (apparently xscreensaver has a lot of gnome dependencies on my system. I'm going to have to look into that, I guess).

Edit: Not sure how this script looks on your browser, but I should note that everything between the shebang and the first qpkg should be on one line, just in case it wraps._________________They don't have a good bathroom to do coke in.

Last edited by Dolio on Thu Jul 25, 2002 7:42 am; edited 2 times in total

If you want the above to work, you should only have the programs you want to use in your world file, and not any of their dependencies. However, if you do this, there's no way to know when their dependencies get updated, unless they get updated. For example, when I do

emerge -pu world

I get binutils (because I installed a newer version. Go figure), and baselayout (same reason). However, qt 3.0.5 is out, and I have qt 3.0.4.20020606-r1, which is obviously older. So, I made this scriptlet to check for dependency updates.

Code:

#!/bin/bash

list=""

for package in `qpkg -I -nc`
do
list="$list $package"
done

emerge -p $list | egrep 'U \[[^m]+m \]'

Which will print the appropriate packages. Now that I think of it, though, emerging these by hand will add them to the world file, gradually killing any usefulness of the first script, so I guess this scriptlet is of dubious usefulness. At the very least, I suppose if you want everything installed in your world file (and as I recall, there's a script for that somewhere on this board), this can help you catch stragglers.

Cheers.

Edit: Silly me. I should have read the documentation. emerge --oneshot will update the package without adding it to the world file. This scriptlet is semi-useful after all. _________________They don't have a good bathroom to do coke in.