diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-25 00:46:29 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-25 00:46:29 -0700 |
commit | 19a9a8e5f586b6169305ecf0c3fa6b00faa0039c (patch) | |
tree | 9cc8a1c7d4fd209a060b3af28d51305d62416cb3 | |
parent | 49437d88ad59fb2f1796e72d37a7ba9351b17943 (diff) | |
download | portage-19a9a8e5f586b6169305ecf0c3fa6b00faa0039c.tar.gz portage-19a9a8e5f586b6169305ecf0c3fa6b00faa0039c.tar.bz2 portage-19a9a8e5f586b6169305ecf0c3fa6b00faa0039c.zip |
Add EROOT support to regenworld.
-rwxr-xr-x | bin/regenworld | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/regenworld b/bin/regenworld index 354755e30..c3e7f4470 100755 --- a/bin/regenworld +++ b/bin/regenworld @@ -1,9 +1,7 @@ #!/usr/bin/python -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# NOTE: this file does not respect ROOT - from __future__ import print_function import sys @@ -49,7 +47,9 @@ def isunwanted(pkgline): __uniqlist__.append(pkgline) return True -world_file = os.path.join("/", portage.WORLD_FILE) +root = portage.settings['ROOT'] +eroot = portage.settings['EROOT'] +world_file = os.path.join(eroot, portage.WORLD_FILE) # show a little description if we have arguments if len(sys.argv) >= 2 and sys.argv[1] in ["-h", "--help"]: @@ -59,10 +59,10 @@ if len(sys.argv) >= 2 and sys.argv[1] in ["-h", "--help"]: print("your existing world file (%s) before using this tool." % world_file) sys.exit(0) -worldlist = portage.grabfile(os.path.join("/", portage.WORLD_FILE)) +worldlist = portage.grabfile(world_file) syslist = [x for x in portage.settings.packages if issyspkg(x)] -logfile = portage.grabfile("/var/log/emerge.log") +logfile = portage.grabfile(os.path.join(eroot, "var/log/emerge.log")) biglist = [getpkginfo(x) for x in logfile if iscandidate(x)] tmplist = [] for l in biglist: @@ -78,7 +78,7 @@ for mykey in syslist: # drop the asterix mykey = mykey[1:] #print("candidate:",mykey) - mylist=portage.db["/"]["vartree"].dbapi.match(mykey) + mylist = portage.db[root]["vartree"].dbapi.match(mykey) if mylist: mykey=portage.cpv_getkey(mylist[0]) if mykey not in realsyslist: @@ -87,7 +87,7 @@ for mykey in syslist: for mykey in biglist: #print("checking:",mykey) try: - mylist=portage.db["/"]["vartree"].dbapi.match(mykey) + mylist = portage.db[root]["vartree"].dbapi.match(mykey) except (portage.exception.InvalidAtom, KeyError): if "--debug" in sys.argv: print("* ignoring broken log entry for %s (likely injected)" % mykey) @@ -104,7 +104,7 @@ for mykey in biglist: if not worldlist: pass else: - existing_set = WorldSelectedSet('/') + existing_set = WorldSelectedSet(eroot) existing_set.load() if not existing_set: |