diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-07-12 09:31:53 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-07-12 09:31:53 +0000 |
commit | b997a0110a276cb9cb3a23804191536d5b7c9c6f (patch) | |
tree | d9b99131d6e4401adbf9ce355fcc57413a45b161 /usr.sbin/pkg_add/OpenBSD | |
parent | 971aa48330d3361114925751a573a33219869738 (diff) |
need to copy f() parameters, otherwise strange bugs with sub expressions
may occur (bug in locality in @_ ?)
Add missing bagage to State.pm to be able to interact directly with
Makewhatis, later.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 21 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/State.pm | 8 |
2 files changed, 24 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 330e680d648..9e8d172cc23 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.36 2010/07/09 12:42:43 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.37 2010/07/12 09:31:52 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -317,6 +317,25 @@ sub updateset_from_location OpenBSD::Handle->from_location($location)); } +# those are required for makewhatis integration +sub picky +{ + return shift->{picky}; +} + +sub testmode +{ + return shift->{testmode}; +} + +sub check_dir +{ + my ($self, $dir) = @_; + unless (-d $dir) { + $self->fatal("#1: #2 is not a directory", $0, $dir); + } +} + # the object that gets displayed during status updates package OpenBSD::Status; diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm index 46ed107403c..a0fa40164d0 100644 --- a/usr.sbin/pkg_add/OpenBSD/State.pm +++ b/usr.sbin/pkg_add/OpenBSD/State.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: State.pm,v 1.14 2010/07/09 12:42:43 espie Exp $ +# $OpenBSD: State.pm,v 1.15 2010/07/12 09:31:52 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -225,10 +225,10 @@ sub f if (@_ == 0) { return undef; } - my $_ = shift; + my ($_, @l) = @_; # make it so that #0 is # - unshift(@_, '#'); - s/\#(\d+)/$_[$1]/ge; + unshift(@l, '#'); + s/\#(\d+)/$l[$1]/ge; return $_; } |