lib.sh: Set python after dependencies
otherwise, the user can't install python, which is in the dependencies. an irony! Signed-off-by: Leah Rowe <leah@libreboot.org>20250107_branch
parent
d57303e080
commit
d731b07aa7
|
@ -15,16 +15,6 @@ tmpgit="$PWD/tmp/gitclone"
|
||||||
grubdata="config/data/grub"
|
grubdata="config/data/grub"
|
||||||
err="err_"
|
err="err_"
|
||||||
|
|
||||||
pyver="2"
|
|
||||||
python="python3"
|
|
||||||
command -v python3 1>/dev/null || python="python"
|
|
||||||
command -v $python 1>/dev/null || pyver=""
|
|
||||||
[ -n "$pyver" ] && pyver="$($python --version | awk '{print $2}')"
|
|
||||||
if [ "${pyver%%.*}" != "3" ]; then
|
|
||||||
printf "Wrong python version, or python missing. Must be v 3.x.\n" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
err_()
|
err_()
|
||||||
{
|
{
|
||||||
printf "ERROR %s: %s\n" "$0" "$1" 1>&2; exit 1
|
printf "ERROR %s: %s\n" "$0" "$1" 1>&2; exit 1
|
||||||
|
@ -88,6 +78,16 @@ if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pyver="2"
|
||||||
|
python="python3"
|
||||||
|
command -v python3 1>/dev/null || python="python"
|
||||||
|
command -v $python 1>/dev/null || pyver=""
|
||||||
|
[ -n "$pyver" ] && pyver="$($python --version | awk '{print $2}')"
|
||||||
|
if [ "${pyver%%.*}" != "3" ]; then
|
||||||
|
printf "Wrong python version, or python missing. Must be v 3.x.\n" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)"
|
id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)"
|
||||||
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue