Only reload the config if global updates have actually been performed.
authorZac Medico <zmedico@gentoo.org>
Tue, 14 Nov 2006 14:42:52 +0000 (14:42 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Nov 2006 14:42:52 +0000 (14:42 -0000)
svn path=/main/trunk/; revision=5049

bin/emerge

index 7cd5b58eff19e9ae6b2f0398ab839b1338a991dc..f2c523dd18266951cc714fdb26594790d2f5d072 100755 (executable)
@@ -3487,12 +3487,11 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
        if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg:
                action_metadata(settings, portdb, myopts)
 
-       portage.global_updates(
-               settings, trees, mtimedb["updates"])
-       mtimedb.commit()
-       # Reload the whole config from scratch.
-       settings, trees, mtimedb = load_emerge_config(trees=trees)
-       portdb = trees[settings["ROOT"]]["porttree"].dbapi
+       if portage.global_updates(settings, trees, mtimedb["updates"]):
+               mtimedb.commit()
+               # Reload the whole config from scratch.
+               settings, trees, mtimedb = load_emerge_config(trees=trees)
+               portdb = trees[settings["ROOT"]]["porttree"].dbapi
 
        mybestpv = portdb.xmatch("bestmatch-visible", "sys-apps/portage")
        mypvs = portage.best(
@@ -4391,11 +4390,11 @@ def emerge_main():
        os.umask(022)
        settings, trees, mtimedb = load_emerge_config()
        portdb = trees[settings["ROOT"]]["porttree"].dbapi
-       portage.global_updates(settings, trees, mtimedb["updates"])
-       mtimedb.commit()
-       # Reload the whole config from scratch.
-       settings, trees, mtimedb = load_emerge_config(trees=trees)
-       portdb = trees[settings["ROOT"]]["porttree"].dbapi
+       if portage.global_updates(settings, trees, mtimedb["updates"]):
+               mtimedb.commit()
+               # Reload the whole config from scratch.
+               settings, trees, mtimedb = load_emerge_config(trees=trees)
+               portdb = trees[settings["ROOT"]]["porttree"].dbapi
 
        ldpath_mtimes = mtimedb["ldpath"]
        xterm_titles = "notitles" not in settings.features