summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2011-06-01 11:20:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2011-06-01 11:20:05 +0000
commite26c50b5deecc1c55855563b6738a437aa86c78b (patch)
treef0b6e9e7b469efab7701efb4c1a955532abfcde5 /usr.sbin
parentc74316b0335224c68762624ed9fc6bf459ea8ce9 (diff)
repaire pkg_info -P in the simplest possible way, pending revisit.
(problem noticed by Nigel Taylor)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 48f0c59a38c..0f901572c62 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.112 2011/05/30 09:59:38 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.113 2011/06/01 11:20:04 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -49,7 +49,7 @@ package OpenBSD::PackingList::hashpath;
sub match
{
my ($h, $plist) = @_;
- my $f = $plist->fullpkgpath;
+ my $f = $plist->fullpkgpath2;
if (!defined $f) {
return 0;
}
@@ -450,18 +450,29 @@ sub fullpkgpath
{
my $self = shift;
if (defined $self->{extrainfo} && $self->{extrainfo}->{subdir} ne '') {
+ return $self->{extrainfo}->{subdir};
+ } else {
+ return undef;
+ }
+}
+
+sub fullpkgpath2
+{
+ my $self = shift;
+ if (defined $self->{extrainfo} && $self->{extrainfo}->{subdir} ne '') {
return $self->{extrainfo}->{path};
} else {
return undef;
}
}
+
sub pkgpath
{
my $self = shift;
if (!defined $self->{_hashpath}) {
my $h = $self->{_hashpath} =
bless {}, "OpenBSD::PackingList::hashpath";
- my $f = $self->fullpkgpath;
+ my $f = $self->fullpkgpath2;
if (defined $f) {
push(@{$h->{$f->{dir}}}, $f);
}