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

Unified Diff: scripts/slave/extract_build.py

Issue 11451004: Bugfixing URL construction for extract build step (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Removing urlparse + fix build_properties use Created 8 years 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 | scripts/slave/slave_utils.py » ('j') | scripts/slave/slave_utils.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/extract_build.py
diff --git a/scripts/slave/extract_build.py b/scripts/slave/extract_build.py
index f08fba727d374df40ece3e539995cdb16a0caf88..c48911ab2d4aa473ed5c82bdef148a3d9aa02a0a 100755
--- a/scripts/slave/extract_build.py
+++ b/scripts/slave/extract_build.py
@@ -77,7 +77,7 @@ def GetBuildUrl(abs_build_dir, options):
replace_dict = dict(options.build_properties)
# If builddir isn't specified, assume buildbot used the builder name
# as the root folder for the build.
- if not replace_dict.get('parent_builddir'):
+ if not replace_dict.get('parent_builddir') and replace_dict.get('parentname'):
kjellander_chromium 2012/12/28 16:47:31 This avoids crashing if an empty build_properties
Isaac (away) 2013/01/08 08:54:02 Still might crash because replace_dict wouldn't ha
kjellander_chromium 2013/01/08 09:32:52 Good idea. Updated. On 2013/01/08 08:54:02, Isaac
replace_dict['parent_builddir'] = replace_dict['parentname']
replace_dict['base_filename'] = base_filename
url = options.build_url or options.factory_properties.get('build_url')
@@ -85,7 +85,9 @@ def GetBuildUrl(abs_build_dir, options):
url = ('http://%(parentslavename)s/b/build/slave/%(parent_builddir)s/'
'chrome_staging')
if url[-4:] != '.zip': # assume filename not specified
- url = os.path.join(url, '%(base_filename)s.zip')
+ # Append the filename to the base URL. First strip any trailing slashes.
kjellander_chromium 2012/12/28 16:47:31 Simple way of avoiding double slashes being concat
+ url = url.strip('/')
Isaac (away) 2013/01/08 08:54:02 nit, cleaner to use rstrip
kjellander_chromium 2013/01/08 09:32:52 Done.
+ url = '%s/%s' % (url, '%(base_filename)s.zip')
url = url % replace_dict
versioned_url = url.replace('.zip', version_suffix + '.zip')
« no previous file with comments | « no previous file | scripts/slave/slave_utils.py » ('j') | scripts/slave/slave_utils.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698