For a non-interactive attempt to pkg_delete a firmware package, print a
authorsthen <sthen@openbsd.org>
Wed, 5 Apr 2017 11:57:58 +0000 (11:57 +0000)
committersthen <sthen@openbsd.org>
Wed, 5 Apr 2017 11:57:58 +0000 (11:57 +0000)
message advising use of "fw_update -d" rather than saying "ok" and doing
nothing. (pkg_delete intentionally makes it hard to uninstall firmware
to prevent surprises when cleaning a machine).

aja and I were surprised by the "ok" leaving the fw package installed.
suggestion from espie to mention fw_update -d in the message.

usr.sbin/pkg_add/OpenBSD/Delete.pm

index 94faf84..9a5bcd7 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.148 2017/03/25 18:58:59 espie Exp $
+# $OpenBSD: Delete.pm,v 1.149 2017/04/05 11:57:58 sthen Exp $
 #
 # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
 #
@@ -100,6 +100,7 @@ sub delete_package
                                return;
                        }
                } else {
+                       $state->errsay("NOT deleting #1: use fwupdate -d", $pkgname);
                        return;
                }
        }