#9 Fix pkgconf --modversion output
Closed 2 days ago by petersen. Opened 3 months ago by ppisar.
rpms/ ppisar/pkgconf rawhide-bug2264921  into  rawhide

@@ -0,0 +1,52 @@ 

+ From 125af82dbe93eddadb7ec10eebac5087e9fbc451 Mon Sep 17 00:00:00 2001

+ From: Kai Pastor <dg0yt@darc.de>

+ Date: Fri, 1 Dec 2023 21:20:39 +0100

+ Subject: [PATCH 1/3] Test --modversion with constraint

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ Signed-off-by: Petr Písař <ppisar@redhat.com>

+ ---

+  tests/regress.sh | 21 +++++++++++++++++++++

+  1 file changed, 21 insertions(+)

+ 

+ diff --git a/tests/regress.sh b/tests/regress.sh

+ index 0c81415..bda3297 100755

+ --- a/tests/regress.sh

+ +++ b/tests/regress.sh

+ @@ -27,6 +27,9 @@ tests_init \

+  	modversion_fullpath \

+  	modversion_provides \

+  	modversion_uninstalled \

+ +	modversion_one_word_expression \

+ +	modversion_two_word_expression \

+ +	modversion_three_word_expression \

+  	pcpath \

+  	virtual_variable \

+  	fragment_collision \

+ @@ -301,3 +304,21 @@ modversion_uninstalled_body()

+  	atf_check -o inline:"1.2.3\n" \

+  		pkgconf --with-path="${selfdir}/lib1" --modversion omg

+  }

+ +

+ +modversion_one_word_expression_body()

+ +{

+ +	atf_check -o inline:"1.2.3\n" \

+ +		pkgconf --with-path="${selfdir}/lib1" --modversion "foo > 1.0"

+ +}

+ +

+ +modversion_two_word_expression_body()

+ +{

+ +	atf_check -o inline:"1.2.3\n" \

+ +		pkgconf --with-path="${selfdir}/lib1" --modversion foo "> 1.0"

+ +}

+ +

+ +modversion_three_word_expression_body()

+ +{

+ +	atf_check -o inline:"1.2.3\n" \

+ +		pkgconf --with-path="${selfdir}/lib1" --modversion foo ">" 1.0

+ +}

+ -- 

+ 2.44.0

+ 

@@ -0,0 +1,34 @@ 

+ From b2f8386c32d1cb4dfa8f51c619c0c2a56a3544d6 Mon Sep 17 00:00:00 2001

+ From: Kai Pastor <dg0yt@darc.de>

+ Date: Fri, 1 Dec 2023 21:50:46 +0100

+ Subject: [PATCH 2/3] Fix --modversion output

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ Signed-off-by: Petr Písař <ppisar@redhat.com>

+ ---

+  cli/main.c | 7 ++++++-

+  1 file changed, 6 insertions(+), 1 deletion(-)

+ 

+ diff --git a/cli/main.c b/cli/main.c

+ index 5583bb7..4e1e2d3 100644

+ --- a/cli/main.c

+ +++ b/cli/main.c

+ @@ -333,7 +333,12 @@ 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;

+  

+ -			if (strcmp(pkg->why, queue_node->package))

+ +			const size_t name_len = strlen(pkg->why);

+ +			if (name_len > strlen(queue_node->package) ||

+ +			    strncmp(pkg->why, queue_node->package, name_len) ||

+ +			    (queue_node->package[name_len] != 0 &&

+ +			     !isspace(queue_node->package[name_len]) &&

+ +			     !PKGCONF_IS_OPERATOR_CHAR(queue_node->package[name_len])))

+  				continue;

+  

+  			if (pkg->version != NULL) {

+ -- 

+ 2.44.0

+ 

@@ -0,0 +1,36 @@ 

+ From 5825e2c6d608ef74a97349e81d750ab95c53cf50 Mon Sep 17 00:00:00 2001

+ From: Kai Pastor <dg0yt@darc.de>

+ Date: Fri, 1 Dec 2023 22:12:20 +0100

+ Subject: [PATCH 3/3] Fix crash on two-word expressions

+ MIME-Version: 1.0

+ Content-Type: text/plain; charset=UTF-8

+ Content-Transfer-Encoding: 8bit

+ 

+ Signed-off-by: Petr Písař <ppisar@redhat.com>

+ ---

+  cli/main.c | 9 +++++++++

+  1 file changed, 9 insertions(+)

+ 

+ diff --git a/cli/main.c b/cli/main.c

+ index 4e1e2d3..ca8bf88 100644

+ --- a/cli/main.c

+ +++ b/cli/main.c

+ @@ -1405,6 +1405,15 @@ cleanup3:

+  			pkgconf_queue_push(&pkgq, package);

+  			pkg_optind++;

+  		}

+ +		else if (argv[pkg_optind + 2] == NULL)

+ +		{

+ +			char packagebuf[PKGCONF_BUFSIZE];

+ +

+ +			snprintf(packagebuf, sizeof packagebuf, "%s %s", package, argv[pkg_optind + 1]);

+ +			pkg_optind += 2;

+ +

+ +			pkgconf_queue_push(&pkgq, packagebuf);

+ +		}

+  		else

+  		{

+  			char packagebuf[PKGCONF_BUFSIZE];

+ -- 

+ 2.44.0

+ 

file modified
+13 -1
@@ -27,12 +27,21 @@ 

  

  Name:           pkgconf

  Version:        2.1.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Package compiler and linker metadata toolkit

  

  License:        ISC

  URL:            http://pkgconf.org/

  Source0:        https://distfiles.dereferenced.org/%{name}/%{name}-%{version}.tar.xz

+ # 1/3 Fix pkgconf --modversion output, bug #2264921, in upstream after 2.1.0,

+ # <https://github.com/pkgconf/pkgconf/pull/336>.

+ Patch0:         0001-Test-modversion-with-constraint.patch

+ # 2/3 Fix pkgconf --modversion output, bug #2264921, in upstream after 2.1.0,

+ # <https://github.com/pkgconf/pkgconf/pull/336>.

+ Patch1:         0002-Fix-modversion-output.patch

+ # 3/3 Fix pkgconf --modversion output, bug #2264921, in upstream after 2.1.0,

+ # <https://github.com/pkgconf/pkgconf/pull/336>.

+ Patch2:         0003-Fix-crash-on-two-word-expressions.patch

  

  # Simple wrapper scripts to offer platform versions of pkgconfig

  Source1:        platform-pkg-config.in
@@ -225,6 +234,9 @@ 

  

  

  %changelog

+ * Thu Feb 29 2024 Petr Pisar <ppisar@redhat.com> - 2.1.0-2

+ - Fix pkgconf --modversion output (bug #2264921)

+ 

  * Mon Feb 12 2024 Jens Petersen <petersen@redhat.com> - 2.1.0-1

  - update to 2.1.0

  - https://github.com/pkgconf/pkgconf/blob/pkgconf-2.1.0/NEWS

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2264921 which in turn fixed perl-ExtUtils-PkgConfig and building perl-Gnome2-VFS.
Please also apply to F40.

It might be better just to bump to 2.1.1?

Thanks - sorry this was obsoleted by #10

Pull-Request has been closed by petersen

2 days ago