diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-06-21 16:33:46 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-06-21 16:33:46 +0000 |
commit | 53dd804e65cd1bf7a2c072e04cd765e997065f53 (patch) | |
tree | f5c276c2b46b5ad81459caef274377d7ec0bcf17 /usr.sbin/pkg_add/OpenBSD | |
parent | 4edb92d8b1de61569023b47a4f16203787c59f2b (diff) |
support for old stuff in pkg_info/pkg_delete, e.g., @src
prompted by miod@, okay miod@ millert@.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 11 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingOld.pm | 27 |
2 files changed, 37 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 299822de800..2d7e5308844 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackingElement.pm,v 1.8 2004/03/30 08:53:35 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.9 2004/06/21 16:33:45 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -33,6 +33,7 @@ use OpenBSD::PackageInfo; package OpenBSD::PackingElement; use File::Basename; our %keyword; +our %oldkeyword; sub Factory { @@ -43,6 +44,9 @@ sub Factory if (defined $keyword{$cmd}) { $keyword{$cmd}->add(@_, $args); + } elsif (defined $oldkeyword{$cmd}) { + $oldkeyword{$cmd}->add(@_, $args); + print STDERR "Warning: obsolete construct: \@$cmd $args\n"; } else { print STDERR "Unknown element: \@$cmd $args\n"; exit(1); @@ -57,6 +61,11 @@ sub setKeyword { $keyword{$k} = $class; } +sub setOldKeyword { + my ($class, $k) = @_; + $oldkeyword{$k} = $class; +} + sub category() { 'items' } sub new diff --git a/usr.sbin/pkg_add/OpenBSD/PackingOld.pm b/usr.sbin/pkg_add/OpenBSD/PackingOld.pm new file mode 100644 index 00000000000..3c8924db0ed --- /dev/null +++ b/usr.sbin/pkg_add/OpenBSD/PackingOld.pm @@ -0,0 +1,27 @@ +# $OpenBSD: PackingOld.pm,v 1.1 2004/06/21 16:33:45 espie Exp $ +# Copyright (c) 2004 Marc Espie <espie@openbsd.org> +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +use strict; +use warnings; +use OpenBSD::PackingElement; + +package OpenBSD::PackingElement::Src; +our @ISA=qw(OpenBSD::PackingElement); + +__PACKAGE__->setOldKeyword('src'); + +sub keyword() { 'src' } + +1; |