grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] autogen.sh: detect python3


From: Heinrich Schuchardt
Subject: [PATCH 1/1] autogen.sh: detect python3
Date: Fri, 13 Aug 2021 20:46:24 +0200

On some current distributions there is no /usr/bin/python. The Python
binary is /usr/bin/python3. If a command python3 is available, use it
instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 autogen.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/autogen.sh b/autogen.sh
index 31b0ced7e..c95df3bf0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,8 +7,12 @@ if [ ! -e grub-core/lib/gnulib/stdlib.in.h ]; then
   exit 1
 fi
 
-# Set ${PYTHON} to plain 'python' if not set already
+# Set ${PYTHON} to 'python3' or plain 'python' if not set already
+if python3 --version 2>/dev/null; then
+: ${PYTHON:=python3}
+else
 : ${PYTHON:=python}
+fi
 
 export LC_COLLATE=C
 unset LC_ALL
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]