summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-02 00:19:27 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-02 00:19:27 +0000
commitf1160d6118870a5bfba02d0a17d225fb990e720b (patch)
treed6d94de0d4d2d5e8a809a6abee58c2897df1fa63 /usr.sbin
parent816467db066c00d81289767c9bf453fb39de036f (diff)
don't try to validate_plist if not needed at all.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm17
1 files changed, 10 insertions, 7 deletions
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 <espie@openbsd.org>
#
@@ -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;