lorien420 n00b
Joined: 16 Jun 2003 Posts: 11 Location: Atlanta, Georgia, USA
|
Posted: Sun Aug 29, 2004 9:25 pm Post subject: mozilla and portage upgrading/removing |
|
|
Every time I upgrade mozilla, epiphany and galeon break. I know they are going to break, because they depend on mozilla, but sometimes I forget to emerge them again after an update of mozilla. The real question in my mind is why doesn't emerge/portage take care of this for me?
In the case of upgrades, it's a mere annoying. It's when removing packages that this becomes painful. I tried to unmerge libsdl, and it only listed that single package. It didn't meantion the hundreds of other things that would simply stop working because libsdl was gone.
This started me thinking. While revdep-rebuild was searching for broken packages, I looked at /var/db/pkg and came up with this little python script:
Code: | #!/usr/bin/python
import sys
import random
import os
from os.path import join
def walk_category(category, package):
walk = join("/var", "db", "pkg", category)
cat_pkgs = os.listdir(walk)
os.chdir(walk)
matches = []
for file in cat_pkgs:
if "DEPEND" in os.listdir(file):
depend = open(join(walk,file,"DEPEND"), "r")
for line in depend.readlines():
if package in line:
matches.append(file)
break
depend.close()
return matches
package = sys.argv[1]
all_cats = join("/var", "db", "pkg")
matches = []
for cat in os.listdir(all_cats):
match = walk_category(cat, package)
for el in match:
matches.append(el)
print matches |
This script did exactly half of what I was looking for. I just need to add a call to emerge and it will rebuild these deps. Clearly this script isn't sophisticated enough for inclusion in portage, but it is sophisticated enough to use for suggestions about broken packages.
It wasn't that hard to write, and I'm sure that there are better front-ends from python to that db. My question is, has anybody done this? Is anybody working on this? It seems too simply a problem with such huge implications that nobody has looked at it. I must be missing something... |
|