From e48320e2d8b915cad970dcfd01ca48679f07b4f4 Mon Sep 17 00:00:00 2001 From: Andrew Fyfe Date: Fri, 16 Apr 2021 06:47:31 +0100 Subject: [PATCH] sysutils/bsdstats: make reporting opt-in - disables reporting by default - does not use the pkg-install script to "modify the currently running system" as per the FreeBSD Porters Handbook Chapter 9.2. - does not output noise if monthly_statistics_* variables aren't enabled - add a post-upgrade message informing the user it's now opt-in and may need enabled --- sysutils/bsdstats/Makefile | 1 + sysutils/bsdstats/files/300.statistics.in | 23 +------ sysutils/bsdstats/files/pkg-message.in | 12 +++- sysutils/bsdstats/pkg-install | 73 ----------------------- 4 files changed, 14 insertions(+), 95 deletions(-) delete mode 100644 sysutils/bsdstats/pkg-install diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile index e676a52b58d1..86d3ab3d15da 100644 --- a/sysutils/bsdstats/Makefile +++ b/sysutils/bsdstats/Makefile @@ -2,6 +2,7 @@ PORTNAME= bsdstats PORTVERSION= 7.0 +PORTREVISION= 1 CATEGORIES= sysutils DISTFILES= diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in index d24ca2ae2076..1ba18493c600 100644 --- a/sysutils/bsdstats/files/300.statistics.in +++ b/sysutils/bsdstats/files/300.statistics.in @@ -67,6 +67,9 @@ fi # # global values # +monthly_statistics_enable=${monthly_statistics_enable:-"NO"} +monthly_statistics_report_devices=${$monthly_statistics_report_devices:-"YES"} +monthly_statistics_report_ports=${monthly_statistics_report_ports:-"YES"} checkin_server=${monthly_statistics_checkin_server:-"rpt.bsdstats.org"} bsdstats_log=${monthly_statistics_logfile:-"/var/log/bsdstats"} id_token_file='/var/db/bsdstats' @@ -531,27 +534,14 @@ report_all() { report_devices report_cpu ;; - [Nn][Oo]) - echo "Posting monthly device/CPU statistics disabled" - echo " set monthly_statistics_report_devices=\"YES\" in $periodic_conf" - ;; *) - # opt-out for devices - report_devices - report_cpu ;; esac case "$monthly_statistics_report_ports" in [Yy][Ee][Ss]) report_ports ;; - [Nn][Oo]) - echo "Posting monthly ports statistics disabled" - echo " set monthly_statistics_report_ports=\"YES\" in $periodic_conf" - ;; *) - # opt-out for ports - report_ports ;; esac # end @@ -569,14 +559,7 @@ case "$monthly_statistics_enable" in # explicitly enabled: report it report_all "$1" ;; - [Nn][Oo]) - echo "Posting monthly OS statistics disabled" - echo " set monthly_statistics_enable=\"YES\" in $periodic_conf" - rc=1 - ;; *) - # opt-out: we report when user has BSDstats installed, and user didn't say "NO" - report_all "$1" ;; esac diff --git a/sysutils/bsdstats/files/pkg-message.in b/sysutils/bsdstats/files/pkg-message.in index 2c504d2252f8..a1e0f6a20c48 100644 --- a/sysutils/bsdstats/files/pkg-message.in +++ b/sysutils/bsdstats/files/pkg-message.in @@ -3,8 +3,8 @@ message: <> /etc/rc.conf - fi - fi -fi