diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2013-12-25 14:20:49 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2013-12-25 14:20:49 +0000 |
commit | cc88090d0236126ba0ae03ce9c92ff66fc9ecee9 (patch) | |
tree | 05dcdee391e51873dd43317902b0a97a5ab4016e /usr.sbin/pkg_add/OpenBSD/Update.pm | |
parent | 1a6921b179ad98c44fa94b2a8e1dbeb0b3f5fed4 (diff) |
a bit more scaffolding for running quirks. In particular, once quirks
have been loaded, complain loudly if something doesn't work.
(and complain when quirks don't load in !verbose mode)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Update.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Update.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index 4300aa5f71d..3e69d1fb071 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.153 2012/10/13 10:28:22 jeremy Exp $ +# $OpenBSD: Update.pm,v 1.154 2013/12/25 14:20:48 espie Exp $ # # Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org> # @@ -89,9 +89,11 @@ sub process_handle } my $base = 0; - eval { - $base = $state->quirks->is_base_system($h, $state); - }; + $state->run_quirks( + sub { + my $quirks = shift; + $base = $quirks->is_base_system($h, $state); + }); if ($base) { $h->{update_found} = OpenBSD::Handle->system; $set->{updates}++; @@ -122,9 +124,11 @@ sub process_handle } push(@search, OpenBSD::Search::Stem->split($sname)); - eval { - $state->quirks->tweak_search(\@search, $h, $state); - }; + $state->run_quirks( + sub { + my $quirks = shift; + $quirks->tweak_search(\@search, $h, $state); + }); my $oldfound = 0; my @skipped_locs = (); |