7""" Generate a Fuchsia repo capable of serving Fuchsia archives over the
19 parser = argparse.ArgumentParser()
21 parser.add_argument(
'--pm-bin', dest=
'pm_bin', action=
'store', required=
True)
22 parser.add_argument(
'--repo-dir', dest=
'repo_dir', action=
'store', required=
True)
23 parser.add_argument(
'--archive', dest=
'archives', action=
'append', required=
True)
25 args = parser.parse_args()
27 assert os.path.exists(args.pm_bin)
29 if not os.path.exists(args.repo_dir):
30 pm_newrepo_command = [args.pm_bin,
'newrepo',
'-repo', args.repo_dir]
31 subprocess.check_call(pm_newrepo_command)
33 pm_publish_command = [
42 for archive
in args.archives:
43 pm_publish_command.append(
'-f')
44 pm_publish_command.append(archive)
46 subprocess.check_call(pm_publish_command)
51if __name__ ==
'__main__':