summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-19 00:16:09 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-19 00:16:09 +0000
commit95003ff31090d5a57d92b4aa8229114510f3bed0 (patch)
tree6454a4f969c9462fa39e879e119b36d2500e00f5
parentf08638ae1678f1590d17803b88806fb3c902c535 (diff)
downloadportage-95003ff31090d5a57d92b4aa8229114510f3bed0.tar.gz
portage-95003ff31090d5a57d92b4aa8229114510f3bed0.tar.bz2
portage-95003ff31090d5a57d92b4aa8229114510f3bed0.zip
Split move_ent calls from do_upgrade() and do them in global_updates() instead.
svn path=/main/trunk/; revision=2737
-rw-r--r--pym/portage.py25
1 files changed, 10 insertions, 15 deletions
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