From d6425245cb6e8bb18968b87edab8e071f7534ef0 Mon Sep 17 00:00:00 2001 From: espie Date: Wed, 11 Oct 2023 13:54:43 +0000 Subject: [PATCH] put "stub" within grasp of -DREGRESSION_TESTING. Extend it slightly: do not stub quirks, so that caching mechanisms work as usual even when using stubs. --- regress/usr.sbin/pkg_add/Makefile | 12 +++++++----- usr.sbin/pkg_add/OpenBSD/Add.pm | 8 ++++---- usr.sbin/pkg_add/OpenBSD/Delete.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/regress/usr.sbin/pkg_add/Makefile b/regress/usr.sbin/pkg_add/Makefile index 33fbd716c6f..84462872909 100644 --- a/regress/usr.sbin/pkg_add/Makefile +++ b/regress/usr.sbin/pkg_add/Makefile @@ -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 \ diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 8804c610747..9c05b65a3aa 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -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 # @@ -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; diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index e118784eacd..17239fadf98 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -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 # @@ -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); diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 402d015142b..ff6a89c12dd 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm @@ -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 # @@ -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"); -- 2.20.1