From ffaf2d538663fd18a250d5cd957054ade2fbda5b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 18 Jun 2018 14:40:58 +0200 Subject: [PATCH] Cli transaction: Print the full uninstall/install/update lists in ready This lets you see what operations will happen and you can confirm it before starting the heavy operations. Closes: #1797 Approved by: alexlarsson --- app/flatpak-builtins-uninstall.c | 2 +- app/flatpak-cli-transaction.c | 109 ++++++++++++++++++++++ tests/libtest.sh | 10 +- tests/test-bundle.sh | 8 +- tests/test-extensions.sh | 8 +- tests/test-repo.sh | 33 +++---- tests/test-run.sh | 26 +++--- tests/test-unsigned-summaries.sh | 14 +-- tests/test-update-remote-configuration.sh | 6 +- 9 files changed, 163 insertions(+), 53 deletions(-) diff --git a/app/flatpak-builtins-uninstall.c b/app/flatpak-builtins-uninstall.c index 7fc6b6a1..07b05c3a 100644 --- a/app/flatpak-builtins-uninstall.c +++ b/app/flatpak-builtins-uninstall.c @@ -391,7 +391,7 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr { g_autoptr(FlatpakTransaction) transaction = NULL; - transaction = flatpak_cli_transaction_new (udir->dir, FALSE, TRUE, error); + transaction = flatpak_cli_transaction_new (udir->dir, opt_yes, TRUE, error); if (transaction == NULL) return FALSE; diff --git a/app/flatpak-cli-transaction.c b/app/flatpak-cli-transaction.c index 39ad7f1f..b2aafa6b 100644 --- a/app/flatpak-cli-transaction.c +++ b/app/flatpak-cli-transaction.c @@ -23,6 +23,7 @@ #include "flatpak-cli-transaction.h" #include "flatpak-transaction-private.h" #include "flatpak-installation-private.h" +#include "flatpak-table-printer.h" #include "flatpak-utils-private.h" #include "flatpak-error.h" #include @@ -32,6 +33,7 @@ struct _FlatpakCliTransaction { FlatpakTransaction parent; + char *name; gboolean disable_interaction; gboolean stop_on_first_error; gboolean is_user; @@ -308,6 +310,109 @@ end_of_lifed (FlatpakTransaction *transaction, } } +static gboolean +transaction_ready (FlatpakTransaction *transaction) +{ + FlatpakCliTransaction *self = FLATPAK_CLI_TRANSACTION (transaction); + GList *ops = flatpak_transaction_get_operations (transaction); + GList *l; + gboolean found_one; + FlatpakTablePrinter *printer = NULL; + + if (ops == NULL) + return TRUE; + + found_one = FALSE; + for (l = ops; l != NULL; l = l->next) + { + FlatpakTransactionOperation *op = l->data; + FlatpakTransactionOperationType type = flatpak_transaction_operation_get_operation_type (op); + const char *ref = flatpak_transaction_operation_get_ref (op); + const char *pref = strchr (ref, '/') + 1; + + if (type != FLATPAK_TRANSACTION_OPERATION_UNINSTALL) + continue; + + if (!found_one) + g_print (_("Uninstalling from %s:\n"), self->name); + found_one = TRUE; + g_print ("%s\n", pref); + } + + found_one = FALSE; + for (l = ops; l != NULL; l = l->next) + { + FlatpakTransactionOperation *op = l->data; + FlatpakTransactionOperationType type = flatpak_transaction_operation_get_operation_type (op); + const char *ref = flatpak_transaction_operation_get_ref (op); + const char *remote = flatpak_transaction_operation_get_remote (op); + const char *commit = flatpak_transaction_operation_get_commit (op); + const char *pref = strchr (ref, '/') + 1; + + if (type != FLATPAK_TRANSACTION_OPERATION_INSTALL && + type != FLATPAK_TRANSACTION_OPERATION_INSTALL_BUNDLE) + continue; + + if (!found_one) + { + g_print (_("Installing in %s:\n"), self->name); + printer = flatpak_table_printer_new (); + found_one = TRUE; + } + + flatpak_table_printer_add_column (printer, pref); + flatpak_table_printer_add_column (printer, remote); + flatpak_table_printer_add_column_len (printer, commit, 12); + flatpak_table_printer_finish_row (printer); + } + if (printer) + { + flatpak_table_printer_print (printer); + flatpak_table_printer_free (printer); + printer = NULL; + } + + found_one = FALSE; + for (l = ops; l != NULL; l = l->next) + { + FlatpakTransactionOperation *op = l->data; + FlatpakTransactionOperationType type = flatpak_transaction_operation_get_operation_type (op); + const char *ref = flatpak_transaction_operation_get_ref (op); + const char *remote = flatpak_transaction_operation_get_remote (op); + const char *commit = flatpak_transaction_operation_get_commit (op); + const char *pref = strchr (ref, '/') + 1; + + if (type != FLATPAK_TRANSACTION_OPERATION_UPDATE) + continue; + + if (!found_one) + { + g_print (_("Updating in %s:\n"), self->name); + printer = flatpak_table_printer_new (); + found_one = TRUE; + } + + flatpak_table_printer_add_column (printer, pref); + flatpak_table_printer_add_column (printer, remote); + flatpak_table_printer_add_column_len (printer, commit, 12); + flatpak_table_printer_finish_row (printer); + } + if (printer) + { + flatpak_table_printer_print (printer); + flatpak_table_printer_free (printer); + printer = NULL; + } + + g_list_free_full (ops, g_object_unref); + + if (!self->disable_interaction && + !flatpak_yes_no_prompt (_("Is this ok"))) + return FALSE; + + return TRUE; +} + static void flatpak_cli_transaction_finalize (GObject *object) { @@ -316,6 +421,8 @@ flatpak_cli_transaction_finalize (GObject *object) if (self->first_operation_error) g_error_free (self->first_operation_error); + g_free (self->name); + G_OBJECT_CLASS (flatpak_cli_transaction_parent_class)->finalize (object); } @@ -331,6 +438,7 @@ flatpak_cli_transaction_class_init (FlatpakCliTransactionClass *klass) FlatpakTransactionClass *transaction_class = FLATPAK_TRANSACTION_CLASS (klass); object_class->finalize = flatpak_cli_transaction_finalize; + transaction_class->ready = transaction_ready; transaction_class->new_operation = new_operation; transaction_class->operation_done = operation_done; transaction_class->operation_error = operation_error; @@ -360,6 +468,7 @@ flatpak_cli_transaction_new (FlatpakDir *dir, self->disable_interaction = disable_interaction; self->stop_on_first_error = stop_on_first_error; + self->name = flatpak_dir_get_name (dir); self->is_user = flatpak_dir_is_user (dir); return (FlatpakTransaction *)g_steal_pointer (&self); diff --git a/tests/libtest.sh b/tests/libtest.sh index d9be67eb..013f3e87 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -287,19 +287,19 @@ setup_python2_repo () { install_repo () { REPONAME=${1:-test} - ${FLATPAK} ${U} install ${REPONAME}-repo org.test.Platform master - ${FLATPAK} ${U} install ${REPONAME}-repo org.test.Hello master + ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Platform master + ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Hello master } install_sdk_repo () { REPONAME=${1:-test} - ${FLATPAK} ${U} install ${REPONAME}-repo org.test.Sdk master + ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.Sdk master } install_python2_repo () { REPONAME=${1:-test} - ${FLATPAK} ${U} install ${REPONAME}-repo org.test.PythonPlatform master - ${FLATPAK} ${U} install ${REPONAME}-repo org.test.PythonSdk master + ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonPlatform master + ${FLATPAK} ${U} install -y ${REPONAME}-repo org.test.PythonSdk master } run () { diff --git a/tests/test-bundle.sh b/tests/test-bundle.sh index ca3d158f..62f66ab5 100755 --- a/tests/test-bundle.sh +++ b/tests/test-bundle.sh @@ -85,11 +85,11 @@ assert_has_file $FL_DIR/repo/org.test.Hello-origin.trustedkeys.gpg echo "ok install app bundle" -${FLATPAK} uninstall --force-remove ${U} org.test.Platform +${FLATPAK} uninstall -y --force-remove ${U} org.test.Platform assert_not_has_file $FL_DIR/repo/refs/remotes/org.test.Platform-origin/runtime/org.test.Platform/$ARCH/master -${FLATPAK} install ${U} --bundle bundles/platform.flatpak +${FLATPAK} install -y ${U} --bundle bundles/platform.flatpak assert_has_file $FL_DIR/repo/refs/remotes/org.test.Platform-origin/runtime/org.test.Platform/$ARCH/master RUNTIME_COMMIT=`cat $FL_DIR/repo/refs/remotes/org.test.Platform-origin/runtime/org.test.Platform/$ARCH/master` @@ -128,7 +128,7 @@ OLD_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` # TODO: For weird reasons this breaks in the system case. Needs debugging if [ x${USE_SYSTEMDIR-} != xyes ] ; then - ${FLATPAK} ${U} update -v org.test.Hello master + ${FLATPAK} ${U} update -y -v org.test.Hello master ALSO_OLD_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` assert_streq "$OLD_COMMIT" "$ALSO_OLD_COMMIT" fi @@ -137,7 +137,7 @@ echo "ok null update" make_updated_app -${FLATPAK} ${U} update org.test.Hello +${FLATPAK} ${U} update -y org.test.Hello NEW_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` diff --git a/tests/test-extensions.sh b/tests/test-extensions.sh index f7e89c22..f9efaf51 100755 --- a/tests/test-extensions.sh +++ b/tests/test-extensions.sh @@ -44,7 +44,7 @@ EOF ${FLATPAK} build-export --runtime ${GPGARGS-} repos/test ${DIR} ${VERSION} rm -rf ${DIR} - ${FLATPAK} --user install test-repo $ID $VERSION + ${FLATPAK} --user install -y test-repo $ID $VERSION } add_extensions () { @@ -106,8 +106,8 @@ ostree commit --repo=repos/test --owner-uid=0 --owner-gid=0 --no-xattrs --canoni ${FLATPAK} build-update-repo repos/test ${FLATPAK} remote-add --user --no-gpg-verify test-repo repos/test -${FLATPAK} --user install test-repo org.test.Platform master -${FLATPAK} --user install test-repo org.test.Hello master +${FLATPAK} --user install -y test-repo org.test.Platform master +${FLATPAK} --user install -y test-repo org.test.Hello master make_extension org.test.Extension1 master make_extension org.test.Extension1 not-master @@ -159,7 +159,7 @@ add_extensions hello ostree commit --repo=repos/test --owner-uid=0 --owner-gid=0 --no-xattrs --canonical-permissions --branch=app/org.test.Hello/${ARCH}/master -s "modified metadata" hello ${FLATPAK} build-update-repo repos/test -${FLATPAK} --user update org.test.Hello master +${FLATPAK} --user update -y org.test.Hello master assert_has_extension_file /app ext1/exists assert_has_extension_file /app ext1/extension-org.test.Extension1:master diff --git a/tests/test-repo.sh b/tests/test-repo.sh index 8e692ada..be887684 100755 --- a/tests/test-repo.sh +++ b/tests/test-repo.sh @@ -113,13 +113,13 @@ if [ x${USE_COLLECTIONS_IN_CLIENT-} != xyes ] ; then install_repo test-no-gpg echo "ok install without gpg key" - ${FLATPAK} ${U} uninstall org.test.Platform org.test.Hello + ${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello else echo "ok install without gpg key # skip not supported for collections" fi install_repo local-test-no-gpg -${FLATPAK} ${U} uninstall org.test.Platform org.test.Hello +${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello ${FLATPAK} ${U} update --appstream local-test-no-gpg-repo echo "ok local without gpg key" @@ -127,17 +127,17 @@ echo "ok local without gpg key" install_repo test-gpg2 echo "ok with alternative gpg key" -if ${FLATPAK} ${U} install test-repo org.test.Platform 2> install-error-log; then +if ${FLATPAK} ${U} install -y test-repo org.test.Platform 2> install-error-log; then assert_not_reached "Should not be able to install again from different remote without reinstall" fi echo "ok failed to install again from different remote" -${FLATPAK} ${U} install --reinstall test-repo org.test.Platform +${FLATPAK} ${U} install -y --reinstall test-repo org.test.Platform echo "ok re-install" -${FLATPAK} ${U} uninstall org.test.Platform org.test.Hello +${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello -if ${FLATPAK} ${U} install test-missing-gpg-repo org.test.Platform 2> install-error-log; then +if ${FLATPAK} ${U} install -y test-missing-gpg-repo org.test.Platform 2> install-error-log; then assert_not_reached "Should not be able to install with missing gpg key" fi assert_file_has_content install-error-log "GPG signatures found, but none are in trusted keyring" @@ -215,7 +215,7 @@ assert_file_has_content branches-log "^app/org.test.Hello/.*eol=Reason2" ${FLATPAK} ${U} remote-ls -d test-repo > remote-ls-log assert_file_has_content remote-ls-log "^app/org.test.Hello/.*eol=Reason2" -${FLATPAK} ${U} update org.test.Hello 2> update-log +${FLATPAK} ${U} update -y org.test.Hello 2> update-log assert_file_has_content update-log "app/org.test.Hello/.*Reason2" ${FLATPAK} ${U} info org.test.Hello > info-log @@ -224,16 +224,17 @@ assert_file_has_content info-log "end-of-life: Reason2" ${FLATPAK} ${U} list -d > list-log assert_file_has_content list-log "^org.test.Hello/.*eol=Reason2" -${FLATPAK} ${U} uninstall org.test.Hello +${FLATPAK} ${U} uninstall -y org.test.Hello org.test.Platform echo "ok eol build-export" +${FLATPAK} ${U} install -y test-repo org.test.Platform port=$(cat httpd-port-main) UPDATE_REPO_ARGS="--redirect-url=http://127.0.0.1:${port}/test-gpg3 --gpg-import=${FL_GPG_HOMEDIR2}/pubring.gpg" update_repo GPGPUBKEY="${FL_GPG_HOMEDIR2}/pubring.gpg" GPGARGS="${FL_GPGARGS2}" setup_repo_no_add test-gpg3 org.test.Collection.test -${FLATPAK} ${U} update org.test.Platform +${FLATPAK} ${U} update -y org.test.Platform # Ensure we have the new uri ${FLATPAK} ${U} remotes -d | grep ^test-repo > repo-info assert_file_has_content repo-info "/test-gpg3" @@ -242,17 +243,17 @@ assert_file_has_content repo-info "/test-gpg3" GPGARGS="${FL_GPGARGS2}" make_updated_app test-gpg3 org.test.Collection.test update_repo test-gpg3 org.test.Collection.test -${FLATPAK} ${U} install test-repo org.test.Hello +${FLATPAK} ${U} install -y test-repo org.test.Hello assert_file_has_content $FL_DIR/app/org.test.Hello/$ARCH/master/active/files/bin/hello.sh UPDATED echo "ok redirect url and gpg key" -if ${FLATPAK} ${INVERT_U} uninstall org.test.Platform org.test.Hello; then +if ${FLATPAK} ${INVERT_U} uninstall -y org.test.Platform org.test.Hello; then assert_not_reached "Should not be able to uninstall ${INVERT_U} when installed ${U}" fi # Test that unspecified --user/--system finds the right one, so no ${U} -${FLATPAK} uninstall org.test.Platform org.test.Hello +${FLATPAK} uninstall -y org.test.Platform org.test.Hello ${FLATPAK} ${U} list -d > list-log assert_not_file_has_content list-log "^org.test.Hello" @@ -266,12 +267,12 @@ ${FLATPAK} ${U} list -d > list-log assert_file_has_content list-log "^org.test.Hello" assert_file_has_content list-log "^org.test.Platform" -if ${FLATPAK} ${U} uninstall org.test.Platform; then +if ${FLATPAK} ${U} uninstall -y org.test.Platform; then assert_not_reached "Should not be able to uninstall ${U} when there is a dependency installed" fi -${FLATPAK} ${U} uninstall org.test.Hello -${FLATPAK} ${U} uninstall org.test.Platform +${FLATPAK} ${U} uninstall -y org.test.Hello +${FLATPAK} ${U} uninstall -y org.test.Platform ${FLATPAK} ${U} list -d > list-log assert_not_file_has_content list-log "^org.test.Hello" @@ -300,7 +301,7 @@ assert_file_has_content list-log "^org.test.Platform" echo "ok install with --no-deploy and then --no-pull" -${FLATPAK} uninstall --all +${FLATPAK} uninstall -y --all ${FLATPAK} ${U} list -d > list-log assert_not_file_has_content list-log "^org.test.Hello" diff --git a/tests/test-run.sh b/tests/test-run.sh index 45f15d33..3a4a5a61 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -186,7 +186,7 @@ OLD_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` # TODO: For weird reasons this breaks in the system case. Needs debugging if [ x${USE_SYSTEMDIR-} != xyes ] ; then - ${FLATPAK} ${U} update -v org.test.Hello master + ${FLATPAK} ${U} update -y -v org.test.Hello master ALSO_OLD_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` assert_streq "$OLD_COMMIT" "$ALSO_OLD_COMMIT" fi @@ -195,7 +195,7 @@ echo "ok null update" make_updated_app -${FLATPAK} ${U} update org.test.Hello +${FLATPAK} ${U} update -y org.test.Hello NEW_COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` @@ -209,7 +209,7 @@ echo "ok update" ostree --repo=repos/test reset app/org.test.Hello/$ARCH/master "$OLD_COMMIT" update_repo -if ${FLATPAK} ${U} update org.test.Hello; then +if ${FLATPAK} ${U} update -y org.test.Hello; then assert_not_reached "Should not be able to update to older commit" fi @@ -236,7 +236,7 @@ ${FLATPAK} build-finish --command=hello.sh ${DIR} ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} update_repo -${FLATPAK} ${U} install test-repo org.test.Split --subpath=/a --subpath=/b --subpath=/nosuchdir master +${FLATPAK} ${U} install -y test-repo org.test.Split --subpath=/a --subpath=/b --subpath=/nosuchdir master COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Split` if [ x${USE_SYSTEMDIR-} != xyes ] ; then @@ -262,7 +262,7 @@ rm -rf ${DIR}/files/b ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} update_repo -${FLATPAK} ${U} update --subpath=/a --subpath=/b --subpath=/e --subpath=/nosuchdir org.test.Split +${FLATPAK} ${U} update -y --subpath=/a --subpath=/b --subpath=/e --subpath=/nosuchdir org.test.Split COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Split` if [ x${USE_SYSTEMDIR-} != xyes ] ; then @@ -283,7 +283,7 @@ ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} update_repo # Test reusing the old subpath list -${FLATPAK} ${U} update org.test.Split +${FLATPAK} ${U} update -y org.test.Split COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Split` if [ x${USE_SYSTEMDIR-} != xyes ] ; then @@ -319,23 +319,23 @@ ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} update_repo -${FLATPAK} ${U} install test-repo org.test.OldVersion master -${FLATPAK} ${U} install test-repo org.test.CurrentVersion master -(! ${FLATPAK} ${U} install test-repo org.test.NewVersion master) +${FLATPAK} ${U} install -y test-repo org.test.OldVersion master +${FLATPAK} ${U} install -y test-repo org.test.CurrentVersion master +(! ${FLATPAK} ${U} install -y test-repo org.test.NewVersion master) DIR=`mktemp -d` ${FLATPAK} build-init ${DIR} org.test.OldVersion org.test.Platform org.test.Platform ${FLATPAK} build-finish --require-version=99.0.0 --command=hello.sh ${DIR} ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} -(! ${FLATPAK} ${U} update org.test.OldVersion) +(! ${FLATPAK} ${U} update -y org.test.OldVersion) DIR=`mktemp -d` ${FLATPAK} build-init ${DIR} org.test.OldVersion org.test.Platform org.test.Platform ${FLATPAK} build-finish --require-version=0.1.1 --command=hello.sh ${DIR} ${FLATPAK} build-export ${FL_GPGARGS} repos/test ${DIR} -${FLATPAK} ${U} update org.test.OldVersion +${FLATPAK} ${U} update -y org.test.OldVersion echo "ok version checks" @@ -348,7 +348,7 @@ flatpak build-finish --command=hello.sh app ostree --repo=repos/test commit --owner-uid=0 --owner-gid=0 --no-xattrs ${FL_GPGARGS} --branch=app/org.test.Writable/$ARCH/master app update_repo -${FLATPAK} ${U} install test-repo org.test.Writable +${FLATPAK} ${U} install -y test-repo org.test.Writable assert_file_has_mode $FL_DIR/app/org.test.Writable/$ARCH/master/active/files/a-dir 775 @@ -364,7 +364,7 @@ flatpak build-finish --command=hello.sh app ostree --repo=repos/test commit --owner-uid=0 --owner-gid=0 --no-xattrs ${FL_GPGARGS} --branch=app/org.test.Setuid/$ARCH/master app update_repo -if ${FLATPAK} ${U} install test-repo org.test.Setuid &> err2.txt; then +if ${FLATPAK} ${U} install -y test-repo org.test.Setuid &> err2.txt; then assert_not_reached "Should not be able to install with setuid file" fi assert_file_has_content err2.txt [Ii]nvalid diff --git a/tests/test-unsigned-summaries.sh b/tests/test-unsigned-summaries.sh index 307d9561..b631ae5d 100755 --- a/tests/test-unsigned-summaries.sh +++ b/tests/test-unsigned-summaries.sh @@ -78,8 +78,8 @@ assert_file_has_content metadata "'ostree.ref-binding': <\['ostree-metadata'\]>" echo "ok 2 create app with collections" # Try installing the app. -${FLATPAK} ${U} install test-repo org.test.App master -${FLATPAK} ${U} uninstall org.test.App +${FLATPAK} ${U} install -y test-repo org.test.App master +${FLATPAK} ${U} uninstall -y org.test.App echo "ok 3 install app with collections" @@ -90,8 +90,8 @@ ostree --repo=repos/test summary --view > summary assert_file_has_content summary '^Collection ID (ostree.summary.collection-id): org.test.Collection$' assert_not_file_has_content summary '^xa.cache: ' -${FLATPAK} ${U} install test-repo org.test.App master -${FLATPAK} ${U} uninstall org.test.App +${FLATPAK} ${U} install -y test-repo org.test.App master +${FLATPAK} ${U} uninstall -y org.test.App echo "ok 4 install app with collections from unsigned summary" @@ -109,8 +109,8 @@ GPGKey=${FL_GPG_BASE64} CollectionID=org.test.Collection EOF -${FLATPAK} ${U} install --from ./org.test.App.flatpakref -${FLATPAK} ${U} uninstall org.test.App +${FLATPAK} ${U} install -y --from ./org.test.App.flatpakref +${FLATPAK} ${U} uninstall -y org.test.App echo "ok 5 install app with collections from flatpakref" @@ -131,7 +131,7 @@ echo "ok 6 update repo metadata" # Try to install the app again, which should pull the updated repository # metadata as a side effect. -${FLATPAK} ${U} install test-repo org.test.App master +${FLATPAK} ${U} install -y test-repo org.test.App master assert_file_has_content ${FL_DIR}/repo/config '^xa.title=New title$' echo "ok 7 pull updated repo metadata" diff --git a/tests/test-update-remote-configuration.sh b/tests/test-update-remote-configuration.sh index 7043f3fd..529c2a1f 100755 --- a/tests/test-update-remote-configuration.sh +++ b/tests/test-update-remote-configuration.sh @@ -42,7 +42,7 @@ ${FLATPAK} build-finish ${DIR} --socket=x11 --share=network --command=true ${FLATPAK} build-export ${FL_GPGARGS} --update-appstream repos/test ${DIR} master update_repo -${FLATPAK} ${U} install test-repo org.test.App master +${FLATPAK} ${U} install -y test-repo org.test.App master assert_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=true$' assert_not_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=false$' @@ -57,7 +57,7 @@ echo -e "[core]\ncollection-id=org.test.Collection" >> repos/test/config ${FLATPAK} build-export ${FL_GPGARGS} --update-appstream repos/test --collection-id org.test.Collection ${DIR} master UPDATE_REPO_ARGS="--collection-id=org.test.Collection" update_repo -${FLATPAK} ${U} update org.test.App master +${FLATPAK} ${U} update -y org.test.App master assert_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=true$' assert_not_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=false$' @@ -70,7 +70,7 @@ echo "ok 1 update repo config without deploying collection ID" # Now mark the collection ID as to be deployed. The client configuration should # be updated. UPDATE_REPO_ARGS="--collection-id=org.test.Collection --deploy-collection-id" update_repo -${FLATPAK} ${U} update org.test.App master +${FLATPAK} ${U} update -y org.test.App master assert_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=false$' assert_not_file_has_content ${FL_DIR}/repo/config '^gpg-verify-summary=true$'