From 351d243ccf33b0dd979d84a67e6288621dd84227 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 9 Feb 2012 16:47:25 -0500 Subject: [PATCH] ostbuild: Fix --debug-shell We want to reuse an existing source tree. --- src/ostbuild/pyostbuild/vcs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ostbuild/pyostbuild/vcs.py b/src/ostbuild/pyostbuild/vcs.py index a6d2470d..adf947a8 100755 --- a/src/ostbuild/pyostbuild/vcs.py +++ b/src/ostbuild/pyostbuild/vcs.py @@ -51,8 +51,11 @@ def get_vcs_checkout(mirrordir, keytype, uri, dest, branch, overwrite=True): tmp_dest = dest + '.tmp' if os.path.isdir(tmp_dest): shutil.rmtree(tmp_dest) - if os.path.isdir(dest) and overwrite: - shutil.rmtree(dest) + if os.path.isdir(dest): + if overwrite: + shutil.rmtree(dest) + else: + return dest if not os.path.isdir(tmp_dest): run_sync(['git', 'clone', '-q', '--no-checkout', module_mirror, tmp_dest])