Skip Flatpak seed rebuilds when the installation commits are unchanged
This commit is contained in:
parent
12b5f92b8c
commit
ff2366952c
1 changed files with 13 additions and 0 deletions
|
|
@ -40,6 +40,18 @@ fi
|
|||
flatpak install --system --noninteractive --assumeyes flathub "${apps[@]}"
|
||||
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.
|
||||
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
|
||||
test -s /seed/evidence/manifest.tsv
|
||||
if [[ -f /cached-seed/manifest.tsv ]] && cmp -s /seed/evidence/manifest.tsv /cached-seed/manifest.tsv; then
|
||||
echo 'FLATPAK_SEED_UNCHANGED: installation commits match the cached export'
|
||||
touch /seed/no-change
|
||||
exit 0
|
||||
fi
|
||||
flatpak remotes --system --show-details > /seed/evidence/remotes.txt
|
||||
test ! -e /seed/export
|
||||
mkdir /seed/export
|
||||
|
|
@ -73,6 +85,7 @@ PY
|
|||
cp /seed/flathub.flatpakrepo /seed/export/
|
||||
cp /policy.json /seed/export/policy.json
|
||||
cp /seed/evidence/refs.tsv /seed/export/refs.tsv
|
||||
cp /seed/evidence/manifest.tsv /seed/export/manifest.tsv
|
||||
(cd /seed/export; find . -type f ! -name SHA256SUMS -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS)
|
||||
date --utc --iso-8601=seconds > /seed/evidence/export-complete
|
||||
echo 'SEED_EXPORT_COMPLETE: installed-VM delivery acceptance still required'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue