]> git.decadent.org.uk Git - dak.git/commitdiff
merge from Joerg
authorAnthony Towns <aj@azure.humbug.org.au>
Sat, 22 Mar 2008 11:39:31 +0000 (11:39 +0000)
committerAnthony Towns <aj@azure.humbug.org.au>
Sat, 22 Mar 2008 11:39:31 +0000 (11:39 +0000)
config/debian/extensions.py
dak/transitions.py

index 51c9f82a3f9a4ef4076b4f432f87c39bef846139..e17e9af88b518983af39012202da5f830de88f7d 100644 (file)
@@ -72,7 +72,8 @@ is part of a testing transition designed to get %s migrated (it is
 currently %s, we need version %s).  This transition is managed by the
 Release Team, and %s is the Release-Team member responsible for it.
 Please mail debian-release@lists.debian.org or contact %s directly if you
-need further assistance."""
+need further assistance.  You might want to upload to experimental until this
+transition is done."""
                         % (source, currentlymsg, expected,t["rm"], t["rm"])))
 
                 reject(rejectmsg + "\n")
index d1d62cdf67ef773db6ccd471ef8e57a27bd52f6c..d8845a0bfe153b9aea560f681a48613b75e8e68d 100755 (executable)
@@ -58,6 +58,9 @@ def init():
 
     Options = Cnf.SubTree("Edit-Transitions::Options")
 
+    if Options["help"]:
+        usage()
+
     whoami = os.getuid()
     whoamifull = pwd.getpwuid(whoami)
     username = whoamifull[0]
@@ -68,15 +71,11 @@ def init():
     projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
     daklib.database.init(Cnf, projectB)
     
-    if Options["help"]:
-        usage()
-
 ################################################################################
 
 def usage (exit_code=0):
     print """Usage: transitions [OPTION]...
 Update and check the release managers transition file.
-transitions.
 
 Options:
 
@@ -85,7 +84,7 @@ Options:
   -i, --import <file>       check and import transitions from file
   -c, --check               check the transitions file, remove outdated entries
   -S, --sudo                use sudo to update transitions file
-  -n, --no-action           don't do anything"""
+  -n, --no-action           don't do anything (only affects check)"""
 
     sys.exit(exit_code)
 
@@ -167,8 +166,11 @@ def write_transitions_from_file(from_file):
 
 def temp_transitions_file(transitions):
     # NB: file is unlinked by caller, but fd is never actually closed.
-
+    # We need the chmod, as the file is (most possibly) copied from a
+    # sudo-ed script and would be unreadable if it has default mkstemp mode
+    
     (fd, path) = tempfile.mkstemp("","transitions")
+    os.chmod(path, 0644)
     f = open(path, "w")
     syck.dump(transitions, f)
     return path
@@ -192,11 +194,12 @@ def edit_transitions():
 
         if test == None:
             # Edit is broken
-           print "Edit was unparsable."
+            print "Edit was unparsable."
             prompt = "[E]dit again, Drop changes?"
-           default = "E"
-       else:
-           print "Edit looks okay.\n"
+            default = "E"
+        else:
+            print "Edit looks okay.\n"
+            print "The following transitions are defined:"
             print "------------------------------------------------------------------------"
             transition_info(test)
 
@@ -219,9 +222,9 @@ def edit_transitions():
         elif answer == 'S':
             # Ready to save
             break
-       else:
-           print "You pressed something you shouldn't have :("
-           sys.exit(1)
+        else:
+            print "You pressed something you shouldn't have :("
+            sys.exit(1)
 
     # We seem to be done and also have a working file. Copy over.
     write_transitions_from_file(edit_file)