summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-10-05 10:06:15 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-10-05 10:06:15 +0000
commit04ad1f8b1fc145db4c26adc3dcee861802304452 (patch)
tree2395dc979a03eafd01b8ea661367db7ea5117975 /usr.sbin/pkg_add/OpenBSD/PackingElement.pm
parent7a47a7dddd78f8e7294cd9144cb9cdf1d105eca2 (diff)
Only ::FileObject need to do the dirclass test, other objects don't
become dirs/
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm22
1 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 4922c4d6b2c..58027a54945 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.34 2004/10/05 10:01:17 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.35 2004/10/05 10:06:14 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -67,11 +67,7 @@ sub category() { 'items' }
sub new
{
my ($class, $args) = @_;
- if ($args =~ m|/+$| and defined $class->dirclass()) {
- bless { name => $` }, $class->dirclass();
- } else {
- bless { name => $args }, $class;
- }
+ bless { name => $args }, $class;
}
sub clone
@@ -83,8 +79,6 @@ sub clone
}
-sub dirclass() { undef }
-
sub destate
{
}
@@ -218,6 +212,18 @@ our @ISA=qw(OpenBSD::PackingElement::Object);
sub NoDuplicateNames() { 1 }
+sub dirclass() { undef }
+
+sub new
+{
+ my ($class, $args) = @_;
+ if ($args =~ m|/+$| and defined $class->dirclass()) {
+ bless { name => $` }, $class->dirclass();
+ } else {
+ bless { name => $args }, $class;
+ }
+}
+
# exec/unexec and friends
package OpenBSD::PackingElement::Action;
our @ISA=qw(OpenBSD::PackingElement::Object);