summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.h3
-rw-r--r--lib/libalpm/deps.c6
-rw-r--r--lib/libalpm/sync.c24
3 files changed, 24 insertions, 9 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 7b7ca4e7..3836d608 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -371,7 +371,8 @@ typedef enum _pmtransconv_t {
PM_TRANS_CONV_REPLACE_PKG = 0x02,
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
- PM_TRANS_CONV_LOCAL_NEWER = 0x10
+ PM_TRANS_CONV_LOCAL_NEWER = 0x10,
+ PM_TRANS_CONV_REMOVE_PKGS = 0x20,
} pmtransconv_t;
/* Transaction Progress */
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 41d2a83f..ebcd18dd 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -531,8 +531,8 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *exclud
!_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install;
- QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg,
- tpkg, NULL, &install);
+ QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG,
+ pkg, tpkg, NULL, &install);
if(!install) {
continue;
}
@@ -609,7 +609,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *pkg,
if(!spkg) {
pm_errno = PM_ERR_UNSATISFIED_DEPS;
char *missdepstring = alpm_dep_compute_string(missdep);
- _alpm_log(PM_LOG_ERROR, _("cannot resolve \"%s\", a dependency of \"%s\"\n"),
+ _alpm_log(PM_LOG_WARNING, _("cannot resolve \"%s\", a dependency of \"%s\"\n"),
missdepstring, tpkg->name);
free(missdepstring);
if(data) {
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