diff options
author | Leah Rowe <leah@libreboot.org> | 2025-05-18 11:40:28 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-05-18 11:40:58 +0100 |
commit | 484afcb91969b9325c448a6a77ad97a4813f7bfb (patch) | |
tree | c9fa368c72c20a16b2c9ee7d34b62f9daac7230c | |
parent | d0bee6b4ebba914b0ac2f16689bc23c5f6cbf866 (diff) |
init.sh: merge create_pathdirs with set_pyver
all this function does now is create the python symlink,
based on work that was already performed in set_pyver
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | include/init.sh | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/include/init.sh b/include/init.sh index 6c45b44d..13592d83 100644 --- a/include/init.sh +++ b/include/init.sh @@ -31,7 +31,7 @@ xbmk_init() [ "$(id -u)" != "0" ] || err "this command as root is not permitted" for init_cmd in set_version set_env lock git_init \ - mkdirs set_pyver create_pathdirs child_exec; do + mkdirs set_pyver child_exec; do xbmk_$init_cmd "$@" || break done } @@ -159,7 +159,14 @@ xbmk_set_pyver() [ -n "$pyver" ] && \ pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" && \ pyver="${pyver#(}" && pyver="${pyver%,}" - [ "${pyver%%.*}" = "3" ] || err "Bad python version (must by 3.x)"; : + [ "${pyver%%.*}" = "3" ] || err "Bad python version (must by 3.x)" + + ( + # set up python v3.x in PATH, in case it's not set up correctly. + # see code above that detected the correct python3 command. + x_ cd "$XBMK_CACHE/xbmkpath" + x_ ln -s "`pybin "$python"`" python + ) || err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"; : } # Use direct path, to prevent a hang if Python is using a virtual environment, @@ -193,16 +200,6 @@ pybin() command -v "$1" 2>/dev/null || return 1 } -xbmk_create_pathdirs() -{ - ( - # set up python v3.x in PATH, in case it's not set up correctly. - # see code above that detected the correct python3 command. - x_ cd "$XBMK_CACHE/xbmkpath" - x_ ln -s "`pybin "$python"`" python - ) || err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"; : -} - xbmk_child_exec() { xbmk_rval=0 |