Revision: 19605
Author:   [email protected]
Date:     Fri Feb 28 12:32:54 2014 UTC
Log: When upgrading the test data twice, don't bail out because of an existing backup

BUG=none
[email protected]
LOG=n

Review URL: https://codereview.chromium.org/183853004
http://code.google.com/p/v8/source/detail?r=19605

Modified:
 /branches/bleeding_edge/test/mozilla/testcfg.py
 /branches/bleeding_edge/test/test262/testcfg.py

=======================================
--- /branches/bleeding_edge/test/mozilla/testcfg.py Thu Apr 18 11:01:14 2013 UTC +++ /branches/bleeding_edge/test/mozilla/testcfg.py Fri Feb 28 12:32:54 2014 UTC
@@ -132,8 +132,11 @@

     # If we have a local archive file with the test data, extract it.
     directory_name = "data"
+    directory_name_old = "data.old"
     if os.path.exists(directory_name):
-      os.rename(directory_name, "data.old")
+      if os.path.exists(directory_name_old):
+        shutil.rmtree(directory_name_old)
+      os.rename(directory_name, directory_name_old)
     archive_file = "downloaded_%s.tar.gz" % MOZILLA_VERSION
     if os.path.exists(archive_file):
       with tarfile.open(archive_file, "r:gz") as tar:
=======================================
--- /branches/bleeding_edge/test/test262/testcfg.py Fri Sep 20 09:26:25 2013 UTC +++ /branches/bleeding_edge/test/test262/testcfg.py Fri Feb 28 12:32:54 2014 UTC
@@ -28,6 +28,7 @@

 import hashlib
 import os
+import shutil
 import sys
 import tarfile
 import urllib
@@ -98,6 +99,8 @@
       print "Downloading test data from %s ..." % archive_url
       urllib.urlretrieve(archive_url, archive_name)
       if os.path.exists(directory_name):
+        if os.path.exists(directory_old_name):
+          shutil.rmtree(directory_old_name)
         os.rename(directory_name, directory_old_name)
     if not os.path.exists(directory_name):
       print "Extracting test262-%s.tar.bz2 ..." % revision

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to