From: Zac Medico Date: Wed, 3 Oct 2012 02:43:12 +0000 (-0700) Subject: Fix emerge for python3. X-Git-Tag: v2.2.0_alpha135~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ed9164f6fa6f09d9b26c9aa0187c13bbeebc17b;p=portage.git Fix emerge for python3. --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index b4c799eb6..3940b5630 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2297,8 +2297,18 @@ class depgraph(object): writemsg("!!! Please ensure the tbz2 exists as specified.\n\n", noiselevel=-1) return 0, myfavorites mytbz2=portage.xpak.tbz2(x) - mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.splitext(os.path.basename(x))[0] - if os.path.realpath(x) != \ + mykey = None + cat = mytbz2.getfile("CATEGORY") + if cat is not None: + cat = _unicode_decode(cat.strip(), + encoding=_encodings['repo.content']) + mykey = cat + "/" + os.path.basename(x)[:-5] + + if mykey is None: + writemsg(colorize("BAD", "\n*** Package is missing CATEGORY metadata: %s.\n\n" % x), noiselevel=-1) + self._dynamic_config._skip_restart = True + return 0, myfavorites + elif os.path.realpath(x) != \ os.path.realpath(bindb.bintree.getname(mykey)): writemsg(colorize("BAD", "\n*** You need to adjust PKGDIR to emerge this package.\n\n"), noiselevel=-1) self._dynamic_config._skip_restart = True