From 760c7fcd88fa8d20ccc3df42d3853364d17f3a77 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sat, 21 Nov 2009 13:22:28 +0100 Subject: [PATCH] Move TempPath under Dir option instead of creating a new one Signed-off-by: Luca Falavigna --- config/debian/dak.conf | 6 +----- dak/transitions.py | 12 ++++++------ daklib/holding.py | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/config/debian/dak.conf b/config/debian/dak.conf index d7006c87..bb7682b2 100644 --- a/config/debian/dak.conf +++ b/config/debian/dak.conf @@ -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/"; -}; diff --git a/dak/transitions.py b/dak/transitions.py index 2bd32381..157e1c0a 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -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"]: diff --git a/daklib/holding.py b/daklib/holding.py index 79d5ef71..f77416ca 100644 --- a/daklib/holding.py +++ b/daklib/holding.py @@ -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) -- 2.39.5