From 199dcbd927a7aebec58f56222a6e79e596168925 Mon Sep 17 00:00:00 2001 From: Fabio Tranchitella Date: Sat, 22 Jul 2006 17:06:55 +0000 Subject: [PATCH] The "I don't know why I chose this job" changeset: fixed the undo code. --- britney.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/britney.py b/britney.py index 2894850..50b3403 100644 --- a/britney.py +++ b/britney.py @@ -1395,6 +1395,9 @@ class Britney: del self.binaries['testing'][arch][0][binary] undo['sources'][pkg_name] = source del self.sources['testing'][pkg_name] + else: + undo['sources']['-' + pkg_name] = True + # single architecture update (eg. binNMU) else: if self.binaries['testing'][arch][0].has_key(pkg_name): @@ -1481,21 +1484,23 @@ class Britney: output.write(" * %s: %s\n" % (arch, ", ".join(nuninst[arch]))) extra.append(pkg) - # undo the changes (source and new binaries) + # undo the changes (source) for k in undo['sources'].keys(): - if k in self.sources[suite]: - for p in self.sources[suite][k]['binaries']: - binary, arch = p.split("/") - del self.binaries['testing'][arch][0][binary] - del self.sources['testing'][k] - self.sources['testing'][k] = undo['sources'][k] + if k[0] == '-': + del self.sources['testing'][k[1:]] + else: self.sources['testing'][k] = undo['sources'][k] + + # undo the changes (new binaries) + if pkg in self.sources[suite]: + for p in self.sources[suite][pkg]['binaries']: + binary, arch = p.split("/") + del self.binaries['testing'][arch][0][binary] # undo the changes (binaries) for p in undo['binaries'].keys(): binary, arch = p.split("/") self.binaries['testing'][arch][0][binary] = undo['binaries'][p] - def do_all(self, output): nuninst_start = self.get_nuninst() output.write("start: %s\n" % self.eval_nuninst(nuninst_start))