diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-07 06:12:53 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-07 06:12:53 +0000 |
commit | cbd516a06e92d50101ee4e8dcb8e25fe10a39eb7 (patch) | |
tree | 5469588fa18213ce7d74102d72642e11ad89d280 | |
parent | 6c5066471c63adce5d413a5511951d89f6fd10be (diff) | |
download | pacman-cbd516a06e92d50101ee4e8dcb8e25fe10a39eb7.tar.xz |
Only honor 'force' if versions are NOT identical
-rw-r--r-- | lib/libalpm/package.c | 10 |
1 files changed, 4 insertions, 6 deletions
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)"), |