Move portage.global_updates() invocation out of portage.py and into emerge/fixpackage...
authorZac Medico <zmedico@gentoo.org>
Sun, 23 Apr 2006 20:52:18 +0000 (20:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 23 Apr 2006 20:52:18 +0000 (20:52 -0000)
svn path=/main/trunk/; revision=3201

bin/emerge
bin/fixpackages
pym/portage.py

index bc91fcf1b5e30fa151796f6270b01283cfd59b65..cb1e2d9e6d215dcc16ef5eb9f568c13aadd93632 100755 (executable)
@@ -10,6 +10,7 @@ import errno
 
 try:
        import portage
+       portage.global_updates()
 except KeyboardInterrupt:
        sys.exit(1) # If they control C during imports, just die silently
 
index 872000764be715a34832e862b59080c153a5100c..e7459c8a1a5aed25c7f3dfbe9f32aec2cb222354 100755 (executable)
@@ -8,6 +8,7 @@ os.environ["PORTAGE_CALLER"]="fixpackages"
 sys.path = ["/usr/lib/portage/pym"]+sys.path
 
 import portage
+portage.global_updates()
 
 print
 print "Done."
index e0e178c81195851bd562808b2b691d18d9aa4ef2..e9b965c7f1d1108093340e7eb7177e09349681fd 100644 (file)
@@ -6498,11 +6498,11 @@ def getvirtuals(myroot):
 
 def do_vartree(mysettings):
        global db, root, settings
-       db["/"] = portage_util.LazyItemsDict()
+       db["/"] = portage_util.LazyItemsDict(db.get("/", None))
        db["/"].addLazySingleton("virtuals", settings.getvirtuals, "/")
        db["/"]["vartree"] = vartree("/")
        if root!="/":
-               db[root] = portage_util.LazyItemsDict()
+               db[root] = portage_util.LazyItemsDict(db.get(root, None))
                db[root].addLazySingleton("virtuals", settings.getvirtuals, root)
                db[root]["vartree"] = vartree(root)
        #We need to create the vartree first, then load our settings, and then set up our other trees
@@ -6738,6 +6738,11 @@ def update_config_files(update_iter):
                        continue
 
 def global_updates():
+       """Perform new global updates if they exist in $PORTDIR/profiles/updates/."""
+       # only do this if we're root and not running repoman/ebuild digest
+       global db, mtimedb, secpass, settings
+       if secpass < 2 or "SANDBOX_ACTIVE" in os.environ:
+               return
        updpath = os.path.join(settings["PORTDIR"], "profiles", "updates")
        if not mtimedb.has_key("updates"):
                mtimedb["updates"] = {}
@@ -6805,17 +6810,13 @@ def global_updates():
 
                #make sure our internal databases are consistent; recreate our virts and vartree
                do_vartree(settings)
+               db["/"].addLazyItem("bintree", LazyBintreeItem("/"))
                if do_upgrade_packagesmessage and \
                        listdir(os.path.join(settings["PKGDIR"], "All"), EmptyOnError=1):
                        writemsg_stdout(" ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the")
                        writemsg_stdout("\n    tbz2's in the packages directory. "+bold("Note: This can take a very long time."))
                        writemsg_stdout("\n")
 
-if (secpass==2) and (not os.environ.has_key("SANDBOX_ACTIVE")):
-       if settings["PORTAGE_CALLER"] in ["emerge","fixpackages"]:
-               #only do this if we're root and not running repoman/ebuild digest
-               global_updates()
-
 #continue setting up other trees
 class LazyBintreeItem(object):
        """This class implements lazy construction of db[root]["bintree"]."""