From: Zac Medico Date: Sun, 19 Feb 2006 00:16:09 +0000 (-0000) Subject: Split move_ent calls from do_upgrade() and do them in global_updates() instead. X-Git-Tag: v2.1_pre5_2760~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=95003ff31090d5a57d92b4aa8229114510f3bed0;p=portage.git Split move_ent calls from do_upgrade() and do them in global_updates() instead. svn path=/main/trunk/; revision=2737 --- diff --git a/pym/portage.py b/pym/portage.py index 356e1fc18..aa6dcc6fc 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6788,7 +6788,6 @@ def do_upgrade(mykey): processed=1 myupd = [] mylines = grabfile(mykey) - db["/"]["bintree"]=binarytree("/",settings["PKGDIR"],virts) for myline in mylines: mysplit = myline.split() if len(mysplit) == 0: @@ -6818,20 +6817,6 @@ def do_upgrade(mykey): writemsg("\nERROR: Malformed update entry '%s'\n" % myline) processed=0 continue - if mysplit[0]=="move": - try: - db["/"]["vartree"].dbapi.move_ent(mysplit) - db["/"]["bintree"].move_ent(mysplit) - except portage_exception.InvalidPackageName, e: - writemsg("\nERROR: Malformed update entry '%s'\n" % myline) - continue - - elif mysplit[0]=="slotmove": - try: - db["/"]["vartree"].dbapi.move_slot_ent(mysplit) - db["/"]["bintree"].move_slot_ent(mysplit,settings["PORTAGE_TMPDIR"]+"/tbz2") - except portage_exception.InvalidAtom, e: - writemsg("\nERROR: Malformed update entry '%s'\n" % myline) # The list of valid updates is filtered by continue statements above. myupd.append(mysplit) @@ -6958,6 +6943,16 @@ def global_updates(): myupd.extend(do_upgrade(mykey)) update_config_files(myupd) + + db["/"]["bintree"] = binarytree("/", settings["PKGDIR"], virts) + for update_cmd in myupd: + if update_cmd[0] == "move": + db["/"]["vartree"].dbapi.move_ent(update_cmd) + db["/"]["bintree"].move_ent(update_cmd) + elif update_cmd[0] == "slotmove": + db["/"]["vartree"].dbapi.move_slot_ent(update_cmd) + db["/"]["bintree"].move_slot_ent(update_cmd, os.path.join(settings["PORTAGE_TMPDIR"], "tbz2")) + print # The above global updates proceed quickly, so they