Skip to content
Browse files

bug 784685: don't depend on oldVersion in mobile release repacks. r=a…

…ki/rail
  • Loading branch information...
1 parent b126593 commit 5c94ec0ab4397cdb299c4d461c174198746ebee2 @bhearsum bhearsum committed Aug 24, 2012
View
1 configs/signing/android_mozilla-beta.py
@@ -95,7 +95,6 @@
"download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
"download_signed_base_subdir": "%(platform)s/%(locale)s",
"buildid_base_url": BUILDID_BASE_URL,
- "old_buildid_base_url": BUILDID_BASE_URL,
"actions": [
"passphrase",
"clobber",
View
1 configs/signing/android_mozilla-esr10.py
@@ -95,7 +95,6 @@
"download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
"download_signed_base_subdir": "%(platform)s/%(locale)s",
"buildid_base_url": BUILDID_BASE_URL,
- "old_buildid_base_url": BUILDID_BASE_URL,
"actions": [
"passphrase",
"clobber",
View
1 configs/signing/android_mozilla-release.py
@@ -98,7 +98,6 @@
"download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
"download_signed_base_subdir": "%(platform)s/%(locale)s",
"buildid_base_url": BUILDID_BASE_URL,
- "old_buildid_base_url": BUILDID_BASE_URL,
"actions": [
"passphrase",
"clobber",
View
1 configs/signing/staging_android_mozilla-beta.py
@@ -95,7 +95,6 @@
"download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
"download_signed_base_subdir": "%(platform)s/%(locale)s",
"buildid_base_url": BUILDID_BASE_URL,
- "old_buildid_base_url": BUILDID_BASE_URL,
"keystore": KEYSTORE,
"key_alias": KEY_ALIAS,
View
1 configs/signing/staging_android_mozilla-esr10.py
@@ -80,7 +80,6 @@
"download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
"download_signed_base_subdir": "%(platform)s/%(locale)s",
"buildid_base_url": BUILDID_BASE_URL,
- "old_buildid_base_url": BUILDID_BASE_URL,
"keystore": KEYSTORE,
"key_alias": KEY_ALIAS,
View
4 mozharness/mozilla/release.py
@@ -38,8 +38,6 @@ def query_release_config(self):
self.fatal("Invalid release config file %s!" % c["release_config_file"])
self.release_config['version'] = rc['version']
self.release_config['buildnum'] = rc['buildNumber']
- self.release_config['old_version'] = rc['oldVersion']
- self.release_config['old_buildnum'] = rc['oldBuildNumber']
self.release_config['ftp_server'] = rc['stagingServer']
self.release_config['ftp_user'] = c.get('ftp_user', rc['hgUsername'])
self.release_config['ftp_ssh_key'] = c.get('ftp_ssh_key', rc['hgSshKey'])
@@ -48,7 +46,7 @@ def query_release_config(self):
self.release_config['aus_ssh_key'] = c.get('aus_ssh_key', '~/.ssh/%s' % rc['ausSshKey'])
else:
self.info("No release config file; using default config.")
- for key in ('version', 'buildnum', 'old_version', 'old_buildnum',
+ for key in ('version', 'buildnum',
'ftp_server', 'ftp_user', 'ftp_ssh_key',
'aus_server', 'aus_user', 'aus_ssh_key',):
self.release_config[key] = c[key]
View
7 scripts/mobile_partner_repack.py
@@ -88,13 +88,6 @@ class MobilePartnerRepack(LocalesMixin, ReleaseMixin, MobileSigningMixin,
"help": "Specify the current version"
}
],[
- ['--old-version',],
- {"action": "store",
- "dest": "old_version",
- "type": "string",
- "help": "Specify the version to update from"
- }
- ],[
['--buildnum',],
{"action": "store",
"dest": "buildnum",
View
146 scripts/sign_android.py
@@ -18,7 +18,6 @@
# load modules from parent dir
sys.path.insert(1, os.path.dirname(sys.path[0]))
-from mozharness.base.errors import BaseErrorList
from mozharness.base.log import ERROR, FATAL
from mozharness.base.transfer import TransferMixin
from mozharness.mozilla.release import ReleaseMixin
@@ -79,14 +78,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
"help": "Specify the key alias"
}
],[
- ['--update-platform',],
- {"action": "extend",
- "dest": "update_platforms",
- "type": "choice",
- "choices": SUPPORTED_PLATFORMS,
- "help": "Specify the platform(s) to create update snippets for"
- }
- ],[
['--release-config-file',],
{"action": "store",
"dest": "release_config_file",
@@ -101,13 +92,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
"help": "Specify the current version"
}
],[
- ['--old-version',],
- {"action": "store",
- "dest": "old_version",
- "type": "string",
- "help": "Specify the version to update from"
- }
- ],[
['--buildnum',],
{"action": "store",
"dest": "buildnum",
@@ -117,15 +101,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
"help": "Specify the current release build num (e.g. build1, build2)"
}
],[
- ['--old-buildnum',],
- {"action": "store",
- "dest": "old_buildnum",
- "type": "int",
- "default": 1,
- "metavar": "INT",
- "help": "Specify the release build num to update from (e.g. build1, build2)"
- }
- ],[
['--keystore',],
{"action": "store",
"dest": "keystore",
@@ -161,37 +136,11 @@ def __init__(self, require_config_file=True):
"sign",
"verify-signatures",
"upload-signed-bits",
- "create-snippets",
- "upload-snippets",
],
require_config_file=require_config_file
)
# Helper methods {{{2
- def query_buildid(self, platform, base_url, buildnum=None, version=None):
- rc = self.query_release_config()
- replace_dict = {
- 'buildnum': rc['buildnum'],
- 'version': rc['version'],
- 'platform': platform,
- }
- if buildnum:
- replace_dict['buildnum'] = buildnum
- if version:
- replace_dict['version'] = version
- url = base_url % replace_dict
- # ghetto retry.
- for count in range (1, 11):
- # TODO stop using curl
- output = self.get_output_from_command(["curl", "--silent", url])
- if output.startswith("buildID="):
- return output.replace("buildID=", "")
- else:
- self.warning("Can't get buildID from %s (try %d)" % (url, count))
- # This will break create-snippets if it isn't set.
- # Might as well fatal().
- self.fatal("Can't get buildID from %s!" % url)
-
def add_failure(self, platform, locale, **kwargs):
s = "%s:%s" % (platform, locale)
if 'message' in kwargs:
@@ -393,101 +342,6 @@ def upload_signed_bits(self):
ftp_upload_dir,):
self.return_code += 1
- def create_snippets(self):
- c = self.config
- rc = self.query_release_config()
- dirs = self.query_abs_dirs()
- replace_dict = {
- 'version': rc['version'],
- 'buildnum': rc['buildnum'],
- }
- total_count = {'snippets': 0, 'links': 0}
- success_count = {'snippets': 0, 'links': 0}
- for platform in c['update_platforms']:
- buildid = self.query_buildid(platform, c['buildid_base_url'])
- old_buildid = self.query_buildid(platform, c['old_buildid_base_url'],
- buildnum=rc['old_buildnum'],
- version=rc['old_version'])
- if not buildid:
- self.add_summary("Can't get buildid for %s! Skipping..." % platform, level=ERROR)
- continue
- replace_dict['platform'] = platform
- replace_dict['buildid'] = buildid
- locales = self.query_platform_locales(platform)
- for locale in locales:
- if self.query_failure(platform, locale):
- self.warning("%s:%s had previous issues; skipping!" % (platform, locale))
- continue
- replace_dict['locale'] = locale
- parent_dir = '%s/%s/%s' % (dirs['abs_work_dir'],
- platform, locale)
- replace_dict['apk_name'] = self.query_platform_apk_base_name(platform) % replace_dict
- signed_path = '%s/%s' % (parent_dir, replace_dict['apk_name'])
- if not os.path.exists(signed_path):
- self.add_summary("Unable to create snippet for %s:%s: apk doesn't exist!" % (platform, locale), level=ERROR)
- continue
- size = self.query_filesize(signed_path)
- sha512_hash = self.query_sha512sum(signed_path)
- for channel, channel_dict in c['update_channels'].items():
- total_count['snippets'] += 1
- total_count['links'] += 1
- url = channel_dict['url'] % replace_dict
- # Create complete snippet
- self.info("Creating snippet for %s %s %s" % (platform, locale, channel))
- snippet_dir = "%s/update/%s/Fennec/snippets/%s/%s" % (
- dirs['abs_work_dir'],
- channel_dict['dir_base_name'] % (replace_dict),
- platform, locale)
- snippet_file = "latest-%s" % channel
- if self.create_complete_snippet(
- signed_path, rc['version'], buildid,
- url, snippet_dir, snippet_file,
- size, sha512_hash
- ):
- success_count['snippets'] += 1
- else:
- self.add_failure(platform, locale,
- message="Errors creating snippet for %(platform)s:%(locale)s!")
- continue
- # Create previous link
- previous_dir = os.path.join(dirs['abs_work_dir'], 'update',
- channel_dict['dir_base_name'] % (replace_dict),
- 'Fennec', rc['old_version'],
- c['update_platform_map'][platform],
- old_buildid, locale, channel)
- self.mkdir_p(previous_dir)
- self.run_command(["touch", "partial.txt"],
- cwd=previous_dir, error_list=BaseErrorList)
- status = self.run_command(
- ['ln', '-s',
- '../../../../../snippets/%s/%s/latest-%s' % (platform, locale, channel),
- 'complete.txt'],
- cwd=previous_dir, error_list=BaseErrorList
- )
- if not status:
- success_count['links'] += 1
- for k in success_count.keys():
- self.summarize_success_count(success_count[k], total_count[k],
- "Created %d of %d " + k + " successfully.")
-
- def upload_snippets(self):
- c = self.config
- rc = self.query_release_config()
- dirs = self.query_abs_dirs()
- update_dir = os.path.join(dirs['abs_work_dir'], 'update')
- if not os.path.exists(update_dir):
- self.error("No such directory %s! Skipping..." % update_dir)
- return
- aus_upload_dir = c['aus_upload_base_dir'] % {
- 'version': rc['version'],
- 'buildnum': rc['buildnum'],
- }
- if self.rsync_upload_directory(update_dir, rc['aus_ssh_key'],
- rc['aus_user'], rc['aus_server'],
- aus_upload_dir):
- self.return_code += 1
-
-
# main {{{1
if __name__ == '__main__':

0 comments on commit 5c94ec0

Please sign in to comment.
Something went wrong with that request. Please try again.