summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/storage.py10
-rwxr-xr-xupdate.py7
2 files changed, 14 insertions, 3 deletions
diff --git a/scripts/storage.py b/scripts/storage.py
index b15c76855..8ae2e2676 100755
--- a/scripts/storage.py
+++ b/scripts/storage.py
@@ -39,11 +39,15 @@ def download_revision(force_latest):
def download_tar(tar_pattern, directory, revision):
tar_path = os.path.join(directory, tar_pattern)
revision_tar_path = tar_path % revision
- if not os.path.isfile(revision_tar_path):
+ if os.path.isfile(revision_tar_path):
+ print 'Already have `%s`' % revision_tar_path
+ else:
+ print 'Downloading `%s`' % revision_tar_path
with open(revision_tar_path, 'w+') as f:
f.write(urllib2.urlopen(STORAGE_BASE + tar_pattern % revision).read())
# Remove any previous tarfiles.
- for older_tar in glob.glob(tar_path):
+ for older_tar in glob.glob(tar_path % '*'):
if older_tar != revision_tar_path:
- os.path.remove(older_tar)
+ print 'Removing older tar file `%s`' % older_tar
+ os.remove(older_tar)
return revision_tar_path
diff --git a/update.py b/update.py
index 7b949d895..4bc95b5ac 100755
--- a/update.py
+++ b/update.py
@@ -27,17 +27,24 @@ REVISION_PATH = os.path.join(BASE_DIR, 'revision')
TORTURE_TAR = 'wasm-torture-s-%s.tbz2'
+def current_revision():
+ with open(REVISION_PATH, 'r') as f:
+ return f.read()
+
+
def write_revision(revision):
with open(REVISION_PATH, 'w') as f:
f.write(revision)
def run(force_latest, override_build):
+ print 'Updating git submodules'
subprocess.check_call(['git', 'submodule', 'sync', '--quiet'])
subprocess.check_call(['git', 'submodule', 'init', '--quiet'])
subprocess.check_call(['git', 'submodule', 'update', '--quiet'])
subprocess.check_call(['git', 'submodule', 'foreach',
'git', 'pull', 'origin', 'master', '--quiet'])
+ print 'Updating from the waterfall, current revision', current_revision()
updates = 0
revision = (override_build if override_build else
scripts.storage.download_revision(force_latest=force_latest))