mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 19:23:24 +02:00
lib.sh: further condense the python check
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+2
-3
@@ -102,9 +102,8 @@ python="python3"
|
|||||||
command -v python3 1>/dev/null || python="python"
|
command -v python3 1>/dev/null || python="python"
|
||||||
pyver="2" && [ "$python" = "python3" ] && pyver="3"
|
pyver="2" && [ "$python" = "python3" ] && pyver="3"
|
||||||
command -v $python 1>/dev/null || pyver=""
|
command -v $python 1>/dev/null || pyver=""
|
||||||
[ -z "$pyver" ] || \
|
[ -z "$pyver" ] || $python -c 'import sys; print(sys.version_info[:])' \
|
||||||
$python -c 'import sys; print(sys.version_info[:])' 1>/dev/null \
|
1>/dev/null 2>/dev/null || $err "Cannot detect host Python version."
|
||||||
2>/dev/null || $err "Cannot determine which Python version."
|
|
||||||
[ -n "$pyver" ] && \
|
[ -n "$pyver" ] && \
|
||||||
pyver="`$python -c 'import sys; print(sys.version_info[:])' | \
|
pyver="`$python -c 'import sys; print(sys.version_info[:])' | \
|
||||||
awk '{print $1}'`" && pyver="${pyver#(}" && pyver="${pyver%,}"
|
awk '{print $1}'`" && pyver="${pyver#(}" && pyver="${pyver%,}"
|
||||||
|
|||||||
Reference in New Issue
Block a user