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_args() assert args.package fuchsia_out_dir = os.path.expanduser(args.fuchsia_out_dir) repo = amber_repo.ExternalAmberRepo( os.path.join(fuchsia_out_dir, 'amber-files')) print('Installing packages and symbols in Amber repo %s...' % repo.GetPath()) for package in args.package: repo.PublishPackage(package) InstallSymbols(os.path.join(os.path.dirname(package), 'ids.txt'), os.path.join(fuchsia_out_dir, '.build-id')) print('Installation success.') return 0
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', nargs='+', help='Path to a Fuchsia build output directory. ' 'If more than one outdir is supplied, the last one ' 'in the sequence will be used.') args = parser.parse_args() assert args.package if not args.fuchsia_out_dir or len(args.fuchsia_out_dir) == 0: sys.stderr.write('No Fuchsia build output directory was specified.\n' + 'To resolve this, Use the commandline argument ' + '--fuchsia-out-dir\nor set the GN arg ' + '"default_fuchsia_build_dir_for_installation".\n') return 1 fuchsia_out_dir = os.path.expanduser(args.fuchsia_out_dir.pop()) repo = amber_repo.ExternalAmberRepo( os.path.join(fuchsia_out_dir, 'amber-files')) print('Installing packages and symbols in Amber repo %s...' % repo.GetPath()) for package in args.package: repo.PublishPackage(package) InstallSymbols(os.path.join(os.path.dirname(package), 'ids.txt'), os.path.join(fuchsia_out_dir, '.build-id')) print('Installation success.') return 0
def _GetAmberRepo(self): if self._fuchsia_out_dir: # Deploy to an already-booted device running a local Fuchsia build. return amber_repo.ExternalAmberRepo( os.path.join(self._fuchsia_out_dir, 'amber-files')) else: # Pave a Zedbootable device. return amber_repo.ManagedAmberRepo(self)
def GetAmberRepo(self): if not self._amber_repo: if self._fuchsia_out_dir: # Deploy to an already-booted device running a local Fuchsia build. self._amber_repo = amber_repo.ExternalAmberRepo( os.path.join(self._fuchsia_out_dir, 'amber-files')) else: # Create an ephemeral Amber repo, then start both "pm serve" as well as # the bootserver. self._amber_repo = amber_repo.ManagedAmberRepo(self) return self._amber_repo