[gnome-build-meta/abderrahim/fix-update-repo] utils/update-local-repo.sh: use ostree instead of flatpak




commit 3e81e0edfd9b79475df1036d13c0fbd36efb2963
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Sat Jan 15 15:59:20 2022 +0100

    utils/update-local-repo.sh: use ostree instead of flatpak
    
    for some reason flatpak produces corrupt repositories

 utils/update-local-repo.sh | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/utils/update-local-repo.sh b/utils/update-local-repo.sh
index d40b7f651..b11e02262 100755
--- a/utils/update-local-repo.sh
+++ b/utils/update-local-repo.sh
@@ -66,19 +66,24 @@ on_exit() {
 }
 trap on_exit EXIT
 
-updated_refs=""
+export OSTREE_REPO=ostree-repo
 
+updated_refs=""
 for element in ${REPO_ELEMENTS}; do
-    ${BST} checkout --hardlinks $element "$checkout/$element"
+    ${BST} checkout --hardlinks $element $checkout/$element
+
     ref=$(ostree refs --repo $checkout/$element)
-    prev_commit=$(ostree rev-parse --repo ostree-repo ${ref} 2>/dev/null || true)
-    test -n "${prev_commit}" && updated_refs="${updated_refs} ${ref}"
-    flatpak build-commit-from --gpg-homedir=ostree-gpg --gpg-sign="$(cat ostree-gpg/default-id)" \
-            --timestamp=NOW \
-            --src-repo="$checkout/$element" --extra-collection-id=org.gnome.GnomeOS ostree-repo $ref
-done
+    commit=$(ostree --repo=$checkout/$element rev-parse $ref)
+    prev_commit=$(ostree rev-parse $ref 2>/dev/null || true)
+
+    ostree pull-local $checkout/$element $commit
+    ostree commit --branch=$ref --tree=ref=$commit --skip-if-unchanged \
+           --gpg-homedir=ostree-gpg --gpg-sign=$(cat ostree-gpg/default-id)
 
-test -n "${updated_refs}" && ostree static-delta generate --repo ostree-repo ${updated_refs}
+    new_commit=$(ostree rev-parse $ref)
+    test -n "$prev_commit" && test "$new_commit" != "$prev_commit" && updated_refs="$updated_refs $ref"
+done
 
-flatpak build-update-repo --gpg-homedir=ostree-gpg --gpg-sign="$(cat ostree-gpg/default-id)" \
-        --prune ostree-repo
+ostree prune --refs-only --keep-younger-than="6 months ago"
+test -n "${updated_refs}" && ostree static-delta generate ${updated_refs}
+ostree summary --update --gpg-homedir=ostree-gpg --gpg-sign="$(cat ostree-gpg/default-id)"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]