diff options
author | Dan Nicholson <dbn@endlessos.org> | 2023-02-07 08:38:18 -0700 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2023-02-18 14:48:47 +0000 |
commit | fba3a7d35e7739a6b923f74596d388a3ae7a2cfa (patch) | |
tree | ae00f9399a4aa4067ff5e388b5cddaeac09550d3 /tests/test-repo.sh | |
parent | 77b3f0f03ec8491bda9e27ba9e7c1b85a3fe9f8a (diff) | |
download | flatpak-fba3a7d35e7739a6b923f74596d388a3ae7a2cfa.tar.gz |
transaction: Ignore uninstall operations for no deploy
If `no_deploy` has been set to `TRUE` in a transaction, then the
intention is that no changes will be made to the installed flatpaks.
Currently that's not the case for explicitly or implicitly added
uninstall operations. That's particularly bad for eol-rebase flatpaks
since they old version will be automatically removed without the new
version being installed. To address this, prevent uninstall operations
from being added for no deploy transactions.
Closes: #5172
Diffstat (limited to 'tests/test-repo.sh')
-rw-r--r-- | tests/test-repo.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test-repo.sh b/tests/test-repo.sh index 55403259..4c24cd3e 100644 --- a/tests/test-repo.sh +++ b/tests/test-repo.sh @@ -439,6 +439,13 @@ ${FLATPAK} build-commit-from --no-update-summary --end-of-life-rebase=org.test.H GPGARGS="${FL_GPGARGS}" $(dirname $0)/make-test-app.sh repos/test-rebase org.test.NewHello master "${REBASE_COLLECTION_ID}" "NEW" > /dev/null update_repo test-rebase +# First do a --no-deploy update and check the old version is still installed +${FLATPAK} ${U} update -y --no-deploy org.test.Hello >&2 + +assert_has_dir $HOME/.var/app/org.test.Hello +assert_has_file $HOME/.var/app/org.test.Hello/data/a-file +assert_not_has_dir $HOME/.var/app/org.test.NewHello + ${FLATPAK} ${U} update -y org.test.Hello >&2 # Make sure we got the new version installed @@ -491,6 +498,12 @@ assert_has_dir $FL_DIR/runtime/org.test.Platform/$ARCH/master/active/files make_updated_runtime "" "" "mainline" "" make_updated_app "" "" "" "UPDATED99" "" "mainline" +# First update with --no-deploy and check the old runtime is still installed +${FLATPAK} ${U} update -y --no-deploy org.test.Hello >&2 + +assert_has_dir $FL_DIR/runtime/org.test.Platform/$ARCH/master/active/files +assert_not_has_dir $FL_DIR/runtime/org.test.Platform/$ARCH/mainline/active/files + ${FLATPAK} ${U} update -y org.test.Hello >&2 # The previous runtime should have been removed during the update @@ -518,7 +531,11 @@ ${FLATPAK} ${U} update -y org.test.Platform >&2 ${FLATPAK} ${U} info org.test.Platform > info-log assert_file_has_content info-log "End-of-life: Reason4" -# Now that the runtime is EOL and unused it should be uninstalled by the update command +# Now that the runtime is EOL and unused it should be uninstalled by the +# update command. Check first that it's not uninstalled with --no-deploy. +${FLATPAK} ${U} update -y --no-deploy >&2 +assert_has_dir $FL_DIR/runtime/org.test.Platform/$ARCH/master/active/files + ${FLATPAK} ${U} update -y >&2 assert_not_has_dir $FL_DIR/runtime/org.test.Platform/$ARCH/master/active/files |