diff options
author | Will Woods <wwoods@redhat.com> | 2009-02-23 16:38:26 -0500 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-02-23 16:38:26 -0500 |
commit | 84f78c101211139fef0b10d63676e5d0f42c2a45 (patch) | |
tree | eb47c2d9ce68e6bbdd0c6ede3b602ea49dc374ac | |
parent | 04e92630622e3be21d7dabbfd39ebe5bd3620324 (diff) | |
download | debuginfofs-84f78c101211139fef0b10d63676e5d0f42c2a45.tar.gz debuginfofs-84f78c101211139fef0b10d63676e5d0f42c2a45.tar.xz debuginfofs-84f78c101211139fef0b10d63676e5d0f42c2a45.zip |
Fix atomic unpack_rpm
-rwxr-xr-x | debuginfofs-mirror | 5 |
1 files changed, 4 insertions, 1 deletions
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): |