From: espie Date: Thu, 9 Jun 2022 09:27:11 +0000 (+0000) Subject: se more specific discrimination to know if extra data is still there after X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=553f849ec2840f5ec7b8bd354ceb9aae7c32a0f0;p=openbsd se more specific discrimination to know if extra data is still there after an update. --- diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 73801a80e93..2d023bbece2 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.164 2022/06/06 07:57:21 espie Exp $ +# $OpenBSD: Delete.pm,v 1.165 2022/06/09 09:27:11 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -645,16 +645,14 @@ use File::Basename; sub delete { my ($self, $state) = @_; + return if defined $state->{current_set}{known_extra}{$self->fullname}; my $realname = $self->realname($state); if ($state->verbose >= 2 && $state->{extra}) { $state->say("deleting extra file: #1", $realname); } return if $state->{not}; return unless -e $realname or -l $realname; - if ($state->replacing) { - $state->log("Remember to update #1", $realname); - $self->mark_dir($state); - } elsif ($state->{extra}) { + if ($state->{extra}) { unlink($realname) or $state->say("problem deleting extra file #1: #2", $realname, $!); } else { @@ -669,8 +667,8 @@ sub delete { my ($self, $state) = @_; return unless $state->{extra}; + return if defined $state->{current_set}{known_extra}{$self->fullname}; my $realname = $self->realname($state); - return if $state->replacing; if ($state->{extra}) { $self->SUPER::delete($state); } else {