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 | |
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')
-rw-r--r-- | usr.sbin/pkg_add/Makefile | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 11 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingOld.pm | 27 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 5 |
5 files changed, 44 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/Makefile b/usr.sbin/pkg_add/Makefile index 13bf5aef39e..c8f4921fd02 100644 --- a/usr.sbin/pkg_add/Makefile +++ b/usr.sbin/pkg_add/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2003/12/21 18:41:23 espie Exp $ +# $OpenBSD: Makefile,v 1.6 2004/06/21 16:33:45 espie Exp $ MAN=pkg_add.1 pkg_info.1 pkg_create.1 pkg_delete.1 pkg.1 @@ -9,6 +9,7 @@ PACKAGES= \ OpenBSD/PackageName.pm \ OpenBSD/PackingElement.pm \ OpenBSD/PackingList.pm \ + OpenBSD/PackingOld.pm \ OpenBSD/PkgCfl.pm \ OpenBSD/RequiredBy.pm \ OpenBSD/Temp.pm \ 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; diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index 6ef5070ae13..e89b4b6b3e1 100644 --- a/usr.sbin/pkg_add/pkg_delete +++ b/usr.sbin/pkg_add/pkg_delete @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_delete,v 1.23 2004/02/25 21:56:12 espie Exp $ +# $OpenBSD: pkg_delete,v 1.24 2004/06/21 16:33:45 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -29,6 +29,7 @@ use strict; use warnings; use Getopt::Std; use OpenBSD::PackingList; +use OpenBSD::PackingOld; use OpenBSD::PackageInfo; use OpenBSD::RequiredBy; use OpenBSD::Logger; diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index d7bce4a0b43..a677bbe2a1b 100644 --- a/usr.sbin/pkg_add/pkg_info +++ b/usr.sbin/pkg_add/pkg_info @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_info,v 1.3 2003/10/23 17:48:07 espie Exp $ +# $OpenBSD: pkg_info,v 1.4 2004/06/21 16:33:45 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -43,7 +43,8 @@ sub AUTOLOAD { package OpenBSD::PackingList; our $AUTOLOAD; sub AUTOLOAD { - eval { require OpenBSD::PackingList; + eval { require OpenBSD::PackingOld; + require OpenBSD::PackingList; }; goto &$AUTOLOAD; } |