From 6e815952c9011a31d67ad2fc07b77be3a996cf44 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 15 Mar 2022 08:12:53 +0000 Subject: [PATCH] if we pass exact pkg args, just check that their files are there instead of the full pkgtree, useful for debug --- usr.sbin/pkg_add/OpenBSD/PkgCheck.pm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index 5257fa6de21..eeba23a8aa3 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.75 2022/03/13 13:28:09 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.76 2022/03/15 08:12:53 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1087,14 +1087,21 @@ sub run { my ($self, $state) = @_; - my @list = installed_packages(); - $self->sanity_check($state, \@list); - $self->dependencies_check($state, \@list); + my $list = [installed_packages()]; + + my $list2; + if (@ARGV != 0) { + $list2 = \@ARGV; + } else { + $list2 = $list; + } + $self->sanity_check($state, $list); + $self->dependencies_check($state, $list); $state->log->dump; - $self->reverse_dependencies_check($state, \@list); + $self->reverse_dependencies_check($state, $list); $state->log->dump; if ($state->{quick} < 2) { - $self->package_files_check($state, \@list); + $self->package_files_check($state, $list2); $state->log->dump; } if ($state->{filesystem}) { @@ -1109,9 +1116,6 @@ sub parse_and_run my $state = OpenBSD::PkgCheck::State->new($cmd); $state->handle_options; - if (@ARGV != 0) { - $state->usage; - } lock_db(0, $state) unless $state->{subst}->value('nolock'); $self->run($state); return 0; -- 2.20.1