fix(postprocess): fix shell crash in bootloader preset logic

The use of the `&&` operator combined with `set -e` caused the
postprocess script to exit with code 1 when `$VERSION_ID` was
less than 43.

Fixes: https://gitlab.com/fedora/bootc/base-images/-/merge_requests/456
Closes: https://gitlab.com/fedora/bootc/base-images/-/work_items/79
This commit is contained in:
Joel Capitao 2026-04-28 14:15:09 +02:00
commit 6493dc2601
No known key found for this signature in database
GPG key ID: BA202511DDC0AAC4

View file

@ -21,13 +21,15 @@ postprocess:
case "$ID" in
fedora)
[ "$VERSION_ID" -ge 43 ] && echo "enable bootloader-update.service" >> "$preset_file_name"
if [ "$VERSION_ID" -ge 43 ]; then
echo "enable bootloader-update.service" >> "$preset_file_name"
fi
;;
centos)
[ "$VERSION_ID" -ge 9 ] && echo "enable bootloader-update.service" >> "$preset_file_name"
if [ "$VERSION_ID" -ge 9 ]; then
echo "enable bootloader-update.service" >> "$preset_file_name"
fi
;;
*) ;;
esac
# Undo RPM scripts enabling units; we want the presets to be canonical