Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mozilla and portage upgrading/removing
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lorien420
n00b
n00b


Joined: 16 Jun 2003
Posts: 11
Location: Atlanta, Georgia, USA

PostPosted: Sun Aug 29, 2004 9:25 pm    Post subject: mozilla and portage upgrading/removing Reply with quote

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...
Back to top
View user's profile Send private message
30726
Veteran
Veteran


Joined: 24 Sep 2003
Posts: 1501

PostPosted: Sun Aug 29, 2004 11:57 pm    Post subject: Reply with quote

qpkg -q -I <package> will check what other installed packages depends on <package>. etcat -d <package> should do the same thing.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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