]> git.decadent.org.uk Git - dak.git/commitdiff
Check if temppath exists
authorJoerg Jaspert <joerg@debian.org>
Thu, 17 Apr 2008 21:23:08 +0000 (23:23 +0200)
committerJoerg Jaspert <joerg@debian.org>
Thu, 17 Apr 2008 21:23:08 +0000 (23:23 +0200)
ChangeLog
dak/transitions.py

index b0239f5152a54b875178d89acdbf523d59f79402..f09a1b02bbf8aaac240c35400f0d7cd8430ad908 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
        * dak/transitions.py (temp_transitions_file): Use the TempPath
        (write_transitions_from_file): Check if the file we should get our
        transitions from is in our TempPath, error out if it isnt
+       (main): Check for TempPath existance
 
 2008-04-12  James Troup  <troup@debian.org>
 
index 43c2ae6e362884289b565db1749f639155bb0ad6..530ef0c87d99b4677ae87b2c38287d2ffee27c2e 100755 (executable)
@@ -232,7 +232,7 @@ def temp_transitions_file(transitions):
     # 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",Cnf["Transitions::TempPath"])
+    (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Transitions::TempPath"])
     os.chmod(path, 0644)
     f = open(path, "w")
     syck.dump(transitions, f)
@@ -419,6 +419,15 @@ def main():
         daklib.utils.warn("ReleaseTransitions file, %s, not found." %
                           (Cnf["Dinstall::Reject::ReleaseTransitions"]))
         sys.exit(1)
+    # Also check if our temp directory is defined and existant
+    temppath = Cnf.get("Transitions::TempPath", "")
+    if temppath == "":
+        daklib.utils.warn("Transitions::TempPath not defined")
+        sys.exit(1)
+    if not os.path.exists(temppath):
+        daklib.utils.warn("Temporary path %s not found." %
+                          (Cnf["Transitions::TempPath"]))
+        sys.exit(1)
    
     if Options["import"]:
         try: