From 4f1e5180c650220ad688c3b2cbe36e2a45e517db Mon Sep 17 00:00:00 2001
From: Joerg Jaspert <joerg@debian.org>
Date: Sun, 2 Mar 2008 22:11:28 +0100
Subject: [PATCH] Make the no-action working

---
 dak/check_transitions.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

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)
 
 ################################################################################
 
-- 
2.39.5