diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-01 18:22:21 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-01 18:22:21 +0000 |
commit | 2d3cf4e9ffed1ef91d4c38dc2e4cbef7a065830a (patch) | |
tree | 3c5d61e6c066c6a55ecd6f07e7566250e936337e /usr.sbin/pkg_add | |
parent | 9cfdd6e17663c6951037c6f6008ef7d3339fe286 (diff) |
move the old elements into PackingElements, since the code is now
much shorter.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 28 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingOld.pm | 28 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_info | 5 |
5 files changed, 31 insertions, 36 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; diff --git a/usr.sbin/pkg_add/OpenBSD/PackingOld.pm b/usr.sbin/pkg_add/OpenBSD/PackingOld.pm index aac972f7844..ccd08c8dd5f 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingOld.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingOld.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingOld.pm,v 1.10 2007/05/01 18:20:12 espie Exp $ +# $OpenBSD: PackingOld.pm,v 1.11 2007/05/01 18:22:20 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -19,30 +19,4 @@ use strict; use warnings; use OpenBSD::PackingElement; -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; diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 5cb0d6144fc..c20256294d5 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.227 2007/04/21 09:57:22 espie Exp $ +# $OpenBSD: pkg_add,v 1.228 2007/05/01 18:22:20 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -96,7 +96,6 @@ sub can_install($$$) } require OpenBSD::Replace; - require OpenBSD::PackingOld; if (is_installed($plist->pkgname()) && !$state->{forced}->{installed}) { if (!$plist->has_new_sig($state) && !$plist->uses_old_libs()) { diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index ca3ef809d6c..e6873b90c70 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.96 2007/04/15 10:17:29 espie Exp $ +# $OpenBSD: pkg_delete,v 1.97 2007/05/01 18:22:20 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -20,7 +20,6 @@ use strict; use warnings; use OpenBSD::Getopt; use OpenBSD::PackingList; -use OpenBSD::PackingOld; use OpenBSD::RequiredBy; use OpenBSD::Error; use OpenBSD::ProgressMeter; diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info index 28b06d11dfb..b9ac6b80d88 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.43 2007/04/29 11:09:29 espie Exp $ +# $OpenBSD: pkg_info,v 1.44 2007/05/01 18:22:20 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -146,7 +146,6 @@ sub find_by_spec sub filter_files { - require OpenBSD::PackingOld; require OpenBSD::PackingList; my $search = shift; @@ -180,7 +179,6 @@ sub find_by_path my $pat = shift; if (!defined $path_info) { - require OpenBSD::PackingOld; require OpenBSD::PackingList; $path_info = {}; @@ -271,7 +269,6 @@ sub print_info } my $plist; if ($opt_f || $opt_L || $opt_s || $opt_S) { - require OpenBSD::PackingOld; require OpenBSD::PackingList; if ($opt_f || $opt_s || $opt_S) { |