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.
This commit is contained in:
ColorfulRhino
2024-06-25 16:02:39 +02:00
committed by Igor
parent 04f619dc06
commit 24816c1831

View File

@@ -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.