From 1381b58ceb36dbb10cee10584a12ef341018c0fa Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Fri, 18 May 2007 01:22:18 -0500 Subject: Fix extraneous "ignoring upgrade" output on Ignore'd packages Reorder package version checking so there is no output when a package is listed in IgnorePkg. Closes FS#7111 Signed-off-by: Aaron Griffin --- lib/libalpm/package.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 17851535..d3547dfb 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -139,17 +139,19 @@ int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg) _alpm_db_read(pkg->data, pkg, INFRQ_DESC); } + /* compare versions and see if we need to upgrade */ + cmp = _alpm_versioncmp(alpm_pkg_get_version(pkg), alpm_pkg_get_version(local_pkg)); + if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(pkg))) { /* package should be ignored (IgnorePkg) */ - _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"), - alpm_pkg_get_name(local_pkg), alpm_pkg_get_version(local_pkg), - alpm_pkg_get_version(pkg)); + if(cmp > 0) { + _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"), + alpm_pkg_get_name(local_pkg), alpm_pkg_get_version(local_pkg), + alpm_pkg_get_version(pkg)); + } return(0); } - /* compare versions and see if we need to upgrade */ - cmp = _alpm_versioncmp(alpm_pkg_get_version(pkg), alpm_pkg_get_version(local_pkg)); - if(cmp != 0 && pkg->force) { cmp = 1; _alpm_log(PM_LOG_WARNING, _("%s: forcing upgrade to version %s"), -- cgit v1.2.3-70-g09d2