Index | Thread | Search

From:
Andrew Hewus Fresh <andrew@afresh1.com>
Subject:
Re: pkg_create: @lib without LIBname_VERSION
To:
George Koehler <kernigh@gmail.com>, Stuart Henderson <stu@spacehopper.org>, ports@openbsd.org
Date:
Tue, 25 Nov 2025 10:57:02 -0800

Download raw body.

Thread
  • Marc Espie:

    pkg_create: @lib without LIBname_VERSION

  • On Tue, Nov 25, 2025 at 09:41:36AM +0100, Marc Espie wrote:
    > On Mon, Nov 24, 2025 at 08:10:07PM -0800, Andrew Hewus Fresh wrote:
    > > On Mon, Nov 24, 2025 at 08:11:21PM -0500, George Koehler wrote:
    > > > I'm looking for oks for this pkg_create diff (from espie, with the
    > > > \Q$k\E fix).  After jca committed libtalloc on Friday, I can't find
    > > > any other ports that would break.  (One can find these ports with
    > > > "make print-plist-all" or databases/pkglocatedb.)  I built only a few
    > > > ports.  It works with both perl 5.40.1 and 5.42.0.
    > > 
    > > 
    > > I am fairly sure I follow the logic here and it makes sense to me.  I
    > > say OK, but definitely would want to hear from espie@ for reasons there
    > > might be a better solution.
    > 
    > It is basically *my patch* with the obvious \Q\E addition (I had forgotten
    > about libestdc++ addition)
    
    Wow, I looked again and my mail client says I read that message, but
    somehow I forgot completely about changes to Subst->do.
    
    In any case, I like it and thank you.  :-)
    
     
    > > 
    > >  
    > > > To recap, the diff prevents a warning in 5.42 from "!$x =~ m/y/", and
    > > > requires that every @lib in a plist has its ${LIBname_VERSION}.
    > > > --gkoehler
    > > > 
    > > > 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	23 Nov 2025 00:35:15 -0000
    > > > @@ -771,11 +771,13 @@ sub check_version($self, $state, $unsubs
    > > >  {
    > > >  	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);
    > > > +		my $k = "LIB$l[0]_VERSION";
    > > > +		my $r = $state->{subst}->do($unsubst, $k);
    > > > +		if ($r =~ m/\blib\Q$l[0]\E\.so\.\$\{\Q$k\E\}$/) {
    > > > +			return;
    > > >  		}
    > > > +		$state->error("Incorrectly versioned shared library: #1", 
    > > > +		    $unsubst);
    > > >  	} else {
    > > >  		$state->error("Invalid shared library #1", $unsubst);
    > > >  	}
    > > > @@ -1205,7 +1207,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);
    > > >  				}
    > > >  			}
    > > > Index: OpenBSD/Subst.pm
    > > > ===================================================================
    > > > RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Subst.pm,v
    > > > diff -u -p -r1.27 Subst.pm
    > > > --- OpenBSD/Subst.pm	27 May 2025 03:42:59 -0000	1.27
    > > > +++ OpenBSD/Subst.pm	23 Nov 2025 00:35:15 -0000
    > > > @@ -63,11 +63,14 @@ sub parse_option($self, $opt)
    > > >  	}
    > > >  }
    > > >  
    > > > -sub do($self, $s)
    > > > +sub do($self, $s, $without = undef)
    > > >  {
    > > >  	return $s unless $s =~ m/\$/o;	# no need to subst if no $
    > > >  	while ( my $k = ($s =~ m/\$\{([A-Za-z_][^\}]*)\}/o)[0] ) {
    > > >  		my $v = $self->{$k};
    > > > +		if (defined $without && $without eq $k) {
    > > > +			$v = undef;
    > > > +		}
    > > >  		unless ( defined $v ) { $v = "\$\\\{$k\}"; }
    > > >  		$s =~ s/\$\{\Q$k\E\}/$v/g;
    > > >  	}
    > > 
    > > -- 
    > > andrew
    > > 
    > > I think I understand, but my stubborn brain refuses to admit it
    > > until I beat it into submission by proof upon proof.
    > >                       -- Michael Shiloh <michaelshiloh1010@gmail.com>
    > > 
    > 
    
    -- 
    andrew
    
    I think I understand, but my stubborn brain refuses to admit it
    until I beat it into submission by proof upon proof.
                          -- Michael Shiloh <michaelshiloh1010@gmail.com>
    
    
  • Marc Espie:

    pkg_create: @lib without LIBname_VERSION