From: George Koehler Subject: Re: pkg_create: @lib without LIBname_VERSION Cc: Marc Espie , Andrew Hewus Fresh , Stuart Henderson , ports@openbsd.org Date: Wed, 19 Nov 2025 00:00:19 -0500 On Tue, 18 Nov 2025 20:59:14 -0500 George Koehler wrote: > These ports have more than one '${LIB' and the regexp is matching the > wrong one. I guess that we need to count braces. Instead of counting braces, it is simpler to loop through the '${LIB' locations. Index: OpenBSD/PkgCreate.pm =================================================================== RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm,v diff -u -p -r1.200 PkgCreate.pm --- OpenBSD/PkgCreate.pm 15 Sep 2025 01:59:37 -0000 1.200 +++ OpenBSD/PkgCreate.pm 19 Nov 2025 04:49:35 -0000 @@ -769,17 +769,21 @@ sub id($self) package OpenBSD::PackingElement::Lib; sub check_version($self, $state, $unsubst) { - my @l = $self->parse($self->name); + $state->{has_libraries} = 1; + my @l = $self->parse($self->name); if (defined $l[0]) { - if (!$unsubst =~ m/\$\{LIB$l[0]_VERSION\}/) { - $state->error( - "Incorrectly versioned shared library: #1", - $unsubst); + while ($unsubst =~ m/\$\{LIB(.*?)\_VERSION\}$/g) { + my $name = $state->{subst}->do($1); + if ($name eq $l[0]) { + return; + } + pos($unsubst) = $-[1]; } + $state->error("Incorrectly versioned shared library: #1", + $unsubst); } else { $state->error("Invalid shared library #1", $unsubst); } - $state->{has_libraries} = 1; } package OpenBSD::PackingElement::DigitalSignature; @@ -1205,7 +1209,7 @@ sub read_fragments($self, $state, $plist # XXX some things, like @comment no checksum, don't produce an object my $o = &$cont($s); if (defined $o) { - $o->check_version($state, $s); + $o->check_version($state, $l); $self->annotate($o, $l, $file); } }