Almost the same patch I sent already, just cleaned build-debug-info
slightly to use PackingElement's primitives instead of directly printing
a line.

This solves the shearing problem and building debug packages for 7zip,
while keeping the normal rules for package naming.

Once this is in effect, we just need a few minor tweaks to pkg_add to cache
debug packages and such stuff.

The only issue here is to move existing debug-* packages installs to *-debug
instead, which is handled by this diff.



Index: devel/quirks/Makefile
===================================================================
RCS file: /build/data/openbsd/cvs/ports/devel/quirks/Makefile,v
diff -u -p -r1.1852 Makefile
--- devel/quirks/Makefile       8 Nov 2026 14:04:11 -0000       1.1852
+++ devel/quirks/Makefile       10 Nov 2026 17:31:09 -0000
@@ -3,7 +3,7 @@ CATEGORIES =    devel databases
 DISTFILES =
 
 # API.rev
-PKGNAME =      quirks-7.259
+PKGNAME =      quirks-7.260
 PKG_ARCH =     *
 MAINTAINER =   Marc Espie <[email protected]>
 
Index: devel/quirks/files/Quirks.pm
===================================================================
RCS file: /build/data/openbsd/cvs/ports/devel/quirks/files/Quirks.pm,v
diff -u -p -r1.1866 Quirks.pm
--- devel/quirks/files/Quirks.pm        8 Nov 2026 14:04:11 -0000       1.1866
+++ devel/quirks/files/Quirks.pm        10 Nov 2026 08:02:09 -0000
@@ -850,6 +850,12 @@ sub may_add_stems
 {
        my ($self, $object, $stem, $state) = @_;
 
+       # transparently update old debug names into new
+       my $dbg = $stem;
+       if ($dbg =~ s/^debug-(.*)/$1-debug/) {
+               $object->add_stem($dbg);
+       }
+
        my $extra = $stem_extensions->{$stem};
        if (defined $extra) {
                if (ref $extra) {
Index: infrastructure/bin/build-debug-info
===================================================================
RCS file: /build/data/openbsd/cvs/ports/infrastructure/bin/build-debug-info,v
diff -u -p -r1.51 build-debug-info
--- infrastructure/bin/build-debug-info 18 Oct 2026 10:39:09 -0000      1.51
+++ infrastructure/bin/build-debug-info 10 Nov 2026 17:28:22 -0000
@@ -269,7 +269,11 @@ for my $l (@{$self->{lists}}) {
        $name = $state->{pkgdir}."/".(basename $name);
        my $fh = $state->openfile($name);
        $self->{first_cwd} = 1;
-       $l->olist->write_debug_info($base, $fh, $self);
+
+       my $p = $l->olist;
+       OpenBSD::PackingElement::Conflict->new("debug-".
+           OpenBSD::PackageName::splitstem($p->pkgname)."-*")->write($fh);
+       $p->write_debug_info($base, $fh, $self);
        close($fh) or $state->fatal("Can't write plist: #1", $!);
        $self->warn_if_empty($state, $l);
 }
Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /build/data/openbsd/cvs/ports/infrastructure/mk/bsd.port.mk,v
diff -u -p -r1.1656 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       3 Nov 2026 17:39:42 -0000       1.1656
+++ infrastructure/mk/bsd.port.mk       10 Nov 2026 09:48:00 -0000
@@ -989,7 +989,7 @@ PKGFILES += ${PKGFILE${_s}}
 PKGPATHS += ${FULLPKGPATH${_s}}
 .  if ${DEBUG_PACKAGES:M${_s}}
 PKGFILES += ${_PKG_REPO}${_DBG_PKGFILE${_s}}
-PKGNAMES += debug-${FULLPKGNAME${_s}}
+PKGNAMES += ${FULLPKGNAME${_s}:C/(-[0-9])/-debug\1/}
 #PKGPATHS += debug/${FULLPKGPATH${_s}} # XXX sqlports doesn't like it
 .  endif 
 .endfor
@@ -1004,7 +1004,7 @@ PKGFILE = ${_PKG_REPO}${_PKGFILE${SUBPAC
 
 .for _S in ${MULTI_PACKAGES}
 _PKGFILE${_S} = ${FULLPKGNAME${_S}}.tgz
-_DBG_PKGFILE${_S} = debug-${_PKGFILE${_S}}
+_DBG_PKGFILE${_S} = ${_PKGFILE${_S}:C/(-[0-9])/-debug\1/}
 .  if ${PKG_ARCH${_S}} == "*"
 _PKG_REPO${_S} = ${_PKG_REPO_NO_ARCH}
 .  else

Reply via email to