From f1160d6118870a5bfba02d0a17d225fb990e720b Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 2 Dec 2004 00:19:27 +0000 Subject: don't try to validate_plist if not needed at all. --- usr.sbin/pkg_add/OpenBSD/Update.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index ef55872e2bd..c4e6e6cca73 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.37 2004/12/02 00:15:15 espie Exp $ +# $OpenBSD: Update.pm,v 1.38 2004/12/02 00:19:26 espie Exp $ # # Copyright (c) 2004 Marc Espie # @@ -257,12 +257,15 @@ sub can_do if ($state->{forced}->{updatedepends}) { $state->{okay} = 1; } - eval { - OpenBSD::Delete::validate_plist($plist, $state); - }; - if ($@) { - Warn "$@"; - return 0; + + if ($state->{okay}) { + eval { + OpenBSD::Delete::validate_plist($plist, $state); + }; + if ($@) { + Warn "$@"; + return 0; + } } $plist->{wantlist} = \@wantlist; -- cgit v1.2.3