5 from collections
import OrderedDict
8 current_path
= os
.path
.dirname(os
.path
.realpath(__file__
))
10 # name, (url, recursive clone, develop)
12 ("migen", ("http://github.com/m-labs/", True, True)),
13 ("litex", ("http://github.com/enjoy-digital/", True, True)),
14 ("liteeth", ("http://github.com/enjoy-digital/", False, True)),
15 ("liteusb", ("http://github.com/enjoy-digital/", False, True)),
16 ("litedram", ("http://github.com/enjoy-digital/", False, True)),
17 ("litepcie", ("http://github.com/enjoy-digital/", False, True)),
18 ("litesdcard", ("http://github.com/enjoy-digital/", False, True)),
19 ("liteiclink", ("http://github.com/enjoy-digital/", False, True)),
20 ("litevideo", ("http://github.com/enjoy-digital/", False, True)),
21 ("litescope", ("http://github.com/enjoy-digital/", False, True)),
23 repos
= OrderedDict(repos
)
26 print("Available commands:")
32 if "init" in sys
.argv
[1:]:
33 for name
in repos
.keys():
34 url
, need_recursive
, need_develop
= repos
[name
]
35 # clone repo (recursive if needed)
36 print("[cloning " + name
+ "]...")
38 opts
= "--recursive" if need_recursive
else ""
39 os
.system("git clone " + full_url
+ " " + opts
)
41 if "install" in sys
.argv
[1:]:
42 for name
in repos
.keys():
43 url
, need_recursive
, need_develop
= repos
[name
]
45 print("[installing " + name
+ "]...")
47 os
.chdir(os
.path
.join(current_path
, name
))
48 os
.system("python3 setup.py develop")
50 if "update" in sys
.argv
[1:]:
51 for name
in repos
.keys():
53 print("[updating " + name
+ "]...")
54 os
.chdir(os
.path
.join(current_path
, name
))