[pacman-dev] CVS update of pacman-lib/lib/libalpm (deps.c versioncmp.c)

Aaron Griffin aaron at archlinux.org
Sun Feb 18 13:29:29 EST 2007


    Date: Sunday, February 18, 2007 @ 13:29:29
  Author: aaron
    Path: /home/cvs-pacman/pacman-lib/lib/libalpm

Modified: deps.c (1.66 -> 1.67) versioncmp.c (1.13 -> 1.14)

* Fix version comparisons when one pkgrel doesn't exist (this ony fails on an ==
  operation, technically, as 1.1.2-1 >= 1.1.2 is true.


--------------+
 deps.c       |    6 +++---
 versioncmp.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)


Index: pacman-lib/lib/libalpm/deps.c
diff -u pacman-lib/lib/libalpm/deps.c:1.66 pacman-lib/lib/libalpm/deps.c:1.67
--- pacman-lib/lib/libalpm/deps.c:1.66	Fri Feb 16 17:41:51 2007
+++ pacman-lib/lib/libalpm/deps.c	Sun Feb 18 13:29:28 2007
@@ -328,7 +328,7 @@
 				}
 				/* else if still not found... */
 				if(!found) {
-					_alpm_log(PM_LOG_DEBUG, _("checkdeps: found %s as a dependency for %s"),
+					_alpm_log(PM_LOG_DEBUG, _("missing dependency '%s' for package '%s'"),
 					                          depend.name, tp->name);
 					miss = _alpm_depmiss_new(tp->name, PM_DEP_TYPE_DEPEND, depend.mod,
 					                         depend.name, depend.version);
@@ -397,8 +397,7 @@
 
 int _alpm_splitdep(char *depstr, pmdepend_t *depend)
 {
-	char *str = NULL;
-	char *ptr = NULL;
+	char *str = NULL, *ptr = NULL;
 
 	if(depstr == NULL || depend == NULL) {
 		return(-1);
@@ -432,6 +431,7 @@
 	if(depend->mod != PM_DEP_MOD_EQ) {
 		ptr++;
 	}
+
 	STRNCPY(depend->version, ptr, PKG_VERSION_LEN);
 	FREE(str);
 
Index: pacman-lib/lib/libalpm/versioncmp.c
diff -u pacman-lib/lib/libalpm/versioncmp.c:1.13 pacman-lib/lib/libalpm/versioncmp.c:1.14
--- pacman-lib/lib/libalpm/versioncmp.c:1.13	Fri Feb  9 16:08:10 2007
+++ pacman-lib/lib/libalpm/versioncmp.c	Sun Feb 18 13:29:29 2007
@@ -238,7 +238,7 @@
 
 	if((!*one) && (!*two)) {
 		/* compare release numbers */
-		if(rel1 && rel2) return(_alpm_versioncmp(rel1, rel2));
+		if(rel1 && rel2 && strlen(rel1) && strlen(rel2)) return(_alpm_versioncmp(rel1, rel2));
 		return(0);
 	}
 




More information about the pacman-dev mailing list