| Index: native_client_sdk/src/build_tools/update_nacl_manifest.py
|
| diff --git a/native_client_sdk/src/build_tools/update_nacl_manifest.py b/native_client_sdk/src/build_tools/update_nacl_manifest.py
|
| index e48777665d081c542f193059afb47d16a5f19fb5..ef542d4fa0ab3a630d0206b0bf250351f39ff191 100755
|
| --- a/native_client_sdk/src/build_tools/update_nacl_manifest.py
|
| +++ b/native_client_sdk/src/build_tools/update_nacl_manifest.py
|
| @@ -39,6 +39,7 @@ GS_SDK_MANIFEST_LOG = GS_BUCKET_PATH + MANIFEST_BASENAME + '.log'
|
| GS_MANIFEST_BACKUP_DIR = GS_BUCKET_PATH + 'manifest_backups/'
|
|
|
| CANARY_BUNDLE_NAME = 'pepper_canary'
|
| +BIONIC_CANARY_BUNDLE_NAME = 'bionic_canary'
|
| CANARY = 'canary'
|
| NACLPORTS_ARCHIVE_NAME = 'naclports.tar.bz2'
|
|
|
| @@ -85,6 +86,11 @@ def GetPlatformArchiveName(platform):
|
| return 'naclsdk_%s.tar.bz2' % platform
|
|
|
|
|
| +def GetBionicArchiveName():
|
| + """Get the basename of an archive. Currently this is linux-only"""
|
| + return 'naclsdk_bionic.tar.bz2'
|
| +
|
| +
|
| def GetCanonicalArchiveName(url):
|
| """Get the canonical name of an archive given its URL.
|
|
|
| @@ -331,12 +337,14 @@ class VersionFinder(object):
|
| e.g. [('foo.tar.bz2', '18.0.1000.0'), ('bar.tar.bz2', '19.0.1100.20')]
|
| These archives must exist to consider a version for inclusion, as
|
| long as that version is greater than the archive's minimum version.
|
| + is_bionic: True if we are searching for bionic archives.
|
| """
|
| - def __init__(self, delegate, platforms, extra_archives=None):
|
| + def __init__(self, delegate, platforms, extra_archives=None, is_bionic=False):
|
| self.delegate = delegate
|
| self.history = delegate.GetHistory()
|
| self.platforms = platforms
|
| self.extra_archives = extra_archives
|
| + self.is_bionic = is_bionic
|
|
|
| def GetMostRecentSharedVersion(self, major_version):
|
| """Returns the most recent version of a pepper bundle that exists on all
|
| @@ -402,14 +410,20 @@ class VersionFinder(object):
|
| URLs, |missing_archives| is a list of archive names.
|
| """
|
| archive_urls = self._GetAvailableArchivesFor(version)
|
| - platform_archives = set(GetPlatformArchiveName(p) for p in self.platforms)
|
| - expected_archives = platform_archives
|
| +
|
| + if self.is_bionic:
|
| + # Bionic currently is Linux-only.
|
| + expected_archives = set([GetBionicArchiveName()])
|
| + else:
|
| + expected_archives = set(GetPlatformArchiveName(p) for p in self.platforms)
|
| +
|
| if self.extra_archives:
|
| for extra_archive, extra_archive_min_version in self.extra_archives:
|
| if SplitVersion(version) >= SplitVersion(extra_archive_min_version):
|
| expected_archives.add(extra_archive)
|
| found_archives = set(GetCanonicalArchiveName(a) for a in archive_urls)
|
| missing_archives = expected_archives - found_archives
|
| +
|
| if allow_trunk_revisions and missing_archives:
|
| # Try to find trunk versions of any missing archives.
|
| trunk_version = self.delegate.GetTrunkRevision(version)
|
| @@ -802,7 +816,7 @@ def Run(delegate, platforms, extra_archives, fixed_bundle_versions=None):
|
| manifest = delegate.GetRepoManifest()
|
| auto_update_bundles = []
|
| for bundle in manifest.GetBundles():
|
| - if not bundle.name.startswith('pepper_'):
|
| + if not bundle.name.startswith(('pepper_', 'bionic_')):
|
| continue
|
| archives = bundle.GetArchives()
|
| if not archives:
|
| @@ -812,17 +826,23 @@ def Run(delegate, platforms, extra_archives, fixed_bundle_versions=None):
|
| logger.info('No versions need auto-updating.')
|
| return
|
|
|
| - version_finder = VersionFinder(delegate, platforms, extra_archives)
|
| updater = Updater(delegate)
|
|
|
| for bundle in auto_update_bundles:
|
| try:
|
| - if bundle.name == CANARY_BUNDLE_NAME:
|
| + if bundle.name == BIONIC_CANARY_BUNDLE_NAME:
|
| + logger.info('>>> Looking for most recent bionic_canary...')
|
| + version_finder = VersionFinder(delegate, platforms, extra_archives,
|
| + is_bionic=True)
|
| + version, channel, archives = version_finder.GetMostRecentSharedCanary()
|
| + elif bundle.name == CANARY_BUNDLE_NAME:
|
| logger.info('>>> Looking for most recent pepper_canary...')
|
| + version_finder = VersionFinder(delegate, platforms, extra_archives)
|
| version, channel, archives = version_finder.GetMostRecentSharedCanary()
|
| else:
|
| logger.info('>>> Looking for most recent pepper_%s...' %
|
| bundle.version)
|
| + version_finder = VersionFinder(delegate, platforms, extra_archives)
|
| version, channel, archives = version_finder.GetMostRecentSharedVersion(
|
| bundle.version)
|
| except NoSharedVersionException:
|
|
|