Skip to content

Commit

Permalink
cli: prepare-host: Invert host-release checking for python2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ColorfulRhino authored and igorpecovnik committed Jun 25, 2024
1 parent 04f619d commit 24816c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/functions/host/prepare-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 24816c1

Please sign in to comment.