summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-29 12:36:54 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-29 12:36:54 +0000
commitf284e3ff24ab1bda951d6eafa0e8fa0e61a2166e (patch)
tree84aa1cc25606c7f509a912f9611ed37448b20b5d /usr.sbin/pkg_add/OpenBSD/PackingElement.pm
parent78cb5feddc850e7836e94dd8c3b1b50eef39bbfb (diff)
clean-up SpecialFile a bit: make sure the name passed during creation is
totally irrelevant. Add a new property to packing-lists: infodir, and use it to compute fullnames for special files. Once this is properly synchronized, we can tie infodir to packing-lists, and remove it from the state...
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 011450cc9e1..683cbe64bcd 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.115 2007/05/29 10:56:22 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.116 2007/05/29 12:36:53 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -1231,6 +1231,38 @@ sub write
&OpenBSD::PackingElement::FileBase::write;
}
+sub add_object
+{
+ my ($self, $plist) = @_;
+ $self->{infodir} = $plist->{infodir};
+ $self->SUPER::add_object($plist);
+}
+
+sub infodir
+{
+ my $self = shift;
+ return ${$self->{infodir}};
+}
+
+sub stringize
+{
+ my $self = shift;
+ return $self->category;
+}
+
+sub add
+{
+ my ($class, $plist, @args) = @_;
+
+ $class->SUPER::add($plist, $class->category);
+}
+
+sub fullname
+{
+ my $self = shift;
+ return $self->infodir.'/'.$self->category;
+}
+
package OpenBSD::PackingElement::FCONTENTS;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
sub category() { OpenBSD::PackageInfo::CONTENTS }