Do the right thing if we have a version but no constraint.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Nov 2009 06:35:38 +0000 (06:35 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 24 Nov 2009 06:35:38 +0000 (06:35 +0000)
The package maintainer shouldn't do this, but it happens ocassionally.

git-svn-id: http://opkg.googlecode.com/svn/trunk@362 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/pkg_depends.c

index 813ec6a..998d085 100644 (file)
@@ -726,7 +726,7 @@ pkg_depend_str(pkg_t *pkg, int index)
 
                len += strlen(dep->pkg->name);
 
 
                len += strlen(dep->pkg->name);
 
-               if (dep->constraint != NONE) {
+               if (dep->version) {
                        len += 2; /* space, left parenthesis */
                        len += 3; /* constraint string (<=, >=, etc), space */
                        len += strlen(dep->version);
                        len += 2; /* space, left parenthesis */
                        len += 3; /* constraint string (<=, >=, etc), space */
                        len += strlen(dep->version);
@@ -745,7 +745,7 @@ pkg_depend_str(pkg_t *pkg, int index)
 
                strncat(str, dep->pkg->name, len);
 
 
                strncat(str, dep->pkg->name, len);
 
-               if (dep->constraint != NONE) {
+               if (dep->version) {
                        strncat(str, " (", len);
                        strncat(str, constraint_to_str(dep->constraint), len);
                        strncat(str, dep->version, len);
                        strncat(str, " (", len);
                        strncat(str, constraint_to_str(dep->constraint), len);
                        strncat(str, dep->version, len);