Skip to content

Commit

Permalink
devel/pkgconf: fix regression introduced by last minute patch
Browse files Browse the repository at this point in the history
the last minute patch was intended to fix a bug in pkgconf which broke
the expected behaviour of cabal (haskell)

$ pkgconf --modversion atf-c atf-c++
0.21
0.21
0.21

due to bad pattern matching, the fix was a bit too harsh and broke the
version comparison
$ pkgconf --modversion "gtk+-2.0 >= 2.0.0"

Reported by:	cmt
  • Loading branch information
bapt committed Sep 2, 2023
1 parent 509505e commit 4a1614a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions devel/pkgconf/Makefile
@@ -1,5 +1,6 @@
PORTNAME= pkgconf
PORTVERSION= 2.0.2
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= devel
MASTER_SITES= https://distfiles.ariadne.space/${PORTNAME}/
Expand Down
12 changes: 9 additions & 3 deletions devel/pkgconf/files/patch-modversion-comparison
@@ -1,13 +1,19 @@
diff --git cli/main.c cli/main.c
index 25ff5ca..d75bbb7 100644
index 25ff5ca..055b05a 100644
--- cli/main.c
+++ cli/main.c
@@ -306,7 +306,7 @@ apply_modversion(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int
@@ -305,10 +305,13 @@ apply_modversion(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int
{
pkgconf_dependency_t *dep = world_iter->data;
pkgconf_pkg_t *pkg = dep->match;
+ size_t len = strlen(pkg->id);

- if (strncmp(pkg->id, queue_node->package, strlen(pkg->id)))
+ if (strcmp(pkg->id, queue_node->package))
+ if (strncmp(pkg->id, queue_node->package, len))
continue;

+ if (!isspace(queue_node->package[len]) && queue_node->package[len] != '\0')
+ continue;
if (pkg->version != NULL) {
if (verbosity)
printf("%s: ", pkg->id);

0 comments on commit 4a1614a

Please sign in to comment.