diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-10-05 10:20:41 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-10-05 10:20:41 +0000 |
commit | 9b7c6fd64ce24c4dfd26d7d6da6ceb7973f3f8db (patch) | |
tree | 7c27d33e8e4cbdc7def6c5bd72d1a63626fc7304 /usr.sbin/pkg_add/OpenBSD | |
parent | 24d36ab42426bdc56f970717e1bd53949872d097 (diff) |
basic destate for ::FileObject, derive ::Exec, ::Unexec, ::Extraunexec
from ::ExeclikeAction
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 7443dceba3b..0cf55f04ea0 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.37 2004/10/05 10:12:22 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.38 2004/10/05 10:20:40 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -224,6 +224,12 @@ sub new } } +sub destate +{ + my ($self, $state) = @_; + $self->compute_fullname($state); +} + # exec/unexec and friends package OpenBSD::PackingElement::Action; our @ISA=qw(OpenBSD::PackingElement::Object); @@ -279,7 +285,7 @@ sub write sub destate { my ($self, $state) = @_; - $self->compute_fullname($state); + $self->SUPER::destate($state); $state->{lastfile} = $self; $self->compute_modes($state); if (defined $state->{nochecksum}) { @@ -879,55 +885,40 @@ sub destate } } -package OpenBSD::PackingElement::Exec; +package OpenBSD::PackingElement::ExeclikeAction; our @ISA=qw(OpenBSD::PackingElement::Action); -__PACKAGE__->setKeyword('exec'); - -sub keyword() { "exec" } - sub destate { my ($self, $state) = @_; $self->{expanded} = $self->expand($self->{name}, $state); } +package OpenBSD::PackingElement::Exec; +our @ISA=qw(OpenBSD::PackingElement::ExeclikeAction); + +__PACKAGE__->setKeyword('exec'); + +sub keyword() { "exec" } + package OpenBSD::PackingElement::Unexec; -our @ISA=qw(OpenBSD::PackingElement::Action); +our @ISA=qw(OpenBSD::PackingElement::ExeclikeAction); __PACKAGE__->setKeyword('unexec'); sub keyword() { "unexec" } -sub destate -{ - my ($self, $state) = @_; - $self->{expanded} = $self->expand($self->{name}, $state); -} - package OpenBSD::PackingElement::ExtraUnexec; -our @ISA=qw(OpenBSD::PackingElement::Action); +our @ISA=qw(OpenBSD::PackingElement::ExeclikeAction); __PACKAGE__->setKeyword('extraunexec'); sub keyword() { "extraunexec" } -sub destate -{ - my ($self, $state) = @_; - $self->{expanded} = $self->expand($self->{name}, $state); -} - package OpenBSD::PackingElement::DirRm; our @ISA=qw(OpenBSD::PackingElement::FileObject); __PACKAGE__->setKeyword('dirrm'); sub keyword() { "dirrm" } -sub destate -{ - my ($self, $state) = @_; - $self->compute_fullname($state); -} - package OpenBSD::PackingElement::DirBase; sub stringize($) { @@ -944,7 +935,7 @@ sub keyword() { "dir" } sub destate { my ($self, $state) = @_; - $self->compute_fullname($state); + $self->SUPER::destate($state); $self->compute_modes($state); } |