forked from Mirror/pmbootstrap
config: find required programs every time pmbootstrap is run (MR 2475)
On debian systems in particular special handling is needed for /usr/sbin. Let's do this once and then provide the host deps we use in a nice accessible dictionary. Signed-off-by: Caleb Connolly <caleb@postmarketos.org> Tweaked-by: Oliver Smith <ollieparanoid@postmarketos.org>
This commit is contained in:
parent
c4194759f5
commit
585c477239
3 changed files with 20 additions and 13 deletions
|
@ -36,11 +36,14 @@ import pmb.parse._apkbuild
|
|||
|
||||
def require_programs() -> None:
|
||||
missing = []
|
||||
for program in pmb.config.required_programs:
|
||||
for program in pmb.config.required_programs.keys():
|
||||
# Debian: some programs are in /usr/sbin, which is not in PATH
|
||||
# unless using sudo
|
||||
if not shutil.which(program) and not os.path.exists(os.path.join("/usr/sbin", program)):
|
||||
prog = shutil.which(program, path=pmb.config.host_path)
|
||||
if not prog:
|
||||
missing.append(program)
|
||||
else:
|
||||
pmb.config.required_programs[program] = prog
|
||||
|
||||
losetup_missing_json = False
|
||||
|
||||
|
@ -694,8 +697,6 @@ def ask_for_locale(current_locale: str) -> str:
|
|||
|
||||
|
||||
def frontend(args: PmbArgs) -> None:
|
||||
require_programs()
|
||||
|
||||
# Work folder (needs to be first, so we can create chroots early)
|
||||
config = get_context().config
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue