summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorBryan Ischo <bryan@ischo.com>2009-02-22 11:25:31 +0100
committerDan McGee <dan@archlinux.org>2009-02-24 03:33:56 +0100
commit02685504012a4880e599b15f1060f6bd0bf48797 (patch)
tree0d227fbfa8a2c58a7e23e6d23365e4b802e2e637 /lib/libalpm/sync.c
parentc8a41b7d6da7f820754a07cb085687ea5e110f85 (diff)
downloadpacman-02685504012a4880e599b15f1060f6bd0bf48797.tar.gz
pacman-02685504012a4880e599b15f1060f6bd0bf48797.tar.xz
Enabled new interactive prompt and updated some tests
Enabled a new prompt to ask the user if they'd like to remove unresolvable packages from the transaction rather than failing it. Many pactest tests that used to fail now return success codes, because pacman now issues a prompt allowing the user to cancel rather than failing many transactions, and the pactest scripts always choose to cancel with no error rather than failing. The only net effect is that the return status of pacman is now 0 in cases where it used to be nonzero. Signed-off-by: Bryan Ischo <bryan@ischo.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 5e5ca92e..eefca7f9 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -442,12 +442,26 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
dependencies not already on the list */
}
- /* If there were unresolvable top-level packages, fail the
- transaction. */
+ /* If there were unresolvable top-level packages, prompt the user to
+ see if they'd like to ignore them rather than failing the sync */
if(unresolvable != NULL) {
- /* pm_errno is set by resolvedeps */
- ret = -1;
- goto cleanup;
+ int remove_unresolvable = 0;
+ QUESTION(handle->trans, PM_TRANS_CONV_REMOVE_PKGS, unresolvable,
+ NULL, NULL, &remove_unresolvable);
+ if (remove_unresolvable) {
+ /* User wants to remove the unresolvable packages from the
+ transaction, so simply drop the unresolvable list. The
+ packages will be removed from the actual transaction when
+ the transaction packages are replaced with a
+ dependency-reordered list below */
+ alpm_list_free(unresolvable);
+ unresolvable = NULL;
+ }
+ else {
+ /* pm_errno is set by resolvedeps */
+ ret = -1;
+ goto cleanup;
+ }
}
/* Add all packages which were "pulled" (i.e. weren't already in the