From 99e31dde189efc3151b99830bc21fcaed6b82d33 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Mar 2006 07:25:07 +0000 Subject: [PATCH] Do automatic backup the resume list when it's length is greater than 1 for bug #122527. svn path=/main/trunk/; revision=2847 --- bin/emerge | 13 ++++++++++++- pym/portage.py | 3 ++- 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: -- 2.26.2