use replacing method (and not var)
authorespie <espie@openbsd.org>
Mon, 30 Dec 2013 09:02:37 +0000 (09:02 +0000)
committerespie <espie@openbsd.org>
Mon, 30 Dec 2013 09:02:37 +0000 (09:02 +0000)
usr.sbin/pkg_add/OpenBSD/Add.pm
usr.sbin/pkg_add/OpenBSD/Delete.pm

index 2af2033..53a30d8 100644 (file)
@@ -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 <espie@openbsd.org>
 #
@@ -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;
index 162943f..c3128cf 100644 (file)
@@ -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 <espie@openbsd.org>
 #
@@ -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 {