def main(): parser = argparse.ArgumentParser() parser.add_argument('--package', action='append', required=True, help='Paths to packages to install.') parser.add_argument('--fuchsia-out-dir', required=True, help='Path to a Fuchsia build output directory. ' 'Setting the GN arg ' '"default_fuchsia_build_dir_for_installation" ' 'will cause it to be passed here.') args, _ = parser.parse_known_args() assert args.package fuchsia_out_dir = os.path.expanduser(args.fuchsia_out_dir) repo = pkg_repo.ExternalPkgRepo( os.path.join(fuchsia_out_dir, 'amber-files'), os.path.join(fuchsia_out_dir, '.build-id')) print('Installing packages and symbols in package repo %s...' % repo.GetPath()) for package in args.package: repo.PublishPackage(package) print('Installation success.') return 0
def GetPkgRepo(self): if not self._pkg_repo: if self._fuchsia_out_dir: # Deploy to an already-booted device running a local Fuchsia build. self._pkg_repo = pkg_repo.ExternalPkgRepo( os.path.join(self._fuchsia_out_dir, 'amber-files')) else: # Create an ephemeral package repository, then start both "pm serve" as # well as the bootserver. self._pkg_repo = pkg_repo.ManagedPkgRepo(self) return self._pkg_repo