put "stub" within grasp of -DREGRESSION_TESTING.
authorespie <espie@openbsd.org>
Wed, 11 Oct 2023 13:54:43 +0000 (13:54 +0000)
committerespie <espie@openbsd.org>
Wed, 11 Oct 2023 13:54:43 +0000 (13:54 +0000)
Extend it slightly: do not stub quirks, so that caching mechanisms work
as usual even when using stubs.

regress/usr.sbin/pkg_add/Makefile
usr.sbin/pkg_add/OpenBSD/Add.pm
usr.sbin/pkg_add/OpenBSD/Delete.pm
usr.sbin/pkg_add/OpenBSD/PkgCreate.pm

index 33fbd71..8446287 100644 (file)
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.87 2023/10/06 06:00:18 espie Exp $
+# $OpenBSD: Makefile,v 1.88 2023/10/11 13:54:43 espie Exp $
 
 REGRESS_TARGETS=pkgnames pkgpaths signatures depends-check longnames pkgcfl \
        collision-check1 collision-check2 collision-check3 \
@@ -25,6 +25,8 @@ REGRESS_EXPECTED_FAILURES = collision-check1 collision-check2 \
 PERLSCRIPT = perl -I ${.CURDIR} ${.CURDIR}
 
 WAVE_PLIST=-DREGRESSION_TESTING=plist_checks
+STUB=-DREGRESSION_TESTING=stub
+WAVE_PLIST_STUB=-DREGRESSION_TESTING=plist_checks,stub
 
 ADD_PKG = ${PERLSCRIPT}/my add -Dchecksum
 DELETE_PKG = ${PERLSCRIPT}/my delete -Dchecksum
@@ -591,21 +593,21 @@ rep1/ol-1.tgz: plist21
 CUPS_FILES += rep2/$o.tgz
 rep2/$o.tgz: ${.CURDIR}/oldcups/$o/+CONTENTS
        mkdir -p rep2
-       cd rep2 && pkg_create ${WAVE_PLIST} -Dstub -f ${.CURDIR}/oldcups/$o/+CONTENTS
+       cd rep2 && pkg_create ${WAVE_PLIST_STUB} -f ${.CURDIR}/oldcups/$o/+CONTENTS
 .endfor
 
 .for n in cups-2.2.8 cups-filters-1.20.3 cups-libs-2.2.8 ghostscript-9.07p7
 CUPS_FILES += rep3/$n.tgz
 rep3/$n.tgz: ${.CURDIR}/newcups/$n/+CONTENTS
        mkdir -p rep3
-       cd rep3 && pkg_create ${WAVE_PLIST} -Dstub -f ${.CURDIR}/newcups/$n/+CONTENTS
+       cd rep3 && pkg_create ${WAVE_PLIST_STUB} -f ${.CURDIR}/newcups/$n/+CONTENTS
 .endfor
 
 cups-bug: ${CUPS_FILES}
        rm -rf ${D36}
        mkdir -p ${D36}/vardbpkg ${D36}/usr/local
-       ROOT=${D36} PKG_PATH=${.OBJDIR}/rep2 INJECT=inject-order ${ADD_PKG} -Dstub cups
-       ROOT=${D36} PKG_PATH=${.OBJDIR}/rep3 INJECT=inject-order ${ADD_PKG} -Dstub -u
+       ROOT=${D36} PKG_PATH=${.OBJDIR}/rep2 INJECT=inject-order ${ADD_PKG} ${STUB} cups
+       ROOT=${D36} PKG_PATH=${.OBJDIR}/rep3 INJECT=inject-order ${ADD_PKG} ${STUB} -u
 
 usertest-1:
        @if ${CREATE_PKG} -u ${.CURDIR}/baduser1 \
index 8804c61..9c05b65 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.195 2023/06/13 09:07:16 espie Exp $
+# $OpenBSD: Add.pm,v 1.196 2023/10/11 13:54:43 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -91,7 +91,7 @@ sub record_partial_installation($plist, $state, $h)
 
 sub perform_installation($handle, $state)
 {
-       return if $state->defines('stub');
+       return if $state->{regression}{stub} && $handle->pkgname !~ /^quirks\-/;
 
        $state->{partial} = $handle->{partial};
        $state->progress->visit_with_size($handle->{plist}, 'install');
@@ -122,7 +122,7 @@ sub skip_to_the_end($handle, $state, $tied, $p)
 
 sub perform_extraction($handle, $state)
 {
-       return if $state->defines('stub');
+       return if $state->{regression}{stub} && $handle->pkgname !~ /^quirks\-/;
 
        $handle->{partial} = {};
        $state->{partial} = $handle->{partial};
@@ -444,7 +444,7 @@ sub prepare_for_addition($self, $state, $pkgname, $)
                $state->{problems}++;
                return;
        }
-       return if $state->defines('stub');
+       return if $state->{regression}{stub} && $pkgname !~ /^quirks\-/;
        my $s = $state->vstat->add($fname, 
            $self->{tieto} ? 0 : $self->retrieve_size, $pkgname);
        return unless defined $s;
index e118784..17239fa 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.168 2023/06/13 09:07:17 espie Exp $
+# $OpenBSD: Delete.pm,v 1.169 2023/10/11 13:54:43 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -121,7 +121,7 @@ sub delete_plist($plist, $state)
 {
        my $pkgname = $plist->pkgname;
        $state->{pkgname} = $pkgname;
-       if (!$state->defines('stub')) {
+       if (!$state->{regression}{stub} || $pkgname =~ /^quirks\-/) {
                if (!$state->{size_only}) {
                        $plist->register_manpage($state, 'rmman');
                        manpages_unindex($state);
index 402d015..ff6a89c 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 # ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.196 2023/10/07 09:09:07 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.197 2023/10/11 13:54:43 espie Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -1632,7 +1632,7 @@ sub run_command($self, $state)
        unless (defined $state->opt('q') && defined $state->opt('n')) {
                $state->set_status("checking dependencies");
                $self->check_dependencies($plist, $state);
-               if ($state->defines("stub")) {
+               if ($state->{regression}{stub}) {
                        $plist->stub_digest($ordered);
                } else {
                        $state->set_status("checksumming");