7 from textwrap import dedent
12 # Packages whose libraries aren't in the submodule root
14 'libraries/containers/': 'libraries/containers/containers/'
18 print(dedent(s), file=sys.stderr)
24 def check_boot_packages():
25 # Check that we have all boot packages.
26 for l in open('packages', 'r'):
30 parts = [part for part in l.split(' ') if part]
32 die("Error: Bad line in packages file: " + l)
37 # If tag is not "-" then it is an optional repository, so its
38 # absence isn't an error.
40 # We would like to just check for a .git directory here,
41 # but in an lndir tree we avoid making .git directories,
42 # so it doesn't exist. We therefore require that every repo
43 # has a LICENSE file instead.
44 license_path = os.path.join(EXCEPTIONS.get(dir_+'/', dir_), 'LICENSE')
45 if not os.path.isfile(license_path):
47 Error: %s doesn't exist
48 Maybe you haven't run 'git submodule update --init'?
52 # Run autoreconf on everything that needs it.
55 # Get the normalized ACLOCAL_PATH for Windows
56 # This is necessary since on Windows this will be a Windows
57 # path, which autoreconf doesn't know doesn't know how to handle.
58 ac_local = os.getenv('ACLOCAL_PATH', '')
59 ac_local_arg = re.sub(r';', r':', ac_local)
60 ac_local_arg = re.sub(r'\\', r'/', ac_local_arg)
61 ac_local_arg = re.sub(r'(\w):/', r'/\1/', ac_local_arg)
62 reconf_cmd = 'ACLOCAL_PATH=%s autoreconf' % ac_local_arg
64 reconf_cmd = 'autoreconf'
66 for dir_ in ['.', 'rts'] + glob.glob('libraries/*/'):
67 if os.path.isfile(os.path.join(dir_, 'configure.ac')):
68 print("Booting %s" % dir_)
69 processes[dir_] = subprocess.Popen(['sh', '-c', reconf_cmd], cwd=dir_)
71 # Wait for all child processes to finish.
73 for k,v in processes.items():
76 print_err('autoreconf in %s failed with exit code %d' % (k, code))