Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: client/bin/base_utils.py

Issue 1317002: Continue to refactor autoserv to build client test at run time. (Closed)
Patch Set: path 18 Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/bin/autotest ('k') | client/bin/setup_job.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/base_utils.py
diff --git a/client/bin/base_utils.py b/client/bin/base_utils.py
index 96d1fc06fa4f616433bae03cff85ec0053cb4279..7c5d26b11996363277180757c9049b9559b95cd1 100644
--- a/client/bin/base_utils.py
+++ b/client/bin/base_utils.py
@@ -63,7 +63,10 @@ def extract_tarball_to_dir(tarball, dir):
the top level of a tarball is - useful for versioned directory names, etc
"""
if os.path.exists(dir):
- raise NameError, 'target %s already exists' % dir
+ if os.path.isdir(dir):
+ shutil.rmtree(dir)
+ else:
+ os.remove(dir)
pwd = os.getcwd()
os.chdir(os.path.dirname(os.path.abspath(dir)))
newdir = extract_tarball(tarball)
« no previous file with comments | « client/bin/autotest ('k') | client/bin/setup_job.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698