summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-06-25 07:41:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-06-25 07:41:05 +0000
commit93e5aa64a231a1b8835c43719c0db8349303fbb3 (patch)
tree6f39d1f693d83b198d209bd37c7d952c41b0dcdb /usr.sbin/pkg_add/OpenBSD
parent228c5082b93c3cbed4938f8376bf7953c773c8e3 (diff)
pkgpath are only used for updates, so matching should only be pkgpath vs
default info, and not maximal matching, otherwise too many things will match. problem noticed by marco@ With input from sthen@ and tests from kili@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm14
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 26367230885..d617a2df104 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingList.pm,v 1.88 2009/04/19 14:58:32 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.89 2009/06/25 07:41:04 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -48,13 +48,8 @@ sub set_cwd
package OpenBSD::PackingList::hashpath;
sub match
{
- my ($a, $b) = @_;
- for my $i (keys %$a) {
- if ($b->{$i}) {
- return 1;
- }
- }
- return 0;
+ my ($h, $plist) = @_;
+ return $h->{$plist->{extrainfo}->{subdir}};
}
package OpenBSD::PackingList;
@@ -414,7 +409,8 @@ sub pkgpath
sub match_pkgpath
{
my ($self, $plist2) = @_;
- return $self->pkgpath->match($plist2->pkgpath);
+ return $self->pkgpath->match($plist2) ||
+ $plist2->pkgpath->match($self);
}
our @unique_categories =