Include DEST_LANG in rootfs cache hash calculation

The `DEST_LANG` variable affects rootfs cache content (locale is generated via
`locale-gen "${DEST_LANG}"` before cache is packaged), but it was not included in the
cache hash calculation.

This meant that changing `DEST_LANG` would not invalidate the existing cache,
potentially resulting in images with incorrect locale.

Include `DEST_LANG` in the `hash_hooks` calculation in `calculate_rootfs_cache_id()`.

Changes
- `lib/functions/rootfs/create-cache.sh`: Add `LANG=${DEST_LANG}` to the hash input

Result
Changing `DEST_LANG` now properly invalidates rootfs cache, ensuring the correct locale
is generated.
This commit is contained in:
Igor Velkov 2026-01-04 05:00:21 +02:00 committed by Igor
parent 3e71438048
commit e92c53a03f

View File

@ -29,7 +29,7 @@ function calculate_rootfs_cache_id() {
declare -a extension_hooks_hashed=("$(dump_extension_method_sources_functions "${extension_hooks_to_hash[@]}")")
declare hash_hooks="undetermined"
declare legacy_debootstrap="${LEGACY_DEBOOTSTRAP:-"no"}"
hash_hooks="$(echo "${extension_hooks_hashed[@]}" LDB=${legacy_debootstrap,,} | sha256sum | cut -d' ' -f1)"
hash_hooks="$(echo "${extension_hooks_hashed[@]}" LDB=${legacy_debootstrap,,} LANG=${DEST_LANG} | sha256sum | cut -d' ' -f1)"
declare hash_hooks_short="${hash_hooks:0:${short_hash_size}}"
# AGGREGATED_ROOTFS_HASH is produced by aggregation.py