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

Unified Diff: dart/tools/get_archive.py

Issue 692333008: Don't delete old version before new version is downloaded. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/get_archive.py
diff --git a/dart/tools/get_archive.py b/dart/tools/get_archive.py
index f6ec8cd0736469208d3030c793a124434ab5fe04..409d14741d2c3a6b9938bb5216bd84267bb55627 100755
--- a/dart/tools/get_archive.py
+++ b/dart/tools/get_archive.py
@@ -240,10 +240,6 @@ def GetFromGsutil(name, directory, version_file, latest_pattern,
print name + ' is up to date.\nVersion: ' + latest
return 0 # up to date
- if os.path.exists(directory):
- print 'Removing old %s tree %s' % (name, directory)
- shutil.rmtree(directory)
-
# download the zip file to a temporary path, and unzip to the target location
temp_dir = tempfile.mkdtemp()
try:
@@ -270,7 +266,10 @@ def GetFromGsutil(name, directory, version_file, latest_pattern,
if directory == SDK_DIR:
unzipped_dir = os.path.join(temp_dir, 'dart-sdk')
if os.path.exists(directory):
- raise Exception(
+ print 'Removing old %s tree %s' % (name, directory)
+ shutil.rmtree(directory)
+ if os.path.exists(directory):
+ raise Exception(
'Removal of directory %s failed. Is the executable running?' %
directory)
shutil.move(unzipped_dir, directory)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698