summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingList.pm
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/pkg_add/OpenBSD/PackingList.pm
parentf284e3ff24ab1bda951d6eafa0e8fa0e61a2166e (diff)
a few more details so that infodirs become useful.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingList.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm17
1 files changed, 15 insertions, 2 deletions
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) = @_;