From c6559b87f49b67d161e82beae245d1e9fc5ab280 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 8 Dec 2013 12:14:42 +0000 Subject: also cover initial installations (which means we do try to install quirks even for initial installations) --- usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 10 ++++++++-- usr.sbin/pkg_add/OpenBSD/Handle.pm | 6 +++++- usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 6 ++---- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'usr.sbin/pkg_add') diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index e8fcb0393b0..703c8d1f75e 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.54 2012/07/06 12:02:50 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.55 2013/12/08 12:14:41 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie # @@ -318,7 +318,13 @@ sub choose_location { my ($state, $name, $list, $is_quirks) = @_; if (@$list == 0) { - $state->errsay("Can't find #1", $name) unless $is_quirks; + if (!$is_quirks) { + $state->errsay("Can't find #1", $name); + eval { + my $r = [$name]; + $state->quirks->filter_obsolete($r, $state); + } + } return undef; } elsif (@$list == 1) { return $list->[0]; diff --git a/usr.sbin/pkg_add/OpenBSD/Handle.pm b/usr.sbin/pkg_add/OpenBSD/Handle.pm index 2a8cfb83b19..67a7d2b51e3 100644 --- a/usr.sbin/pkg_add/OpenBSD/Handle.pm +++ b/usr.sbin/pkg_add/OpenBSD/Handle.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Handle.pm,v 1.30 2012/04/28 11:53:53 espie Exp $ +# $OpenBSD: Handle.pm,v 1.31 2013/12/08 12:14:41 espie Exp $ # # Copyright (c) 2007-2009 Marc Espie # @@ -240,6 +240,10 @@ sub get_location $state); if (!$handle->{tweaked}) { $state->say("Can't find #1", $name); + eval { + my $r = [$name]; + $state->quirks->filter_obsolete($r, $state); + } } return; } diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index 5b97e298c5a..ab949571d70 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgAdd.pm,v 1.36 2013/12/08 12:04:13 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.37 2013/12/08 12:14:41 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie # @@ -1129,9 +1129,7 @@ sub main my ($self, $state) = @_; $state->progress->set_header(''); - if ($state->{allow_replacing}) { - $self->do_quirks($state); - } + $self->do_quirks($state); $self->process_setlist($state); } -- cgit v1.2.3