From 1ace684ee5236cbcd28a2484fa1fb0618efc72a3 Mon Sep 17 00:00:00 2001 From: Mike Shal Date: Wed, 13 May 2015 14:26:53 -0400 Subject: [PATCH] Bug 1155349 - set packageFilename in mach properties; r=glandium --- build/gen_mach_buildprops.py | 12 +++++++----- build/moz-automation.mk | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/gen_mach_buildprops.py b/build/gen_mach_buildprops.py index 04ba2e7044e..7fe5c6cf8ec 100644 --- a/build/gen_mach_buildprops.py +++ b/build/gen_mach_buildprops.py @@ -40,7 +40,7 @@ def getMarProperties(filename, partial=False): '%sMarHash' % martype: mar_hash, } -def getUrlProperties(filename): +def getUrlProperties(filename, package): # let's create a switch case using name-spaces/dict # rather than a long if/else with duplicate code property_conditions = [ @@ -57,9 +57,7 @@ def getUrlProperties(filename): ('codeCoverageURL', lambda m: m.endswith('code-coverage-gcno.zip')), ('sdkUrl', lambda m: m.endswith(('sdk.tar.bz2', 'sdk.zip'))), ('testPackagesUrl', lambda m: m.endswith('test_packages.json')), - # packageUrl must be last! - ('packageUrl', lambda m: (not m.endswith('.json') and - not m.endswith('tests.zip'))), + ('packageUrl', lambda m: m.endswith(package)), ] url_re = re.compile(r'''^(https?://.*?\.(?:tar\.bz2|dmg|zip|apk|rpm|mar|tar\.gz|json))$''') properties = {} @@ -102,10 +100,13 @@ if __name__ == '__main__': parser.add_argument("--upload-files", required=True, nargs="+", action="store", dest="upload_files", help="List of files to be uploaded.") + parser.add_argument("--package", required=True, + action="store", dest="package", + help="Filename of the build package") args = parser.parse_args() json_data = getMarProperties(args.complete_mar_file) - json_data.update(getUrlProperties(args.upload_output)) + json_data.update(getUrlProperties(args.upload_output, args.package)) if args.partial_mar_file: json_data.update(getMarProperties(args.partial_mar_file, partial=True)) @@ -119,6 +120,7 @@ if __name__ == '__main__': json_data['partialInfo'] = getPartialInfo(json_data) json_data['uploadFiles'] = args.upload_files + json_data['packageFilename'] = args.package with open('mach_build_properties.json', 'w') as outfile: json.dump(json_data, outfile, indent=4) diff --git a/build/moz-automation.mk b/build/moz-automation.mk index 0c37c67bb3a..7a8e037bc4b 100644 --- a/build/moz-automation.mk +++ b/build/moz-automation.mk @@ -99,7 +99,7 @@ automation/l10n-check: automation/pretty-l10n-check automation/update-packaging: automation/pretty-update-packaging automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS)) - $(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES)) + $(PYTHON) $(topsrcdir)/build/gen_mach_buildprops.py --complete-mar-file $(DIST)/$(COMPLETE_MAR) $(addprefix --partial-mar-file ,$(wildcard $(DIST)/$(PARTIAL_MAR))) --upload-output $(AUTOMATION_UPLOAD_OUTPUT) --upload-files $(abspath $(UPLOAD_FILES)) --package $(PACKAGE) # We need the log from make upload to grep it for urls in order to set # properties.