From 777219d853b9cdba842aaba756848976c4f8eb3b Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Wed, 30 May 2007 13:03:55 +0000 Subject: avoid setting partial directly when we can, use inheritance instead. --- usr.sbin/pkg_add/OpenBSD/Add.pm | 16 ++++++++-------- usr.sbin/pkg_add/OpenBSD/Replace.pm | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'usr.sbin/pkg_add/OpenBSD') diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 8bb37288bbf..a8917d706b8 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.63 2007/05/30 12:52:07 espie Exp $ +# $OpenBSD: Add.pm,v 1.64 2007/05/30 13:03:54 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -206,7 +206,7 @@ sub prepare_for_addition sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); my $auth = $self->{name}; print "adding ", $self->type, " $auth\n" if $state->{verbose}; return if $state->{not}; @@ -253,7 +253,7 @@ sub install my ($self, $state) = @_; my $name = $self->{name}; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); open(my $pipe, '-|', '/sbin/sysctl', '-n', $name); my $actual = <$pipe>; chomp $actual; @@ -303,7 +303,7 @@ sub prepare_for_addition sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); my $fullname = $self->fullname; my $destdir = $state->{destdir}; @@ -384,7 +384,7 @@ sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); $state->{end_faked} = 1; } @@ -422,7 +422,7 @@ sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); my $destdir = $state->{destdir}; my $filename = $destdir.$self->fullname; my $orig = $self->{copyfrom}; @@ -522,7 +522,7 @@ package OpenBSD::PackingElement::Dir; sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); my $fullname = $self->fullname; my $destdir = $state->{destdir}; @@ -539,7 +539,7 @@ sub install { my ($self, $state) = @_; - $state->{partial}->{$self} = 1; + $self->SUPER::install($state); $self->run($state); } diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm index f96651db371..43f50f9b527 100644 --- a/usr.sbin/pkg_add/OpenBSD/Replace.pm +++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Replace.pm,v 1.23 2007/05/30 12:52:07 espie Exp $ +# $OpenBSD: Replace.pm,v 1.24 2007/05/30 13:03:54 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie # @@ -67,7 +67,7 @@ sub extract return; } - $state->{partial}->{$self} = 1; + $self->SUPER::extract($state); my $d = dirname($file->{destdir}.$file->{name}); while (!-d $d && -e _) { $d = dirname($d); @@ -96,7 +96,7 @@ sub extract my $destdir = $state->{destdir}; return if -e $destdir.$fullname; - $state->{partial}->{$self} = 1; + $self->SUPER::extract($state); print "new directory ", $destdir, $fullname, "\n" if $state->{very_verbose}; return if $state->{not}; File::Path::mkpath($destdir.$fullname); -- cgit v1.2.3