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

Side by Side 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 7 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/slave/slave_utils.py » ('j') | scripts/slave/slave_utils.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A tool to extract a build, executed by a buildbot slave. 6 """A tool to extract a build, executed by a buildbot slave.
7 """ 7 """
8 8
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 abs_webkit_dir = None 71 abs_webkit_dir = None
72 if options.webkit_dir: 72 if options.webkit_dir:
73 abs_webkit_dir = os.path.join(abs_build_dir, '..', options.webkit_dir) 73 abs_webkit_dir = os.path.join(abs_build_dir, '..', options.webkit_dir)
74 base_filename, version_suffix = slave_utils.GetZipFileNames( 74 base_filename, version_suffix = slave_utils.GetZipFileNames(
75 options.build_properties, abs_build_dir, abs_webkit_dir, extract=True) 75 options.build_properties, abs_build_dir, abs_webkit_dir, extract=True)
76 76
77 replace_dict = dict(options.build_properties) 77 replace_dict = dict(options.build_properties)
78 # If builddir isn't specified, assume buildbot used the builder name 78 # If builddir isn't specified, assume buildbot used the builder name
79 # as the root folder for the build. 79 # as the root folder for the build.
80 if not replace_dict.get('parent_builddir'): 80 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
81 replace_dict['parent_builddir'] = replace_dict['parentname'] 81 replace_dict['parent_builddir'] = replace_dict['parentname']
82 replace_dict['base_filename'] = base_filename 82 replace_dict['base_filename'] = base_filename
83 url = options.build_url or options.factory_properties.get('build_url') 83 url = options.build_url or options.factory_properties.get('build_url')
84 if not url: 84 if not url:
85 url = ('http://%(parentslavename)s/b/build/slave/%(parent_builddir)s/' 85 url = ('http://%(parentslavename)s/b/build/slave/%(parent_builddir)s/'
86 'chrome_staging') 86 'chrome_staging')
87 if url[-4:] != '.zip': # assume filename not specified 87 if url[-4:] != '.zip': # assume filename not specified
88 url = os.path.join(url, '%(base_filename)s.zip') 88 # 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
89 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.
90 url = '%s/%s' % (url, '%(base_filename)s.zip')
89 url = url % replace_dict 91 url = url % replace_dict
90 92
91 versioned_url = url.replace('.zip', version_suffix + '.zip') 93 versioned_url = url.replace('.zip', version_suffix + '.zip')
92 return url, versioned_url 94 return url, versioned_url
93 95
94 96
95 def real_main(options): 97 def real_main(options):
96 """ Download a build, extract it to build\BuildDir\full-build-win32 98 """ Download a build, extract it to build\BuildDir\full-build-win32
97 and rename it to build\BuildDir\Target 99 and rename it to build\BuildDir\Target
98 """ 100 """
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if not options.target: 237 if not options.target:
236 options.target = options.factory_properties.get('target', 'Release') 238 options.target = options.factory_properties.get('target', 'Release')
237 if not options.webkit_dir: 239 if not options.webkit_dir:
238 options.webkit_dir = options.factory_properties.get('webkit_dir') 240 options.webkit_dir = options.factory_properties.get('webkit_dir')
239 241
240 return real_main(options) 242 return real_main(options)
241 243
242 244
243 if '__main__' == __name__: 245 if '__main__' == __name__:
244 sys.exit(main()) 246 sys.exit(main())
OLDNEW
« 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