Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
Re: pkg_create: @lib without LIBname_VERSION
To:
George Koehler <kernigh@gmail.com>
Cc:
Andrew Hewus Fresh <andrew@afresh1.com>, Stuart Henderson <stu@spacehopper.org>, ports@openbsd.org
Date:
Thu, 20 Nov 2025 09:52:07 +0100

Download raw body.

Thread
On Thu, Nov 20, 2025 at 01:23:57AM -0500, George Koehler wrote:
> On Tue, 18 Nov 2025 22:17:49 -0800 (PST)
> Andrew Hewus Fresh <andrew@afresh1.com> wrote:
> 
> > How does that work with
> > 
> > @lib
> > lib/libfoo${API_VERSION}.so.${LIBfoo${API_VERSION}_VERSION}
> > 
> > Nov 18, 2025 21:00:25 George Koehler <kernigh@gmail.com>:
> > 
> > > +       while ($unsubst =~ m/\$\{LIB(.*?)\_VERSION\}$/g) {
> > > +           my $name = $state->{subst}->do($1);
> > > +           if ($name eq $l[0]) {
> > > +               return;
> > > +           }
> > > +           pos($unsubst) = $-[1];
> 
> It works only because the anchor $ forces it to match the '_VERSION}'
> at the end of the line.
> 
> Your code using Text::Balanced might be better.
> 

I'll have a closer look tonight, there are lots of other ways to do things.

The best way might be simply to make a specialized subst erasing the
LIB*_VERSION variables and use that.