提交 e8f6c03c 编写于 作者: J Joerg Jaspert

Check if temppath exists

上级 8667340f
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* dak/transitions.py (temp_transitions_file): Use the TempPath * dak/transitions.py (temp_transitions_file): Use the TempPath
(write_transitions_from_file): Check if the file we should get our (write_transitions_from_file): Check if the file we should get our
transitions from is in our TempPath, error out if it isnt transitions from is in our TempPath, error out if it isnt
(main): Check for TempPath existance
2008-04-12 James Troup <troup@debian.org> 2008-04-12 James Troup <troup@debian.org>
......
...@@ -232,7 +232,7 @@ def temp_transitions_file(transitions): ...@@ -232,7 +232,7 @@ def temp_transitions_file(transitions):
# We need the chmod, as the file is (most possibly) copied from a # 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 # 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) os.chmod(path, 0644)
f = open(path, "w") f = open(path, "w")
syck.dump(transitions, f) syck.dump(transitions, f)
...@@ -419,6 +419,15 @@ def main(): ...@@ -419,6 +419,15 @@ def main():
daklib.utils.warn("ReleaseTransitions file, %s, not found." % daklib.utils.warn("ReleaseTransitions file, %s, not found." %
(Cnf["Dinstall::Reject::ReleaseTransitions"])) (Cnf["Dinstall::Reject::ReleaseTransitions"]))
sys.exit(1) 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"]: if Options["import"]:
try: try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册