summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-29 13:00:18 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-29 13:00:18 +0000
commit507a0e6b427f71f9fa70f4335bbf2e551c575e46 (patch)
tree5aaf69ff247989edfc8dd088238d352d325f3c33 /usr.sbin
parentf284e3ff24ab1bda951d6eafa0e8fa0e61a2166e (diff)
a few more details so that infodirs become useful.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm9
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm17
2 files changed, 22 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 683cbe64bcd..89687a787d0 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.116 2007/05/29 12:36:53 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.117 2007/05/29 13:00:17 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -1260,7 +1260,12 @@ sub add
sub fullname
{
my $self = shift;
- return $self->infodir.'/'.$self->category;
+ my $d = $self->infodir;
+ if (defined $d) {
+ return $d.$self->category;
+ } else {
+ return undef;
+ }
}
package OpenBSD::PackingElement::FCONTENTS;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 032a5a2aa53..996895759d1 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.67 2007/05/29 12:36:53 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.68 2007/05/29 13:00:17 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -61,10 +61,17 @@ sub new
sub set_infodir
{
- my ($self, $dir) = shift;
+ my ($self, $dir) = @_;
+ $dir .= '/' unless $dir =~ m/\/$/;
${$self->{infodir}} = $dir;
}
+sub infodir
+{
+ my $self = shift;
+ return ${$self->{infodir}}
+}
+
sub read
{
my ($a, $u, $code) = @_;
@@ -276,6 +283,12 @@ sub tofile
return 1;
}
+sub save
+{
+ my $self = shift;
+ $self->tofile($self->infodir.CONTENTS);
+}
+
sub add2list
{
my ($plist, $object) = @_;