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
parent
abf52b0394
commit
46f09075c2
|
@ -31,7 +31,7 @@ xbmk_init()
|
||||||
[ "$(id -u)" != "0" ] || err "this command as root is not permitted"
|
[ "$(id -u)" != "0" ] || err "this command as root is not permitted"
|
||||||
|
|
||||||
for init_cmd in set_version set_env lock git_init \
|
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
|
xbmk_$init_cmd "$@" || break
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,14 @@ xbmk_set_pyver()
|
||||||
[ -n "$pyver" ] && \
|
[ -n "$pyver" ] && \
|
||||||
pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" && \
|
pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" && \
|
||||||
pyver="${pyver#(}" && pyver="${pyver%,}"
|
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,
|
# 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
|
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_child_exec()
|
||||||
{
|
{
|
||||||
xbmk_rval=0
|
xbmk_rval=0
|
||||||
|
|
Loading…
Reference in New Issue