Index | Thread | Search

From:
Peter Hessler <phessler@theapt.org>
Subject:
Re: pkg_add: stop advising to remove files on update
To:
Klemens Nanni <kn@openbsd.org>
Cc:
ports <ports@openbsd.org>
Date:
Mon, 28 Apr 2025 11:20:26 +0200

Download raw body.

Thread
yes please!  these messages have caused a lot of problems for people,
because they follow the erroneous instructions.

we can fix up other messages as we see them.

OK


On 2025 Apr 27 (Sun) at 11:24:32 +0000 (+0000), Klemens Nanni wrote:
:Make that last line disappear unless you actually delete the package:
:
:	# pkg_add -uDinstalled ietf-cli
:	quirks-7.105:updatedb-0p0->0p0: ok
:	quirks-7.105 signed on 2025-04-26T20:42:44Z
:	quirks-7.105->7.105: ok
:	[...]
:	ietf-cli-1.29p0->1.29p0: ok
:	Read shared items: ok
:	--- -ietf-cli-1.29p0 -------------------
:	You should also run rm -rf /var/db/ietf-mirrors/*
:
:So `pkg_delete ietf-cli' will still print it.
:
:There are various forms of "You should also ..." messages, I only changed
:those inside delete() functions, but perhaps there's more.
:
:Feedback? OK?
:
:Index: /s/usr.sbin/pkg_add/OpenBSD/Delete.pm
:===================================================================
:RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Delete.pm,v
:diff -u -p -r1.169 Delete.pm
:--- /s/usr.sbin/pkg_add/OpenBSD/Delete.pm	11 Oct 2023 13:54:43 -0000	1.169
:+++ /s/usr.sbin/pkg_add/OpenBSD/Delete.pm	27 Apr 2025 11:19:09 -0000
:@@ -606,7 +606,7 @@ sub delete($self, $state)
: 	if ($state->{extra}) {
: 		unlink($realname) or
: 		    $state->say("problem deleting extra file #1: #2", $realname, $!);
:-	} else {
:+	} elsif (!$state->{update}) {
: 		$state->log("You should also remove #1", $realname);
: 		$self->mark_dir($state);
: 	}
:@@ -621,7 +621,7 @@ sub delete($self, $state)
: 	my $realname = $self->realname($state);
: 	if ($state->{extra}) {
: 		$self->SUPER::delete($state);
:-	} else {
:+	} elsif (!$state->{update}) {
: 		$state->log("You should also remove the directory #1", $realname);
: 		$self->mark_dir($state);
: 	}
:@@ -633,7 +633,7 @@ sub delete($self, $state)
: {
: 	if ($state->{extra}) {
: 		$self->run($state);
:-	} else {
:+	} elsif (!$state->{update}) {
: 		$state->log("You should also run #1", $self->{expanded});
: 	}
: }
: