def main(argv): opts = _ParseArguments(argv) args = (constants.BOTH_OVERLAYS, opts.board) # Verify that a primary overlay exists. try: primary_overlay = portage_util.FindPrimaryOverlay(*args) except portage_util.MissingOverlayException as ex: cros_build_lib.Die(str(ex)) # Get the overlays to print. if opts.primary_only: overlays = [primary_overlay] else: overlays = portage_util.FindOverlays(*args) # Exclude any overlays in src/third_party, for backwards compatibility with # scripts that expected these to not be listed. if not opts.all: ignore_prefix = os.path.join(constants.SOURCE_ROOT, 'src', 'third_party') overlays = [o for o in overlays if not o.startswith(ignore_prefix)] if opts.board_overlay and os.path.isdir(opts.board_overlay): overlays.append(os.path.abspath(opts.board_overlay)) print('\n'.join(overlays))
def testBrickPrimaryOverlay(self): """Verify that a brick's stacking correctly picks up its primary overlay.""" primary = portage_util.FindPrimaryOverlay(self.BOTH, self.BRICK, self.tempdir) self.assertIn(primary, self.overlays[self.PUB_ONLY][self.BOTH]) self.assertEqual(primary, self.overlays[self.PUB_ONLY][self.PUBLIC][-1])
def RunAllConfigs(self, task, skip_missing=False, site_config=None): """Run |task| against all major configurations""" if site_config is None: site_config = chromeos_config.GetConfig() with parallel.BackgroundTaskRunner(task) as queue: # Loop through all major configuration types and pick one from each. for bot_type in config_lib.CONFIG_TYPE_DUMP_ORDER: for bot_id in site_config: if bot_id.endswith(bot_type): # Skip any config without a board, since those configs do not # build packages. cfg = site_config[bot_id] if cfg.boards: # Skip boards w/out a local overlay. Like when running a # public manifest and testing private-only boards. if skip_missing: try: for b in cfg.boards: portage_util.FindPrimaryOverlay(constants.BOTH_OVERLAYS, b) except portage_util.MissingOverlayException: continue queue.put([bot_id]) break
def testPrimaryOverlays(self): """Verify that boards have a primary overlay. Further, the only difference between public boards are the primary overlay which should be listed last. """ primary = portage_util.FindPrimaryOverlay( self.BOTH, self.PUB_ONLY, self.tempdir) self.assertIn(primary, self.overlays[self.PUB_ONLY][self.BOTH]) self.assertNotIn(primary, self.overlays[self.PUB2_ONLY][self.BOTH]) self.assertEqual(primary, self.overlays[self.PUB_ONLY][self.PUBLIC][-1]) self.assertEqual(self.overlays[self.PUB_ONLY][self.PUBLIC][:-1], self.overlays[self.PUB2_ONLY][self.PUBLIC][:-1]) self.assertNotEqual(self.overlays[self.PUB_ONLY][self.PUBLIC][-1], self.overlays[self.PUB2_ONLY][self.PUBLIC][-1])
def RunAllConfigs(self, task, skip_missing=False, site_config=None): """Run |task| against all major configurations""" if site_config is None: site_config = chromeos_config.GetConfig() boards = ('samus', 'arm-generic') with parallel.BackgroundTaskRunner(task) as queue: # Test every build config on an waterfall, that builds something. for bot_id, cfg in site_config.iteritems(): if not cfg.boards or cfg.boards[0] not in boards: continue if skip_missing: try: for b in cfg.boards: portage_util.FindPrimaryOverlay( constants.BOTH_OVERLAYS, b) except portage_util.MissingOverlayException: continue queue.put([bot_id])