For bug #155484, apply PORTAGE_NICENESS as soon as possible (especially before global...
authorZac Medico <zmedico@gentoo.org>
Fri, 17 Nov 2006 14:54:45 +0000 (14:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 17 Nov 2006 14:54:45 +0000 (14:54 -0000)
svn path=/main/trunk/; revision=5071

bin/emerge

index f2b87f1e359d36d3c21786001153cc281d3da41b..49521539356e9b924d4a80434ee51333257b157e 100755 (executable)
@@ -4391,6 +4391,15 @@ def emerge_main():
        os.umask(022)
        settings, trees, mtimedb = load_emerge_config()
        portdb = trees[settings["ROOT"]]["porttree"].dbapi
+
+       try:
+               os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
+       except (OSError, ValueError), e:
+               portage.writemsg("!!! Failed to change nice value to '%s'\n" % \
+                       settings["PORTAGE_NICENESS"])
+               portage.writemsg("!!! %s\n" % str(e))
+               del e
+
        if portage.global_updates(settings, trees, mtimedb["updates"]):
                mtimedb.commit()
                # Reload the whole config from scratch.
@@ -4432,14 +4441,6 @@ def emerge_main():
 
        portage.deprecated_profile_check()
 
-       try:
-               os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
-       except (OSError, ValueError), e:
-               portage.writemsg("!!! Failed to change nice value to '%s'\n" % \
-                       settings["PORTAGE_NICENESS"])
-               portage.writemsg("!!! %s\n" % str(e))
-               del e
-
        #Freeze the portdbapi for enhanced performance:
        for myroot in trees:
                trees[myroot]["porttree"].dbapi.freeze()