From cbd516a06e92d50101ee4e8dcb8e25fe10a39eb7 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 7 Feb 2007 06:12:53 +0000 Subject: Only honor 'force' if versions are NOT identical --- lib/libalpm/package.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 33cfb6c1..bd977902 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -134,15 +134,13 @@ int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg) _alpm_db_read(pkg->data, INFRQ_DESC, pkg); } - if(pkg->force) { - /* skip the version compare call if this is a 'force' package */ - return(1); - } - /* compare versions and see if we need to upgrade */ cmp = alpm_versioncmp(local_pkg->version, pkg->version); - if(cmp > 0) { + if(cmp != 0 && pkg->force) { + cmp = 1; + _alpm_log(PM_LOG_WARNING, _("%s: forcing upgrade to version %s"), local_pkg->name, pkg->version); + } else if(cmp > 0) { /* local version is newer */ pmdb_t *db = pkg->data; _alpm_log(PM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)"), -- cgit v1.2.3