From: espie Date: Mon, 30 Dec 2013 09:02:37 +0000 (+0000) Subject: use replacing method (and not var) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=640614890afc31474108e38a95c50b2744e50929;p=openbsd use replacing method (and not var) --- diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 2af2033a6f8..53a30d874d3 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.133 2013/02/18 20:24:11 okan Exp $ +# $OpenBSD: Add.pm,v 1.134 2013/12/30 09:02:37 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -646,14 +646,14 @@ package OpenBSD::PackingElement::ExecAdd; sub should_run { my ($self, $state) = @_; - return !$state->{replacing}; + return !$state->replacing; } package OpenBSD::PackingElement::ExecUpdate; sub should_run { my ($self, $state) = @_; - return $state->{replacing}; + return $state->replacing; } package OpenBSD::PackingElement::Lib; diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 162943f1375..c3128cff744 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.121 2013/12/25 14:38:15 espie Exp $ +# $OpenBSD: Delete.pm,v 1.122 2013/12/30 09:02:37 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -357,14 +357,14 @@ package OpenBSD::PackingElement::UnexecDelete; sub should_run { my ($self, $state) = @_; - return !$state->{replacing}; + return !$state->replacing; } package OpenBSD::PackingElement::UnexecUpdate; sub should_run { my ($self, $state) = @_; - return $state->{replacing}; + return $state->replacing; } package OpenBSD::PackingElement::FileBase; @@ -453,7 +453,7 @@ sub copy_old_stuff if (defined $self->{stillaround}) { delete $self->{stillaround}; - if ($state->{replacing}) { + if ($state->replacing) { $self->rename_file_to_temp($state); } $self->add_object($plist); @@ -521,7 +521,7 @@ sub delete if (!defined $orig) { $state->fatal("\@sample element does not reference a valid file"); } - my $action = $state->{replacing} ? "check" : "remove"; + my $action = $state->replacing ? "check" : "remove"; my $origname = $orig->realname($state); if (! -e $realname) { $state->log("File #1 does not exist", $realname); @@ -619,7 +619,7 @@ sub delete } return if $state->{not}; return unless -e $realname or -l $realname; - if ($state->{replacing}) { + if ($state->replacing) { $state->log("Remember to update #1", $realname); $self->mark_dir($state); } elsif ($state->{extra}) { @@ -638,7 +638,7 @@ sub delete my ($self, $state) = @_; return unless $state->{extra}; my $realname = $self->realname($state); - return if $state->{replacing}; + return if $state->replacing; if ($state->{extra}) { $self->SUPER::delete($state); } else {