diff --git a/toolkit/locales/l10n.mk b/toolkit/locales/l10n.mk index 2cc28f858a4d..89f86a3fb65d 100644 --- a/toolkit/locales/l10n.mk +++ b/toolkit/locales/l10n.mk @@ -211,5 +211,6 @@ generate-snippet-%: --application-ini-file=$(STAGEDIST)/application.ini \ --locale=$* \ --product=$(MOZ_PKG_APPNAME) \ + --platform=$(MOZ_PKG_PLATFORM) \ --download-base-URL=$(DOWNLOAD_BASE_URL) \ --verbose diff --git a/tools/update-packaging/generatesnippet.py b/tools/update-packaging/generatesnippet.py index 6c49d31e733b..93475ff6af7e 100644 --- a/tools/update-packaging/generatesnippet.py +++ b/tools/update-packaging/generatesnippet.py @@ -66,6 +66,10 @@ def main(): action="store", dest="product", help="[Required] This option is used to generate the URL to download the MAR file.") + parser.add_option("--platform", + action="store", + dest="platform", + help="[Required] This option is used to indicate which target platform.") parser.add_option("--download-base-URL", action="store", dest="downloadBaseURL", @@ -80,7 +84,8 @@ def main(): for req, msg in (('marPath', "the absolute path to the where the MAR file is"), ('applicationIniFile', "the absolute path to the application.ini file."), ('locale', "a locale."), - ('product', "specify a product.")): + ('product', "specify a product."), + ('platform', "specify the platform.")): if not hasattr(options, req): parser.error('You must specify %s' % msg) @@ -91,7 +96,8 @@ def main(): options.applicationIniFile, options.locale, options.downloadBaseURL, - options.product) + options.product, + options.platform) f = open(os.path.join(options.marPath, 'complete.update.snippet'), 'wb') f.write(snippet) f.close() @@ -101,7 +107,7 @@ def main(): print snippet def generateSnippet(abstDistDir, applicationIniFile, locale, - downloadBaseURL, product): + downloadBaseURL, product, platform): # Let's extract information from application.ini c = ConfigParser() try: @@ -116,7 +122,7 @@ def generateSnippet(abstDistDir, applicationIniFile, locale, product, appVersion, locale, - getPlatform()) + platform) # Let's determine the hash and the size of the MAR file # This function exits the script if the file does not exist (completeMarHash, completeMarSize) = getFileHashAndSize( @@ -148,14 +154,6 @@ sha1 return snippet -def getPlatform(): - if platform.system() == "Linux": - return "linux-i686" - elif platform.system() in ("Windows", "Microsoft"): - return "win32" - elif platform.system() == "Darwin": - return "mac" - def getFileHashAndSize(filepath): sha1Hash = 'UNKNOWN' size = 'UNKNOWN'