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>
master
Leah Rowe 2025-05-18 11:40:28 +01:00
parent abf52b0394
commit 46f09075c2
1 changed files with 9 additions and 12 deletions

View File

@ -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