Skip to contentSkip to conversation

dependencies.sh: Check for a host python version >= 2.7

PATCH Superseded aduskett at gmail.com 1 participant 2 messages Dec 15, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 dependencies.sh: Check for a host python version >= 2.7

From: Adam Duskett <[email protected]>

Older distributions such as CentOS6 come with python2.6, which causes build failures in packages such as host-libglib2 because they require python2.7 or above.

CentOS6 does have the centos-release-scl which allows users to install python2.7, making this transition reasonably easy.

Debian 6 and 7 have reached EOL, and Debian 8 comes with Python 2.7, so this patch should be relatively low impact.

---
Changes v1 -> v2:
- Updated version requirement in prerequisite.txt

 support/dependencies/dependencies.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
support/dependencies/dependencies.sh +8 -0
index 58c34d880f..d0b6bdc23a 100755
@@ -181,6 +181,14 @@ if test "${missing_progs}" = "yes" ; then
 	exit 1
 fi
 
+# Check that the python version is at least 2.7
+PYTHON_VERSION=$(python -V 2>&1 |awk '{print $2}')
+if [ $(echo $PYTHON_VERSION |sed -e 's/\.//g') -lt 2700 ]; then
+	echo
+	echo "You have python '$PYTHON_VERSION' installed.  Python >= 2.7 is required"
+	exit 1;
+fi
+
 if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
 	if ! which locale > /dev/null ; then
 		echo
Signature · 1 line
2.19.2
#1 lore raw

PATCH v2 2/2 prerequisite.txt: Bump python dependency to 2.7

From: Adam Duskett <[email protected]>

---
Changes v1 -> v2:
- Added this patch to the patch series.

 docs/manual/prerequisite.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/manual/prerequisite.txt +1 -1
index 66e1b88f16..dcd3fd255e 100644
@@ -32,7 +32,7 @@ between distributions).
 ** +perl+ (version 5.8.7 or any later)
 ** +tar+
 ** +cpio+
-** +python+ (version 2.6 or any later)
+** +python+ (version 2.7 or any later)
 ** +unzip+
 ** +rsync+
 ** +file+ (must be in +/usr/bin/file+)
Signature · 1 line
2.19.2