mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 531275 - add the platform parameter to generate l10n nightly snippets r=coop,nthomas
This commit is contained in:
parent
cf16ec110c
commit
d821ead051
@ -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
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user