From: Joerg Jaspert Date: Sun, 2 Mar 2008 21:11:28 +0000 (+0100) Subject: Make the no-action working X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f1e5180c650220ad688c3b2cbe36e2a45e517db;p=dak Make the no-action working --- diff --git a/dak/check_transitions.py b/dak/check_transitions.py index 39f24b4d..89ac4c7f 100755 --- a/dak/check_transitions.py +++ b/dak/check_transitions.py @@ -62,6 +62,7 @@ def init(): def usage (exit_code=0): print """Usage: check_transitions [OPTION]... + Check the release managers transition file for correctness and outdated transitions -h, --help show this help and exit. -n, --no-action don't do anything""" sys.exit(exit_code) @@ -95,7 +96,7 @@ def main(): to_remove = [] # Now look through all defined transitions for trans in transitions: - t = transition[trans] + t = transitions[trans] source = t["source"] new_vers = t["new"] @@ -124,9 +125,13 @@ Looking at transition: %s if to_dump: for remove in to_remove: - del transitions[remove] - destfile = file(Cnf["Dinstall::Reject::ReleaseTransitions"], 'w') - dump(transitions, destfile) + if Options["No-Action"]: + print "I: I would remove the %s transition" % (remove) + else: + del transitions[remove] + if not Options["No-Action"]: + destfile = file(Cnf["Dinstall::Reject::ReleaseTransitions"], 'w') + dump(transitions, destfile) ################################################################################