summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-05 14:41:04 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-05 14:41:04 +0000
commitfba0dda9739506c2fe86cf73de13545e12196b36 (patch)
tree37673c5e388c669550bbec4f5c029c6d7a918fa9 /usr.sbin
parenteadd0a99315a93ed1462bed47ea768af96e1f6cf (diff)
use eval {} everywhere around quirks.
also, remove quirks from the list of packages to update, since it deserves special treatment...
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm12
-rw-r--r--usr.sbin/pkg_add/pkg_add9
2 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index ec501696dd1..54c78f90850 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.111 2009/12/05 10:54:11 espie Exp $
+# $OpenBSD: Update.pm,v 1.112 2009/12/05 14:41:03 espie Exp $
#
# Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org>
#
@@ -88,12 +88,12 @@ sub process_handle
}
- if ($state->quirks) {
+ eval {
if ($state->quirks->is_base_system($h, $state)) {
$h->{update_found} = 1;
- return 1;
}
- }
+ };
+ return 1 if $h->{update_found};
my $plist = OpenBSD::PackingList->from_installation($pkgname,
\&OpenBSD::PackingList::UpdateInfoOnly);
@@ -104,9 +104,9 @@ sub process_handle
my @search = ();
push(@search, OpenBSD::Search::Stem->split($pkgname));
- if ($state->quirks) {
+ eval {
$state->quirks->tweak_search(\@search, $h, $state);
- }
+ };
my $found;
my $oldfound = 0;
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index a8ab900a2bc..df6a27f761a 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.415 2009/12/05 11:19:43 espie Exp $
+# $OpenBSD: pkg_add,v 1.416 2009/12/05 14:41:03 espie Exp $
#
# Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org>
#
@@ -719,7 +719,7 @@ sub do_quirks
require OpenBSD::Quirks;
# interface version number.
$state->{quirks} = OpenBSD::Quirks->new(1);
- }
+ };
}
sub process_parameters
{
@@ -763,6 +763,7 @@ sub process_parameters
# actual names
my $m = $opt_z ? "add_hints" : "add_hints2";
for my $pkgname (@ARGV) {
+ next if $pkgname =~ m/^quirks\-\d/;
push(@todo2, OpenBSD::UpdateSet->new->$m($pkgname));
}
}
@@ -805,9 +806,9 @@ sub {
$state->progress->set_header("Looking for packages");
$state->{todo} = scalar @todo2;
unshift(@todo2, install_set($set, $state));
- if ($state->quirks) {
+ eval {
$state->quirks->tweak_list(\@todo2, $state);
- }
+ };
}
});