# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.215 2013/12/31 11:21:10 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.216 2014/01/02 20:13:43 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
return $self->category;
}
-sub add
-{
- my ($class, $plist, @args) = @_;
-
- $class->SUPER::add($plist, $class->category);
-}
-
sub fullname
{
my $self = shift;
my $d = $self->infodir;
if (defined $d) {
- return $d.$self->category;
+ return $d.$self->name;
} else {
return undef;
}
}
+sub category
+{
+ my $self = shift;
+
+ return $self->name;
+}
+
+sub new
+{
+ &OpenBSD::PackingElement::UniqueOption::new;
+}
+
package OpenBSD::PackingElement::FCONTENTS;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
-sub category() { OpenBSD::PackageInfo::CONTENTS }
+sub name() { OpenBSD::PackageInfo::CONTENTS }
# XXX we don't write `self'
sub write
{}
package OpenBSD::PackingElement::FCOMMENT;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
-sub category() { OpenBSD::PackageInfo::COMMENT }
+sub name() { OpenBSD::PackageInfo::COMMENT }
+
+sub new
+{
+ my ($self, @r) = @_;
+ print STDERR "Warning: obsolete special file: +COMMENT\n";
+ $self->SUPER::new(@r);
+}
package OpenBSD::PackingElement::FDESC;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
-sub category() { OpenBSD::PackageInfo::DESC }
+sub name() { OpenBSD::PackageInfo::DESC }
package OpenBSD::PackingElement::DisplayFile;
our @ISA=qw(OpenBSD::PackingElement::SpecialFile);
package OpenBSD::PackingElement::FDISPLAY;
our @ISA=qw(OpenBSD::PackingElement::DisplayFile);
-sub category() { OpenBSD::PackageInfo::DISPLAY }
+sub name() { OpenBSD::PackageInfo::DISPLAY }
package OpenBSD::PackingElement::FUNDISPLAY;
our @ISA=qw(OpenBSD::PackingElement::DisplayFile);
-sub category() { OpenBSD::PackageInfo::UNDISPLAY }
+sub name() { OpenBSD::PackageInfo::UNDISPLAY }
package OpenBSD::PackingElement::Arch;
our @ISA=qw(OpenBSD::PackingElement::Unique);
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.79 2014/01/02 18:19:46 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.80 2014/01/02 20:13:43 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
sub may_add
{
- my ($class, $subst, $plist, $name, $opt) = @_;
+ my ($class, $subst, $plist, $opt) = @_;
if (defined $opt) {
- my $o = $class->add($plist, $name);
+ my $o = $class->add($plist);
$subst->copy($opt, $o->fullname) if defined $o->fullname;
}
}
my $subst = $state->{subst};
add_description($state, $plist, DESC, $state->opt('d'));
- OpenBSD::PackingElement::FDISPLAY->may_add($subst, $plist, DISPLAY,
+ OpenBSD::PackingElement::FDISPLAY->may_add($subst, $plist,
$state->opt('M'));
- OpenBSD::PackingElement::FUNDISPLAY->may_add($subst, $plist, UNDISPLAY,
+ OpenBSD::PackingElement::FUNDISPLAY->may_add($subst, $plist,
$state->opt('U'));
for my $d (sort keys %{$state->{dependencies}}) {
OpenBSD::PackingElement::Dependency->add($plist, $d);