From 56038fa2d2611b902f4abd05056420525904463d Mon Sep 17 00:00:00 2001 From: gkoehler Date: Sun, 11 Feb 2024 03:57:10 +0000 Subject: [PATCH] In pkg-config, accept both "CFlags:" and "Cflags:" matthieu@ noticed that "pkg-config libpkgconf --cflags" failed because libpkgconf.pc has "CFlags:" with upper-case 'F', but we accepted only "Cflags:" with lower-case 'f'. freedesktop.org's pkg-config accepts both "C[Ff]lags", but is otherwise sensitive to case. Accept "CFlags" by mapping it to "Cflags" when reading the file. Fail if the file has more than one "C[Ff]lags". ok millert@ matthieu@ --- usr.bin/pkg-config/OpenBSD/PkgConfig.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/pkg-config/OpenBSD/PkgConfig.pm b/usr.bin/pkg-config/OpenBSD/PkgConfig.pm index e7ae82344c4..89d36f37b15 100644 --- a/usr.bin/pkg-config/OpenBSD/PkgConfig.pm +++ b/usr.bin/pkg-config/OpenBSD/PkgConfig.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgConfig.pm,v 1.11 2023/09/22 07:29:14 espie Exp $ +# $OpenBSD: PkgConfig.pm,v 1.12 2024/02/11 03:57:10 gkoehler Exp $ # # Copyright (c) 2006 Marc Espie # @@ -86,6 +86,9 @@ sub parse_value($self, $name, $value) sub add_property($self, $name, $value) { + if ($name eq "CFlags") { + $name = "Cflags"; + } if (defined $self->{properties}{$name}) { die "Duplicate property $name"; } -- 2.20.1