]> err.no Git - dak/commitdiff
Move TempPath under Dir option instead of creating a new one
authorLuca Falavigna <dktrkranz@debian.org>
Sat, 21 Nov 2009 12:22:28 +0000 (13:22 +0100)
committerLuca Falavigna <dktrkranz@debian.org>
Sat, 21 Nov 2009 12:22:28 +0000 (13:22 +0100)
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
config/debian/dak.conf
dak/transitions.py
daklib/holding.py

index d7006c879bf6742c8dc1239eada8af9d2f8413a7..bb7682b2e0ec48acb0e1b7a051e60b9b1d72873b 100644 (file)
@@ -554,6 +554,7 @@ Dir
   Override "/srv/ftp.debian.org/scripts/override/";
   QueueBuild "/srv/incoming.debian.org/buildd/";
   UrgencyLog "/srv/release.debian.org/britney/input/urgencies/";
+  TempPath "/srv/ftp.debian.org/tmp/";
   Queue
   {
     Byhand "/srv/ftp.debian.org/queue/byhand/";
@@ -743,8 +744,3 @@ Contents
   Header "contents";
   Root "/srv/ftp.debian.org/test/";
 }
-
-TempPath
-{
-   TempPath "/srv/ftp.debian.org/tmp/";
-};
index 2bd32381afc1b010caff11babb2af57c0644bed5..157e1c0a0febbcf6074f03ad49115c88ac583373 100755 (executable)
@@ -287,8 +287,8 @@ def write_transitions_from_file(from_file):
     """
 
     # Lets check if from_file is in the directory we expect it to be in
-    if not os.path.abspath(from_file).startswith(Cnf["TempPath::TempPath"]):
-        print "Will not accept transitions file outside of %s" % (Cnf["TempPath::TempPath"])
+    if not os.path.abspath(from_file).startswith(Cnf["Dir::TempPath"]):
+        print "Will not accept transitions file outside of %s" % (Cnf["Dir::TempPath"])
         sys.exit(3)
 
     if Options["sudo"]:
@@ -318,7 +318,7 @@ def temp_transitions_file(transitions):
            sudo-ed script and would be unreadable if it has default mkstemp mode
     """
 
-    (fd, path) = tempfile.mkstemp("", "transitions", Cnf["TempPath::TempPath"])
+    (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"])
     os.chmod(path, 0644)
     f = open(path, "w")
     yaml.dump(transitions, f, default_flow_style=False)
@@ -577,13 +577,13 @@ def main():
                           (Cnf["Dinstall::Reject::ReleaseTransitions"]))
         sys.exit(1)
     # Also check if our temp directory is defined and existant
-    temppath = Cnf.get("TempPath::TempPath", "")
+    temppath = Cnf.get("Dir::TempPath", "")
     if temppath == "":
-        utils.warn("TempPath::TempPath not defined")
+        utils.warn("Dir::TempPath not defined")
         sys.exit(1)
     if not os.path.exists(temppath):
         utils.warn("Temporary path %s not found." %
-                          (Cnf["TempPath::TempPath"]))
+                          (Cnf["Dir::TempPath"]))
         sys.exit(1)
 
     if Options["import"]:
index 79d5ef7161a8de074f3a881a98e3af8bab5d7621..f77416cadc224c7a6827608883df8db6037dd2c6 100644 (file)
@@ -48,7 +48,7 @@ class Holding(object):
             self.holding_dir = Config()["Dir::Queue::Holding"]
             # ftptrainees haven't access to holding, use a temp directory instead
             if not os.access(self.holding_dir, os.W_OK):
-                self.holding_dir = Config()["TempPath::TempPath"]
+                self.holding_dir = Config()["Dir::TempPath"]
 
     def copy_to_holding(self, filename):
         base_filename = os.path.basename(filename)