summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingList.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-01 16:09:36 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-01 16:09:36 +0000
commit562c7e820cc7a44384cb81835b995a6e162ca47c (patch)
tree67f54514004e48408da8bc658a14b24757ac999e /usr.sbin/pkg_add/OpenBSD/PackingList.pm
parent3b9a3f52ac621c498c38c580f9342336ab41400b (diff)
new method fullpkgpath that accesses the default fullpkgpath.
make use of it, relax pkg_create to allow any of FULLPKGPATH, PERMIT_PACKAGE_FTP, PERMIT_PACKAGE_CDROM (store the others as empty). remove warning in pkg_mklocatedb for newer perl.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingList.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 4e7a3fa1c97..86cafbdfc4f 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.97 2010/01/01 13:36:07 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.98 2010/01/01 16:09:35 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -50,8 +50,8 @@ sub match
{
my ($h, $plist) = @_;
return
- defined $plist->{extrainfo} &&
- $h->{$plist->{extrainfo}->{subdir}};
+ defined $plist->fullpkgpath &&
+ $h->{$plist->fullpkgpath};
}
package OpenBSD::PackingList;
@@ -412,14 +412,23 @@ sub is_signed
return defined $self->{'digital-signature'};
}
+sub fullpkgpath
+{
+ my $self = shift;
+ if (defined $self->{extrainfo} && $self->{extrainfo}->{subdir} ne '') {
+ return $self->{extrainfo}->{subdir};
+ } else {
+ return undef;
+ }
+}
sub pkgpath
{
my $self = shift;
if (!defined $self->{_hashpath}) {
my $h = $self->{_hashpath} =
bless {}, "OpenBSD::PackingList::hashpath";
- if (defined $self->{extrainfo}) {
- $h->{$self->{extrainfo}->{subdir}} = 1;
+ if (defined $self->fullpkgpath) {
+ $h->{$self->fullpkgpath} = 1;
}
if (defined $self->{pkgpath}) {
for my $i (@{$self->{pkgpath}}) {