From 53a0b528bf41af7c54818dfad9c6028e78425acf Mon Sep 17 00:00:00 2001 From: Phaedrus Leeds Date: Tue, 29 Mar 2022 16:01:30 -0700 Subject: Add DeploySideloadCollectionID flatpakref/flatpakrepo key When Flatpak's P2P updates support was replaced with the "sideloading" implementation in 1.7.1, a new server side repo config key "deploy-sideload-collection-id" was added which gets set when you pass "--deploy-sideload-collection-id" to "flatpak build-update-repo", and has the effect of setting "xa.deploy-collection-id" in the repo metadata that is pulled by clients, which itself causes a collection id to be set on the remote for clients using Flatpak >= 1.7.1. This commit adds an analogous key in flatpakref and flatpakrepo files, so the collection id can be set when the remote is configured, rather than later on when the repo metadata is pulled and acted upon. As before with DeployCollectionID, it has no difference in function compared to DeployCollectionID or CollectionID and the only difference is which Flatpak versions are affected. It would've been better if this were added in 1.7.1 when the sideload support was added, but alas here we are. (Also update the docs and unit tests) --- tests/test-repo.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-repo.sh b/tests/test-repo.sh index 404e160f..55403259 100644 --- a/tests/test-repo.sh +++ b/tests/test-repo.sh @@ -24,7 +24,7 @@ set -euo pipefail skip_without_bwrap skip_revokefs_without_fuse -echo "1..44" +echo "1..45" #Regular repo setup_repo @@ -208,7 +208,7 @@ GPGKey=${FL_GPG_BASE64} EOF if [ x${USE_COLLECTIONS_IN_CLIENT-} == xyes ]; then - echo "DeployCollectionID=org.test.Collection.Flatpakref" >> repos/flatpakref/flatpakref-repo.flatpakrepo + echo "DeploySideloadCollectionID=org.test.Collection.Flatpakref" >> repos/flatpakref/flatpakref-repo.flatpakrepo fi cat << EOF > org.test.Hello.flatpakref @@ -221,6 +221,10 @@ GPGKey=${FL_GPG_BASE64} RuntimeRepo=http://127.0.0.1:$(cat httpd-port)/flatpakref/flatpakref-repo.flatpakrepo EOF +if [ x${USE_COLLECTIONS_IN_CLIENT-} == xyes ]; then + echo "DeploySideloadCollectionID=org.test.Collection.Flatpakref" >> org.test.Hello.flatpakref +fi + ${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello >&2 # Ensure that only one remote is added even though the URL in the flatpakref @@ -239,6 +243,14 @@ assert_remote_has_config allthegoodstuff xa.title "The Remote Title" ok "install flatpakref uses RuntimeRepo metadata for remote" +if [ x${USE_COLLECTIONS_IN_CLIENT-} == xyes ]; then + assert_remote_has_config allthegoodstuff collection-id "org.test.Collection.Flatpakref" +else + assert_remote_has_no_config allthegoodstuff collection-id +fi + +ok "install flatpakref sets collection-id on remote if available" + ${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello >&2 if ${FLATPAK} ${U} install -y test-missing-gpg-repo org.test.Platform &> install-error-log; then -- cgit v1.2.1