@@ -108,6 +108,9 @@ def parse_cmdline():
parser.add_argument("--prebuild", action="store_true", default=False,
help="build each recipe at its current version before attempting upgrade")
+ parser.add_argument("--resume", action="store_true", default=False,
+ help="skip recipes already attempted in the last run")
+
parser.add_argument("-d", "--debug-level", type=int, default=4, choices=range(1, 6),
help="set the debug level: CRITICAL=1, ERROR=2, WARNING=3, INFO=4, DEBUG=5")
parser.add_argument("-e", "--send-emails", action="store_true", default=False,
@@ -515,9 +518,33 @@ class Updater(object):
succeeded_pkggroups_ctx = []
failed_pkggroups_ctx = []
attempted_pkggroups = 0
+
+ # --resume: skip recipes already attempted in the most recent run
+ resume_skip = set()
+ if self.args.resume:
+ import glob as _glob
+ prev_runs = sorted(_glob.glob(os.path.join(self.uh_dir, "20*")))
+ # skip the current run dir (last entry) if it exists
+ prev_runs = [r for r in prev_runs if r != self.uh_work_dir]
+ if prev_runs:
+ prev_log = os.path.join(prev_runs[-1], "upgrade-helper.log")
+ if os.path.isfile(prev_log):
+ with open(prev_log) as f:
+ for line in f:
+ m = re.match(r'\s+(\S+): (?:Upgrading to|Pre-build FAILED)', line)
+ if m:
+ resume_skip.add(m.group(1))
+ I(" --resume: skipping %d recipes from %s" %
+ (len(resume_skip), prev_runs[-1]))
for g in pkggroups_ctx:
attempted_pkggroups += 1
pkggroup_name = g["name"]
+
+ if pkggroup_name in resume_skip:
+ I(" SKIP PACKAGE GROUP %d/%d (already attempted): %s" %
+ (attempted_pkggroups, total_pkggroups, pkggroup_name))
+ continue
+
I(" ATTEMPT PACKAGE GROUP %d/%d" % (attempted_pkggroups, total_pkggroups))
# Build current version first to verify it builds and seed ABI reference