bug 539938 - Make L10n nightly updates work (for SeaMonkey), make generatesnippet.py accept a branch argument, r=armenzg

This commit is contained in:
Robert Kaiser 2010-01-19 18:49:07 +01:00
parent b6911710c1
commit 2eb375a7bc

View File

@ -70,6 +70,10 @@ def main():
action="store",
dest="platform",
help="[Required] This option is used to indicate which target platform.")
parser.add_option("--branch",
action="store",
dest="branch",
help="This option is used to indicate which branch name to use for FTP file names.")
parser.add_option("--download-base-URL",
action="store",
dest="downloadBaseURL",
@ -92,12 +96,16 @@ def main():
if not options.downloadBaseURL or options.downloadBaseURL == '':
options.downloadBaseURL = 'http://ftp.mozilla.org/pub/mozilla.org/%s/nightly' % options.product
if not options.branch or options.branch == '':
options.branch = None
snippet = generateSnippet(options.marPath,
options.applicationIniFile,
options.locale,
options.downloadBaseURL,
options.product,
options.platform)
options.platform,
options.branch)
f = open(os.path.join(options.marPath, 'complete.update.snippet'), 'wb')
f.write(snippet)
f.close()
@ -107,7 +115,7 @@ def main():
print snippet
def generateSnippet(abstDistDir, applicationIniFile, locale,
downloadBaseURL, product, platform):
downloadBaseURL, product, platform, branch):
# Let's extract information from application.ini
c = ConfigParser()
try:
@ -116,7 +124,7 @@ def generateSnippet(abstDistDir, applicationIniFile, locale,
sys.exit(stderror)
buildid = c.get("App", "BuildID")
appVersion = c.get("App", "Version")
branchName = c.get("App", "SourceRepository").split('/')[-1]
branchName = branch or c.get("App", "SourceRepository").split('/')[-1]
marFileName = '%s-%s.%s.%s.complete.mar' % (
product,