[Frugalware-darcs] pacman-g2: moved _pacman_depcmp() to deps.c

VMiklos vmiklos at frugalware.org
Sat Jun 9 22:43:56 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=pacman-g2;a=darcs_commitdiff;h=20070609203945-e2957-52aae608a2039ea2296879ef59e11823c14f36d1.gz;

[moved _pacman_depcmp() to deps.c
VMiklos <vmiklos at frugalware.org>**20070609203945] {
hunk ./lib/libpacman/deps.c 656
+int _pacman_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
+{
+	int equal = 0;
+
+  if(strcmp(pkg->name, dep->name) == 0
+	    || _pacman_list_is_strin(dep->name, _pacman_pkg_getinfo(pkg, PM_PKG_PROVIDES))) {
+		if(dep->mod == PM_DEP_MOD_ANY) {
+			equal = 1;
+		} else {
+			int cmp = _pacman_versioncmp(_pacman_pkg_getinfo(pkg, PM_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;
+				case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+				default: equal = 1; break;
+			}
+		}
+
+		char *mod = "~=";
+		switch(dep->mod) {
+			case PM_DEP_MOD_EQ: mod = "=="; break;
+			case PM_DEP_MOD_GE: mod = ">="; break;
+			case PM_DEP_MOD_LE: mod = "<="; break;
+			default: break;
+		}
+
+		if(strlen(dep->version) > 0) {
+			_pacman_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s-%s => %s"),
+								_pacman_pkg_getinfo(pkg, PM_PKG_NAME), _pacman_pkg_getinfo(pkg, PM_PKG_NAME),
+								mod, dep->name, dep->version,
+								(equal ? "match" : "no match"));
+		} else {
+			_pacman_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s => %s"),
+								_pacman_pkg_getinfo(pkg, PM_PKG_NAME), _pacman_pkg_getinfo(pkg, PM_PKG_VERSION),
+								mod, dep->name, 
+								(equal ? "match" : "no match"));
+		}
+	}
+
+	return equal;
+}
hunk ./lib/libpacman/deps.h 50
+int _pacman_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
hunk ./lib/libpacman/versioncmp.c 246
-int _pacman_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
-{
-	int equal = 0;
-
-  if(strcmp(pkg->name, dep->name) == 0
-	    || _pacman_list_is_strin(dep->name, _pacman_pkg_getinfo(pkg, PM_PKG_PROVIDES))) {
-		if(dep->mod == PM_DEP_MOD_ANY) {
-			equal = 1;
-		} else {
-			int cmp = _pacman_versioncmp(_pacman_pkg_getinfo(pkg, PM_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;
-				case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
-				default: equal = 1; break;
-			}
-		}
-
-		char *mod = "~=";
-		switch(dep->mod) {
-			case PM_DEP_MOD_EQ: mod = "=="; break;
-			case PM_DEP_MOD_GE: mod = ">="; break;
-			case PM_DEP_MOD_LE: mod = "<="; break;
-			default: break;
-		}
-
-		if(strlen(dep->version) > 0) {
-			_pacman_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s-%s => %s"),
-								_pacman_pkg_getinfo(pkg, PM_PKG_NAME), _pacman_pkg_getinfo(pkg, PM_PKG_NAME),
-								mod, dep->name, dep->version,
-								(equal ? "match" : "no match"));
-		} else {
-			_pacman_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s => %s"),
-								_pacman_pkg_getinfo(pkg, PM_PKG_NAME), _pacman_pkg_getinfo(pkg, PM_PKG_VERSION),
-								mod, dep->name, 
-								(equal ? "match" : "no match"));
-		}
-	}
-
-	return equal;
-}
hunk ./lib/libpacman/versioncmp.h 27
-int _pacman_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
}


More information about the Frugalware-darcs mailing list