Do automatic backup the resume list when it's length is greater than 1 for bug #122527. v2.1_pre6
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Mar 2006 07:25:07 +0000 (07:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Mar 2006 07:25:07 +0000 (07:25 -0000)
svn path=/main/trunk/; revision=2847

bin/emerge
pym/portage.py

index 7faf822ac71cfd158f527f3dc80f3a3608d46a24..4ffdeb634eb901bb80de016664ee05f778bfe8be 100755 (executable)
@@ -3146,7 +3146,13 @@ else:
                        print darkgreen("These are the packages that would be %s, in order:") % action
                        print
 
-       if ("--resume" in myopts) and portage.mtimedb.has_key("resume"):
+       if "--resume" in myopts and \
+               ("resume" in portage.mtimedb or
+               "resume_backup" in portage.mtimedb):
+               if "resume" not in portage.mtimedb:
+                       portage.mtimedb["resume"] = portage.mtimedb["resume_backup"]
+                       del portage.mtimedb["resume_backup"]
+                       portage.commit_mtimedb()
                myresumeopts=portage.mtimedb["resume"]["myopts"][:]
 
                for opt in ("--skipfirst", "--ask", "--verbose"):
@@ -3253,6 +3259,11 @@ else:
                        favorites=portage.mtimedb["resume"]["favorites"]
                        mydepgraph.merge(portage.mtimedb["resume"]["mergelist"])
                else:
+                       if "resume" in portage.mtimedb and \
+                       len(portage.mtimedb["resume"]["mergelist"]) > 1:
+                               portage.mtimedb["resume_backup"] = portage.mtimedb["resume"]
+                               del portage.mtimedb["resume"]
+                               portage.commit_mtimedb()
                        portage.mtimedb["resume"]={}
                        portage.mtimedb["resume"]["myopts"]=myopts
                        portage.mtimedb["resume"]["favorites"]=favorites
index 9c0c8f1d9f0f5fa5faf8120e77bb5b451447b355..dd007f1f1ab66e84c462cf27f01be3fcd3a981a6 100644 (file)
@@ -6714,7 +6714,8 @@ mtimedb={}
 mtimedbkeys=[
 "updates", "info",
 "version", "starttime",
-"resume", "ldpath"
+"resume", "resume_backup",
+"ldpath"
 ]
 mtimedbfile=root+"var/cache/edb/mtimedb"
 try: