Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
tweak pkg_* footgun messages
To:
ports@openbsd.org, Marc Espie <espie@nerim.net>
Date:
Sat, 13 Jan 2024 17:06:18 +0000

Download raw body.

Thread
	syncthing-1.27.1->1.27.2: ok
	Read shared items: ok
	--- -syncthing-1.27.1 -------------------
	You should also run rm -rf /var/syncthing/{.,}*

I shall certainly not wipe that directory...

Apparently fixing this for good is more involved, but rewording is easy,
so perhaps this reads better?

	You may also run rm -rf /var/syncthing/{.,}*

It's not great, but relaxing 'must' into 'may' feels more appropiate.

Thoughts?

Index: OpenBSD/Delete.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Delete.pm,v
diff -u -p -r1.169 Delete.pm
--- OpenBSD/Delete.pm	11 Oct 2023 13:54:43 -0000	1.169
+++ OpenBSD/Delete.pm	13 Jan 2024 16:57:26 -0000
@@ -527,7 +527,7 @@ sub delete($self, $state)
 	if ($state->{quick} && $state->{quick} >= 2) {
 		unless ($state->{extra}) {
 			$self->mark_dir($state);
-			$state->log("You should also #1 #2", $action, $realname );
+			$state->log("You may also #1 #2", $action, $realname );
 			return;
 		}
 	} else {
@@ -537,7 +537,7 @@ sub delete($self, $state)
 		} else {
 			unless ($state->{extra}) {
 				$self->mark_dir($state);
-				$state->log("You should also #1 #2 (which was modified)", $action, $realname);
+				$state->log("You may also #1 #2 (which was modified)", $action, $realname);
 				return;
 			}
 		}
@@ -607,7 +607,7 @@ sub delete($self, $state)
 		unlink($realname) or
 		    $state->say("problem deleting extra file #1: #2", $realname, $!);
 	} else {
-		$state->log("You should also remove #1", $realname);
+		$state->log("You may also remove #1", $realname);
 		$self->mark_dir($state);
 	}
 }
@@ -622,7 +622,7 @@ sub delete($self, $state)
 	if ($state->{extra}) {
 		$self->SUPER::delete($state);
 	} else {
-		$state->log("You should also remove the directory #1", $realname);
+		$state->log("You may also remove the directory #1", $realname);
 		$self->mark_dir($state);
 	}
 }
@@ -634,7 +634,7 @@ sub delete($self, $state)
 	if ($state->{extra}) {
 		$self->run($state);
 	} else {
-		$state->log("You should also run #1", $self->{expanded});
+		$state->log("You may also run #1", $self->{expanded});
 	}
 }
 
Index: OpenBSD/SharedItems.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/SharedItems.pm,v
diff -u -p -r1.34 SharedItems.pm
--- OpenBSD/SharedItems.pm	13 Jun 2023 09:07:17 -0000	1.34
+++ OpenBSD/SharedItems.pm	13 Jan 2024 16:58:03 -0000
@@ -110,7 +110,7 @@ sub cleanup($recorder, $state)
 			    $user);
 		} else {
 			$state->log->set_context('-'.$pkgname);
-			$state->log("You should also run /usr/sbin/userdel #1", $user);
+			$state->log("You may also run /usr/sbin/userdel #1", $user);
 		}
 		$done++;
 	}
@@ -122,7 +122,7 @@ sub cleanup($recorder, $state)
 			    $group);
 		} else {
 			$state->log->set_context('-'.$pkgname);
-			$state->log("You should also run /usr/sbin/groupdel #1", $group);
+			$state->log("You may also run /usr/sbin/groupdel #1", $group);
 		}
 		$done++;
 	}