CI: Support not having "pmbootstrap" in $PATH (MR 3977)
Not everyone's setup includes "pmbootstrap" as a command in $PATH. Currently, in such setups, $ pmbootstrap ci kconfig (and potentially other testcases) in the pmaports repository do not work as they expect the "pmbootstrap" command to exist. Resolve this by checking whether PMBOOTSTRAP_CMD is set and use that as command for invoking pmbootstrap. If it isn't set (because you're using an old pmbootstrap version or invoking a script directly for some reason), fall back to the old behaviour as to not break compatibility. Depends on pmbootstrap patch that sets PMBOOTSTRAP_CMD to argv[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/39995
This commit is contained in:
parent
9b4b663a38
commit
239aa4da8f
1 changed files with 4 additions and 2 deletions
|
@ -15,8 +15,10 @@ def path_pmbootstrap():
|
|||
code from there.
|
||||
returns: pmbootstrap installation folder
|
||||
"""
|
||||
# Find 'pmbootstrap' executable
|
||||
bin = shutil.which("pmbootstrap")
|
||||
# This variable is set by pmbootstrap 1.52 and later
|
||||
# If it's undefined, try to find 'pmbootstrap' in path
|
||||
bin = os.environ.get("PMBOOTSTRAP_CMD") or shutil.which("pmbootstrap")
|
||||
|
||||
if not bin:
|
||||
print("ERROR: 'pmbootstrap' not found in $PATH")
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in a new issue