Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 29733599: Issue 6523 - Update softlink for downloaded builds (Closed) Base URL: https://hg.adblockplus.org/abpssembly/file/f92468d41835
Patch Set: Created March 26, 2018, 9:36 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: sitescripts/extensions/bin/createNightlies.py
diff --git a/sitescripts/extensions/bin/createNightlies.py b/sitescripts/extensions/bin/createNightlies.py
index f8011b8db28ab612f91ef87fb1dc51c8ad1810d4..077c0a31be8582ccbf9b4469a46b0583811656bc 100644
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -551,7 +551,7 @@ class NightlyBuild(object):
checksum = response['files'][0]['hash']
filename = '{}-{}.xpi'.format(self.basename, version)
- file_path = os.path.join(
+ self.path = os.path.join(
config.get('extensions', 'nightliesDirectory'),
self.basename,
filename
@@ -573,7 +573,7 @@ class NightlyBuild(object):
logging.error('Checksum could not be verified: {} vs {}'
''.format(checksum, returned_checksum))
- with open(file_path, 'w') as fp:
+ with open(self.path, 'w') as fp:
fp.write(file_content)
self.update_link = os.path.join(
@@ -846,6 +846,17 @@ class NightlyBuild(object):
versions = self.retireBuilds()
# update index page
self.updateIndex(versions)
+
+ # Update soft link to latest build
+ baseDir = os.path.join(
+ self.config.nightliesDirectory, self.basename
+ )
+ linkPath = os.path.join(
+ baseDir, '00latest' + self.config.packageSuffix
+ )
+
+ self.symlink_or_copy(self.path, linkPath)
Vasily Kuznetsov 2018/03/26 19:12:11 What if we don't have `self.path` because in `down
+
finally:
# clean up
if self.tempdir:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld