summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2022-06-09 09:27:12 +0000
committerMarc Espie <espie@cvs.openbsd.org>2022-06-09 09:27:12 +0000
commitc29029ffefb8f02aa42914fa75880831bdb0b969 (patch)
treeb888f0cf8fac8c0ba39afd06d996bd94b761740a /usr.sbin
parent1f004a66f0fc23139e9f4ece6fbb3405c5ddc7bd (diff)
se more specific discrimination to know if extra data is still there after
an update.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm10
1 files changed, 4 insertions, 6 deletions
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 <espie@openbsd.org>
#
@@ -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 {