[ostree] vcs: Delete temporary directory too



commit 097c1b80254e243b5729bf05708d55c9f912a29d
Author: Colin Walters <walters verbum org>
Date:   Thu Feb 2 13:56:46 2012 -0500

    vcs: Delete temporary directory too

 src/ostbuild/pyostbuild/vcs.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/ostbuild/pyostbuild/vcs.py b/src/ostbuild/pyostbuild/vcs.py
index 81b3e87..a6d2470 100755
--- a/src/ostbuild/pyostbuild/vcs.py
+++ b/src/ostbuild/pyostbuild/vcs.py
@@ -49,8 +49,10 @@ def get_vcs_checkout(mirrordir, keytype, uri, dest, branch, overwrite=True):
     if not os.path.isdir(checkoutdir_parent):
         os.makedirs(checkoutdir_parent)
     tmp_dest = dest + '.tmp'
-    if os.path.isdir(dest) and overwrite:
+    if os.path.isdir(tmp_dest):
         shutil.rmtree(tmp_dest)
+    if os.path.isdir(dest) and overwrite:
+        shutil.rmtree(dest)
     if not os.path.isdir(tmp_dest):
         run_sync(['git', 'clone', '-q',
                   '--no-checkout', module_mirror, tmp_dest])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]