Flatpak seed: ignore the volatile appstream metadata ref in the no-change check

flathub:appstream2/x86_64 gets a new commit on every 'flatpak update' and is
never part of what create-usb exports, so comparing it made every refresh look
like a change and rebuilt the whole seed (~10 min per variant). Exclude
appstream refs on both sides; older cached manifests are filtered as well.
This commit is contained in:
Archipelago 2026-11-13 22:50:45 +03:00
parent b4fd66d103
commit ea2e9eb94e

View file

@ -42,12 +42,18 @@ flatpak update --system --noninteractive --assumeyes
flatpak list --system --columns=ref,origin,active > /seed/evidence/refs.tsv
# Ref identity plus exact commit, so an unchanged installation can reuse the
# previously verified export instead of rebuilding it. One stable format keeps
# the comparison independent of the flatpak CLI version.
# the comparison independent of the flatpak CLI version. The remote metadata
# ref (flathub:appstream2/x86_64) is excluded: it gets a new commit on every
# `flatpak update` and create-usb never exports it, so keeping it would make
# every refresh look like a change and rebuild the whole seed.
ostree --repo=/var/lib/flatpak/repo refs | LC_ALL=C sort | while IFS= read -r ref; do
printf '%s %s\n' "$ref" "$(ostree --repo=/var/lib/flatpak/repo rev-parse "$ref")"
done > /seed/evidence/manifest.tsv
done | grep -v 'appstream' > /seed/evidence/manifest.tsv
test -s /seed/evidence/manifest.tsv
if [[ -f /cached-seed/manifest.tsv ]] && cmp -s /seed/evidence/manifest.tsv /cached-seed/manifest.tsv; then
# Filter the cached manifest too: exports written before this filter existed
# still carry the volatile metadata refs.
grep -v 'appstream' /cached-seed/manifest.tsv > /seed/evidence/manifest.cached.tsv 2>/dev/null || true
if cmp -s /seed/evidence/manifest.tsv /seed/evidence/manifest.cached.tsv; then
echo 'FLATPAK_SEED_UNCHANGED: installation commits match the cached export'
touch /seed/no-change
exit 0