Commit 9d515242 authored by jochen@chromium.org's avatar jochen@chromium.org

When upgrading the test data twice, don't bail out because of an existing backup

BUG=none
R=jkummerow@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/183853004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b1ffc790
...@@ -132,8 +132,11 @@ class MozillaTestSuite(testsuite.TestSuite): ...@@ -132,8 +132,11 @@ class MozillaTestSuite(testsuite.TestSuite):
# If we have a local archive file with the test data, extract it. # If we have a local archive file with the test data, extract it.
directory_name = "data" directory_name = "data"
directory_name_old = "data.old"
if os.path.exists(directory_name): 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 archive_file = "downloaded_%s.tar.gz" % MOZILLA_VERSION
if os.path.exists(archive_file): if os.path.exists(archive_file):
with tarfile.open(archive_file, "r:gz") as tar: with tarfile.open(archive_file, "r:gz") as tar:
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
import hashlib import hashlib
import os import os
import shutil
import sys import sys
import tarfile import tarfile
import urllib import urllib
...@@ -98,6 +99,8 @@ class Test262TestSuite(testsuite.TestSuite): ...@@ -98,6 +99,8 @@ class Test262TestSuite(testsuite.TestSuite):
print "Downloading test data from %s ..." % archive_url print "Downloading test data from %s ..." % archive_url
urllib.urlretrieve(archive_url, archive_name) urllib.urlretrieve(archive_url, archive_name)
if os.path.exists(directory_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) os.rename(directory_name, directory_old_name)
if not os.path.exists(directory_name): if not os.path.exists(directory_name):
print "Extracting test262-%s.tar.bz2 ..." % revision print "Extracting test262-%s.tar.bz2 ..." % revision
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment