From 7acb4add49fed00ffec8be1ffd6e03d7f3d51e0d Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 9 Jun 2007 18:14:30 +0200 Subject: [PATCH] Fix output message when an error happens in checkdeps. Based on the patch found here : http://archlinux.org/pipermail/pacman-dev/2007-March/007873.html But I believe that the first change from PM_DEP_TYPE_DEPEND to PM_DEP_TYPE_REQUIRED in this patch was incorrect. So I only made the second one. Signed-off-by: Chantry Xavier --- lib/libalpm/alpm.h | 1 + lib/libalpm/deps.c | 6 +++--- src/pacman/sync.c | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 9cdda06..3f7aec5 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -349,6 +349,7 @@ typedef enum _pmdepmod_t { typedef enum _pmdeptype_t { PM_DEP_TYPE_DEPEND = 1, + PM_DEP_TYPE_REQUIRED, PM_DEP_TYPE_CONFLICT } pmdeptype_t; diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index b6f8cc8..9871541 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -404,10 +404,10 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op, } } if(!found) { - _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as required by %s"), + _alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s which requires %s"), reqname, alpm_pkg_get_name(tp)); - miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), PM_DEP_TYPE_DEPEND, - PM_DEP_MOD_ANY, j->data, NULL); + miss = _alpm_depmiss_new(alpm_pkg_get_name(tp), PM_DEP_TYPE_REQUIRED, + PM_DEP_MOD_ANY, j->data, NULL); if(!_alpm_depmiss_isin(miss, baddeps)) { baddeps = alpm_list_add(baddeps, miss); } else { diff --git a/src/pacman/sync.c b/src/pacman/sync.c index fa99797..37bde97 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -624,8 +624,9 @@ int pacman_sync(alpm_list_t *targets) case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); - printf(":: %s %s %s", alpm_dep_get_target(miss), _("requires"), - alpm_dep_get_name(miss)); + printf(":: %s %s %s", alpm_dep_get_target(miss), + alpm_dep_get_type(miss) == PM_DEP_TYPE_DEPEND ? _("requires") : _("is required by"), + alpm_dep_get_name(miss)); switch(alpm_dep_get_mod(miss)) { case PM_DEP_MOD_ANY: break; -- 1.5.2.1