diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-06-14 09:11:50 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-06-14 09:11:50 +0000 |
commit | 9d8c567d7f78629b1271c36d40fa93b0ec5ab840 (patch) | |
tree | 8a4b6ab8a1c08f1bb8460ece84ae901e529f094e /usr.sbin | |
parent | 7cf69ae9a4a66deb84f85670d57d616431419299 (diff) |
minor changes: move @ignore to deprecated stuff (it's been out for a few
months now), register lastfileobject for future changes, make a common
class for uniqueoptions.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index c09de9eb3f5..37f672e6882 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.134 2007/06/12 09:53:36 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.135 2007/06/14 09:11:49 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -221,6 +221,7 @@ sub new sub destate { my ($self, $state) = @_; + $state->{lastfileobject} = $self; $self->compute_fullname($state); } @@ -523,15 +524,6 @@ our @ISA=qw(OpenBSD::PackingElement::FileBase); sub keyword() { "ltlib" } __PACKAGE__->register_with_factory; -package OpenBSD::PackingElement::Ignore; -our @ISA=qw(OpenBSD::PackingElement::Annotation); - -__PACKAGE__->register_with_factory('ignore'); - -sub add -{ -} - # Comment is very special package OpenBSD::PackingElement::Comment; our @ISA=qw(OpenBSD::PackingElement::Meta); @@ -639,19 +631,20 @@ sub new return OpenBSD::PackingElement::NoDefaultConflict->new; } elsif ($args eq 'manual-installation') { return OpenBSD::PackingElement::ManualInstallation->new; + } elsif ($args eq 'system-package') { + return OpenBSD::PackingElement::SystemPackage->new; } else { die "Unknown option: $args"; } } -package OpenBSD::PackingElement::NoDefaultConflict; +package OpenBSD::PackingElement::UniqueOption; our @ISA=qw(OpenBSD::PackingElement::Unique OpenBSD::PackingElement::Option); -sub category() { 'no-default-conflict' } - -sub stringize() -{ - return 'no-default-conflict'; +sub stringize +{ + my $self = shift; + return $self->category; } sub new @@ -660,21 +653,20 @@ sub new bless {}, $class; } +package OpenBSD::PackingElement::NoDefaultConflict; +our @ISA=qw(OpenBSD::PackingElement::UniqueOption); + +sub category() { 'no-default-conflict' } + package OpenBSD::PackingElement::ManualInstallation; -our @ISA=qw(OpenBSD::PackingElement::Unique OpenBSD::PackingElement::Option); +our @ISA=qw(OpenBSD::PackingElement::UniqueOption); sub category() { 'manual-installation' } -sub stringize() -{ - return 'manual-installation'; -} +package OpenBSD::PackingElement::SystemPackage; +our @ISA=qw(OpenBSD::PackingElement::UniqueOption); -sub new -{ - my ($class, @args) = @_; - bless {}, $class; -} +sub category() { 'system-package' } # The special elements that don't end in the right place package OpenBSD::PackingElement::ExtraInfo; @@ -1433,7 +1425,7 @@ sub register_old_keyword } for my $k (qw(src display mtree ignore_inst dirrm pkgcfl pkgdep newdepend - libdepend digitalsignature)) { + libdepend digitalsignature ignore)) { __PACKAGE__->register_old_keyword($k); } |