diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-02 10:30:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-02 10:30:57 +0000 |
commit | 57f94e361bcd3b19664797fb0d20481f9ec55b27 (patch) | |
tree | c572f6860d46e2479e8e56608437c664235b8734 | |
parent | eb414764dbd883c3c688a1bcfb185c429bf6ea0b (diff) |
add code to keep obsolete constructs around. This allows pkg_info to
print them sensibly.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 9677790497d..bad5faa5e2d 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.97 2007/05/01 20:01:55 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.98 2007/05/02 10:30:56 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -1306,6 +1306,12 @@ our @ISA=qw(OpenBSD::PackingElement); my $warned; +sub new +{ + my ($class, $k, $args) = @_; + bless { keyword => $k, name => $args }, $class; +} + sub add { my ($o, $plist, @args) = @_; @@ -1314,9 +1320,17 @@ sub add print STDERR "Warning: obsolete construct: \@$keyword @args\n"; $warned->{$keyword} = 1; } + my $o2 = OpenBSD::PackingElement::Old->new($keyword, @args); + $o2->add_object($plist); $plist->{deprecated} = 1; } +sub keyword +{ + my $self = shift; + return $self->{keyword}; +} + sub register_old_keyword { my ($class, $k) = @_; |