Bug 232412

Summary: Keywords/sample.ucl: Hide "You may need to manually remove XYZ..." during upgrades
Product: Ports & Packages Reporter: stb
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Open ---    
Severity: Affects Only Me CC: pkg, ports-bugs, tobik
Priority: --- Keywords: needs-patch
Version: Latest   
Hardware: Any   
OS: Any   

Description stb 2018-10-18 21:06:32 UTC
When upgrading packages with pkg, for some packages a message is emitted during the upgrade like the following:

[3/3] Fetching gitea-1.5.2.txz: 100%   15 MiB  15.3MB/s    00:01    
...
[3/3] Upgrading gitea from 1.5.1 to 1.5.2...
===> Creating groups.
Using existing group 'git'.
===> Creating users
Using existing user 'git'.
[3/3] Extracting gitea-1.5.2: 100%
Stopping gitea.
Waiting for PIDS: 2440, 2440.
You may need to manually remove /usr/local/etc/gitea/conf/app.ini if it is no longer needed.

I assume this message is produced when de-installing the previous version, but it's not obvious to the casual user where it comes from, or why it's emitted. Since the package continues to be installed, the config file is in fact still needed, and deleting it would likely make the installed package unusable.

Ideally, the message would only be emitted when deinstalling a package. For upgrades, the message should only be shown if the file in question is actually not part of the new version anymore. Otherwise, nothing should be printed.

# pkg info -I pkg
pkg-1.10.5_5                   Package manager
# uname -a
FreeBSD repo.zs64.net 11.2-STABLE FreeBSD 11.2-STABLE #10 r338650: Thu Sep 13 16:53:15 UTC 2018     root@redacted  amd64
Comment 1 Tobias Kortkamp freebsd_committer 2019-07-09 09:22:56 UTC
With the ability to hide pkg-message during upgrades, maybe the @sample messages
like "You may need to manually remove XYZ if it is no longer needed." could be
hidden during pkg upgrade as well.
Comment 2 Baptiste Daroussin freebsd_committer 2019-07-09 09:30:53 UTC
Not yes, because the message comes from a script. but next pkg will allow that
Comment 3 Baptiste Daroussin freebsd_committer 2019-07-09 09:40:00 UTC
one should have read "not yet"