From 24816c183183bdf4911e13cd40fb3cf76b91fdda Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:02:39 +0200 Subject: [PATCH] cli: prepare-host: Invert host-release checking for python2 Instead of having to add every new release to the list that does not support python2, inverse this if statement and only check if the build host is Debian bullseye or ubuntu jammy. Every release newer than those do not have python2. Older build hosts are unsupported. --- lib/functions/host/prepare-host.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index b2753462bc5d..144ef44e31f8 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -304,11 +304,12 @@ function adaptative_prepare_host_dependencies() { fi ### Python2 -- required for some older u-boot builds - # Debian 'sid'/'bookworm' and Ubuntu 'lunar' does not carry python2 anymore; in this case some u-boot's might fail to build. - if [[ "sid bookworm trixie lunar mantic noble" == *"${host_release}"* ]]; then - display_alert "Python2 not available on host release '${host_release}'" "old(er) u-boot builds might/will fail" "wrn" - else + # Debian newer than 'bookworm' and Ubuntu newer than 'lunar'/'mantic' does not carry python2 anymore; in this case some u-boot's might fail to build. + # Last versions to support python2 were Debian 'bullseye' and Ubuntu 'jammy' + if [[ "bullseye jammy" == *"${host_release}"* ]]; then host_dependencies+=("python2" "python2-dev") + else + display_alert "Python2 not available on host release '${host_release}'" "ancient u-boot versions might/will fail to build" "info" fi # Only install acng if asked to.