There's a lot of articles on-line on how to remove cruft and deprecated packages etc. But I struggled to find one that will help you clean up your world file. Being a bit of a quick fix kind of guy, I hammered this little python script together, which will loop through your world file and find the package description for each entry. The script isn't perfect, but it gets the job done for the most part. I still have to manually edit the world file, but at least now I get a description of each entry as I step through the file.
Here's what you need to do:
Log in as root and fire up a text editor:
And paste the following:
Exit and save (Ctrl+x, Enter). Run the script:
if __name__ == '__main__':
f_in = open("/var/lib/portage/world")
lines = f_in.readlines()
for line in lines:
index = line.find("/")
length = len(line) - 1
if(index > 0):
cmd = "emerge -s " + line[index+1:length] + " | grep -A7 '" + line[:length] + "' "
Just hit enter after each lookup and manually remove the entry from your world file. Since the script uses grep to filter the ermerge -s results you might get multiple descriptions for some packages. Like dev-java/java-config will list dev-java/java-config-wrapper too. A slight nuisance, but who cares?
Note: It is not considered safe to update your world file manually, so don't mess around if you don't know what you're doing. Please make a backup before editing.