[pacman-dev] CVS update of pacman-lib/lib/libalpm (6 files)
Aaron Griffin
aaron at archlinux.org
Fri Feb 9 16:08:11 EST 2007
Date: Friday, February 9, 2007 @ 16:08:11
Author: aaron
Path: /home/cvs-pacman/pacman-lib/lib/libalpm
Modified: add.c (1.110 -> 1.111) alpm.c (1.113 -> 1.114)
alpm.h (1.74 -> 1.75) package.c (1.63 -> 1.64)
versioncmp.c (1.12 -> 1.13) versioncmp.h (1.6 -> 1.7)
* 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.
--------------+
add.c | 4 ++--
alpm.c | 22 ++--------------------
alpm.h | 3 ---
package.c | 2 +-
versioncmp.c | 6 +++---
versioncmp.h | 2 ++
6 files changed, 10 insertions(+), 29 deletions(-)
Index: pacman-lib/lib/libalpm/add.c
diff -u pacman-lib/lib/libalpm/add.c:1.110 pacman-lib/lib/libalpm/add.c:1.111
--- pacman-lib/lib/libalpm/add.c:1.110 Wed Jan 31 21:29:07 2007
+++ pacman-lib/lib/libalpm/add.c Fri Feb 9 16:08:10 2007
@@ -158,7 +158,7 @@
if(trans->flags & PM_TRANS_FLAG_FRESHEN) {
/* only upgrade/install this package if it is already installed and at a lesser version */
dummy = _alpm_db_get_pkgfromcache(db, pkgname);
- if(dummy == NULL || alpm_versioncmp(dummy->version, pkgver) >= 0) {
+ if(dummy == NULL || _alpm_versioncmp(dummy->version, pkgver) >= 0) {
pm_errno = PM_ERR_PKG_CANT_FRESH;
goto error;
}
@@ -170,7 +170,7 @@
for(i = trans->packages; i; i = i->next) {
pmpkg_t *pkg = i->data;
if(strcmp(pkg->name, pkgname) == 0) {
- if(alpm_versioncmp(pkg->version, pkgver) < 0) {
+ if(_alpm_versioncmp(pkg->version, pkgver) < 0) {
pmpkg_t *newpkg;
_alpm_log(PM_LOG_WARNING, _("replacing older version %s-%s by %s in target list"),
pkg->name, pkg->version, pkgver);
Index: pacman-lib/lib/libalpm/alpm.c
diff -u pacman-lib/lib/libalpm/alpm.c:1.113 pacman-lib/lib/libalpm/alpm.c:1.114
--- pacman-lib/lib/libalpm/alpm.c:1.113 Wed Feb 7 17:08:37 2007
+++ pacman-lib/lib/libalpm/alpm.c Fri Feb 9 16:08:10 2007
@@ -561,7 +561,7 @@
{
ALPM_LOG_FUNC;
- return(alpm_versioncmp(ver1, ver2));
+ return(_alpm_versioncmp(ver1, ver2));
}
/* internal */
@@ -1175,25 +1175,7 @@
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;
Index: pacman-lib/lib/libalpm/alpm.h
diff -u pacman-lib/lib/libalpm/alpm.h:1.74 pacman-lib/lib/libalpm/alpm.h:1.75
--- pacman-lib/lib/libalpm/alpm.h:1.74 Fri Feb 9 11:02:20 2007
+++ pacman-lib/lib/libalpm/alpm.h Fri Feb 9 16:08:10 2007
@@ -482,9 +482,6 @@
char *alpm_strerror(int err);
-/* Version Compare */
-int alpm_versioncmp(const char *a, const char *b);
-
alpm_list_t *alpm_get_upgrades();
#ifdef __cplusplus
Index: pacman-lib/lib/libalpm/package.c
diff -u pacman-lib/lib/libalpm/package.c:1.63 pacman-lib/lib/libalpm/package.c:1.64
--- pacman-lib/lib/libalpm/package.c:1.63 Wed Feb 7 01:12:53 2007
+++ pacman-lib/lib/libalpm/package.c Fri Feb 9 16:08:10 2007
@@ -135,7 +135,7 @@
}
/* compare versions and see if we need to upgrade */
- cmp = alpm_versioncmp(local_pkg->version, pkg->version);
+ cmp = _alpm_versioncmp(local_pkg->version, pkg->version);
if(cmp != 0 && pkg->force) {
cmp = 1;
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.12 pacman-lib/lib/libalpm/versioncmp.c:1.13
--- pacman-lib/lib/libalpm/versioncmp.c:1.12 Tue Jan 30 03:14:11 2007
+++ pacman-lib/lib/libalpm/versioncmp.c Fri Feb 9 16:08:10 2007
@@ -148,7 +148,7 @@
#endif
/* this function was taken from rpm 4.0.4 and rewritten */
-int SYMEXPORT alpm_versioncmp(const char *a, const char *b)
+int _alpm_versioncmp(const char *a, const char *b)
{
char str1[64], str2[64];
char *ptr1, *ptr2;
@@ -238,7 +238,7 @@
if((!*one) && (!*two)) {
/* compare release numbers */
- if(rel1 && rel2) return(alpm_versioncmp(rel1, rel2));
+ if(rel1 && rel2) return(_alpm_versioncmp(rel1, rel2));
return(0);
}
@@ -256,7 +256,7 @@
if(dep->mod == PM_DEP_MOD_ANY) {
equal = 1;
} else {
- int cmp = alpm_versioncmp(pkg->version, dep->version);
+ int cmp = _alpm_versioncmp(pkg->version, dep->version);
switch(dep->mod) {
case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
Index: pacman-lib/lib/libalpm/versioncmp.h
diff -u pacman-lib/lib/libalpm/versioncmp.h:1.6 pacman-lib/lib/libalpm/versioncmp.h:1.7
--- pacman-lib/lib/libalpm/versioncmp.h:1.6 Tue Jan 30 02:47:20 2007
+++ pacman-lib/lib/libalpm/versioncmp.h Fri Feb 9 16:08:10 2007
@@ -27,6 +27,8 @@
#include "package.h"
int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
+int _alpm_versioncmp(const char *a, const char *b)
+
#endif
More information about the pacman-dev
mailing list