summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-01 18:22:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-01 18:22:21 +0000
commit2d3cf4e9ffed1ef91d4c38dc2e4cbef7a065830a (patch)
tree3c5d61e6c066c6a55ecd6f07e7566250e936337e /usr.sbin/pkg_add/OpenBSD/PackingElement.pm
parent9cfdd6e17663c6951037c6f6008ef7d3339fe286 (diff)
move the old elements into PackingElements, since the code is now
much shorter.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingElement.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm28
1 files changed, 27 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 033ad32f83b..10a8b090e81 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.93 2007/05/01 18:09:44 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.94 2007/05/01 18:22:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -1382,4 +1382,30 @@ sub check
return;
}
+package OpenBSD::PackingElement::Old;
+our @ISA=qw(OpenBSD::PackingElement);
+
+my $warned;
+
+sub add
+{
+ my ($o, $plist, @args) = @_;
+ my $keyword = $$o;
+ if (!$warned->{$keyword}) {
+ print STDERR "Warning: obsolete construct: \@$keyword @args\n";
+ $warned->{$keyword} = 1;
+ }
+ $plist->{deprecated} = 1;
+}
+
+sub register_old_keyword
+{
+ my ($class, $k) = @_;
+ $class->register_with_factory($k, bless \$k, $class);
+}
+
+for my $k (qw(src display mtree ignore_inst)) {
+ __PACKAGE__->register_old_keyword($k);
+}
+
1;