Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
gen_repo Namespace Reference

Functions

 main ()
 

Detailed Description

 Generate a Fuchsia repo capable of serving Fuchsia archives over the
network.

Function Documentation

◆ main()

gen_repo.main ( )

Definition at line 18 of file gen_repo.py.

18def main():
19 parser = argparse.ArgumentParser()
20
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)
24
25 args = parser.parse_args()
26
27 assert os.path.exists(args.pm_bin)
28
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)
32
33 pm_publish_command = [
34 args.pm_bin,
35 'publish',
36 '-C', # Remove all previous registrations.
37 '-a', # Publish archives from an archive (mode).
38 '-repo',
39 args.repo_dir
40 ]
41
42 for archive in args.archives:
43 pm_publish_command.append('-f')
44 pm_publish_command.append(archive)
45
46 subprocess.check_call(pm_publish_command)
47
48 return 0
49
50
Definition main.py:1