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 ("litesata", ("http://github.com/enjoy-digital/", False, True)),
19 ("litesdcard", ("http://github.com/enjoy-digital/", False, True)),
20 ("liteiclink", ("http://github.com/enjoy-digital/", False, True)),
21 ("litevideo", ("http://github.com/enjoy-digital/", False, True)),
22 ("litescope", ("http://github.com/enjoy-digital/", False, True)),
24 repos
= OrderedDict(repos
)
27 print("Available commands:")
33 if "init" in sys
.argv
[1:]:
34 for name
in repos
.keys():
35 url
, need_recursive
, need_develop
= repos
[name
]
36 # clone repo (recursive if needed)
37 print("[cloning " + name
+ "]...")
39 opts
= "--recursive" if need_recursive
else ""
40 os
.system("git clone " + full_url
+ " " + opts
)
42 if "install" in sys
.argv
[1:]:
43 for name
in repos
.keys():
44 url
, need_recursive
, need_develop
= repos
[name
]
46 print("[installing " + name
+ "]...")
48 os
.chdir(os
.path
.join(current_path
, name
))
49 os
.system("python3 setup.py develop")
51 if "update" in sys
.argv
[1:]:
52 for name
in repos
.keys():
54 print("[updating " + name
+ "]...")
55 os
.chdir(os
.path
.join(current_path
, name
))