diff options
author | 2007-05-12 13:36:54 +0000 | |
---|---|---|
committer | 2007-05-12 13:36:54 +0000 | |
commit | e6654d40d1698bb37c9697127d4ffefc5c18ffad (patch) | |
tree | b05b6d118825d0f8a14c07ad2b617c992c3206ec | |
parent | Use VNDLABELDEV() and not DISKLABELDEV() in writedisklabel() since (diff) | |
download | wireguard-openbsd-e6654d40d1698bb37c9697127d4ffefc5c18ffad.tar.xz wireguard-openbsd-e6654d40d1698bb37c9697127d4ffefc5c18ffad.zip |
pass refs around instead of extending them.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgSpec.pm | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 652f23fdb00..73c93030579 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.20 2007/05/08 08:44:17 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.21 2007/05/12 13:36:54 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -69,7 +69,7 @@ sub match_spec { my ($self, $spec) = @_; require OpenBSD::PkgSpec; - return OpenBSD::PkgSpec::match($spec, @{$self->list}); + return OpenBSD::PkgSpec::match_ref($spec, $self->list); } sub wipe_info diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm index 498965ab498..320725895f1 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgSpec.pm,v 1.3 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: PkgSpec.pm,v 1.4 2007/05/12 13:36:54 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -210,15 +210,21 @@ sub subpattern_match return @result; } -sub match +sub match_ref { - my ($pattern, @list) = @_; + my ($pattern, $r) = @_; my @l = (); for my $subpattern (split /\|/, $pattern) { - push(@l, subpattern_match($subpattern, \@list)); + push(@l, subpattern_match($subpattern, $r)); } return @l; } +sub match +{ + my ($pattern, @list) = @_; + return match_ref($pattern, \@list); +} + 1; |