diff options
author | 2010-07-12 09:31:52 +0000 | |
---|---|---|
committer | 2010-07-12 09:31:52 +0000 | |
commit | 694902d2210983bcd2feb648d98679f72a3c0900 (patch) | |
tree | 02cdafc4ac18dde1a9444342438a5764aebec014 | |
parent | After forking, clear the 'thread joining this one' pointer in the child, (diff) | |
download | wireguard-openbsd-694902d2210983bcd2feb648d98679f72a3c0900.tar.xz wireguard-openbsd-694902d2210983bcd2feb648d98679f72a3c0900.zip |
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.
-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 $_; } |