summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-09 21:08:10 +0000
committerAaron Griffin <aaron@archlinux.org>2007-02-09 21:08:10 +0000
commitf8cd4858ca35400eaf9e298ff3e0e9c245e0d1e3 (patch)
treebb8120c99d051551ef1d1a08db10981a663cc4fe /lib/libalpm/alpm.c
parent0ae434d9e1c96a614ed245a6a1ba595186cf4e97 (diff)
downloadpacman-f8cd4858ca35400eaf9e298ff3e0e9c245e0d1e3.tar.xz
* I made "alpm_versioncmp" public a while back, without noticing this was already done (alpm_pkg_vercmp). I dropped this change, making versioncmp "private" again. (alpm_versioncmp -> _alpm_versioncmp, hidden symbol)
* Make alpm_get_upgrades use the same version check that -Su and -S use.
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 0d7246d0..a366562d 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -561,7 +561,7 @@ int SYMEXPORT alpm_pkg_vercmp(const char *ver1, const char *ver2)
{
ALPM_LOG_FUNC;
- return(alpm_versioncmp(ver1, ver2));
+ return(_alpm_versioncmp(ver1, ver2));
}
/* internal */
@@ -1175,25 +1175,7 @@ alpm_list_t *alpm_get_upgrades()
continue;
}
- /* compare versions and see if we need to upgrade */
- cmp = alpm_versioncmp(local->version, spkg->version);
- if(cmp > 0 && !spkg->force) {
- /* local version is newer */
- pmdb_t *db = spkg->data;
- _alpm_log(PM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)"),
- local->name, local->version, db->treename, spkg->version);
- } else if(cmp == 0) {
- /* versions are identical */
- } else if(alpm_list_find_str(handle->ignorepkg, spkg->name)) {
- /* package should be ignored (IgnorePkg) */
- _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"),
- local->name, local->version, spkg->version);
- } else if(_alpm_pkg_istoonew(spkg)) {
- /* package too new (UpgradeDelay) */
- _alpm_log(PM_LOG_DEBUG, _("%s-%s: delaying upgrade of package (%s)"),
- local->name, local->version, spkg->version);
- /* check if spkg->name is already in the packages list. */
- } else {
+ if(alpm_pkg_compare_versions(local, spkg)) {
_alpm_log(PM_LOG_DEBUG, _("%s-%s elected for upgrade (%s => %s)"),
local->name, local->version, local->version, spkg->version);
alpm_list_t *s;