From 5b27e78ba015a48baf2d3c8687fdf3084781f9c9 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 19 Aug 2009 17:58:03 +0200 Subject: Check package arch before installing This implements FS#15622 Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/remove.c | 6 ++++++ src/pacman/sync.c | 6 ++++++ src/pacman/upgrade.c | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 0efbd94e..b5119fa5 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -103,6 +103,12 @@ int pacman_remove(alpm_list_t *targets) pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerrorlast()); switch(pm_errno) { + case PM_ERR_PKG_INVALID_ARCH: + for(i = data; i; i = alpm_list_next(i)) { + char *pkg = alpm_list_getdata(i); + printf(_(":: package %s does not have a valid architecture\n"), pkg); + } + break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index dc936219..4f101f99 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -639,6 +639,12 @@ static int sync_trans(alpm_list_t *targets) alpm_strerrorlast()); switch(pm_errno) { alpm_list_t *i; + case PM_ERR_PKG_INVALID_ARCH: + for(i = data; i; i = alpm_list_next(i)) { + char *pkg = alpm_list_getdata(i); + printf(_(":: package %s does not have a valid architecture\n"), pkg); + } + break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index 1570f95e..e7691185 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -87,6 +87,12 @@ int pacman_upgrade(alpm_list_t *targets) pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"), alpm_strerrorlast()); switch(pm_errno) { + case PM_ERR_PKG_INVALID_ARCH: + for(i = data; i; i = alpm_list_next(i)) { + char *pkg = alpm_list_getdata(i); + printf(_(":: package %s does not have a valid architecture\n"), pkg); + } + break; case PM_ERR_UNSATISFIED_DEPS: for(i = data; i; i = alpm_list_next(i)) { pmdepmissing_t *miss = alpm_list_getdata(i); -- cgit v1.2.3-70-g09d2