From 84f78c101211139fef0b10d63676e5d0f42c2a45 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mon, 23 Feb 2009 16:38:26 -0500 Subject: Fix atomic unpack_rpm --- debuginfofs-mirror | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debuginfofs-mirror b/debuginfofs-mirror index e751724..f9e9154 100755 --- a/debuginfofs-mirror +++ b/debuginfofs-mirror @@ -153,7 +153,10 @@ def _unpack_rpm(rpm, targetdir): def unpack_rpm(rpm, targetdir): '''Unpack the given rpm into a temporary directory alongside the targetdir, then rename the temp dir once finished.''' - tmpdir = tempfile.mkdtemp(dir=os.path.dirname(targetdir)) + dir = os.path.dirname(targetdir) + if not os.path.isdir(dir): + os.makedirs(targetdir,mode=0755) + tmpdir = tempfile.mkdtemp(dir=dir) try: _unpack_rpm(rpm, tmpdir) if os.path.isdir(targetdir): -- cgit