summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-11 07:25:07 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-11 07:25:07 +0000
commit99e31dde189efc3151b99830bc21fcaed6b82d33 (patch)
tree63d7002fb7b704cae80227a856193bcb02227046
parentba7fd15c1f3e8c0bb3c137186097b7f41f096e3d (diff)
downloadportage-99e31dde189efc3151b99830bc21fcaed6b82d33.tar.gz
portage-99e31dde189efc3151b99830bc21fcaed6b82d33.tar.bz2
portage-99e31dde189efc3151b99830bc21fcaed6b82d33.zip
Do automatic backup the resume list when it's length is greater than 1 for bug #122527.v2.1_pre6
svn path=/main/trunk/; revision=2847
-rwxr-xr-xbin/emerge13
-rw-r--r--pym/portage.py3
2 files changed, 14 insertions, 2 deletions
diff --git a/bin/emerge b/bin/emerge
index 7faf822ac..4ffdeb634 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -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
diff --git a/pym/portage.py b/pym/portage.py
index 9c0c8f1d9..dd007f1f1 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6714,7 +6714,8 @@ mtimedb={}
mtimedbkeys=[
"updates", "info",
"version", "starttime",
-"resume", "ldpath"
+"resume", "resume_backup",
+"ldpath"
]
mtimedbfile=root+"var/cache/edb/mtimedb"
try: