Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Aug 2012 01:50:38 GMT
From:      "A.J. Kehoe IV (Nanoman)" <bsdstats@nanoman.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/171015: [patch] Tidying sysutils/bsdstats
Message-ID:  <201208250150.q7P1ocGo013845@red.freebsd.org>
Resent-Message-ID: <201208250200.q7P207PJ011503@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171015
>Category:       ports
>Synopsis:       [patch] Tidying sysutils/bsdstats
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 25 02:00:07 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     A.J. Kehoe IV (Nanoman)
>Release:        9.0
>Organization:
Nanoman's Company
>Environment:
FreeBSD localhost 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 02:52:29 UTC 2012     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The FreeBSD port/bsdstats needs to be cleaned up a bit for legibility and usability purposes:

 - As reported by 2A <deuza at fr dot FreeBSD dot org>, the installation message given by pkg-message.in is somewhat confusing and illogical.  Thank you to 2A for the excellent recommendation.

 - The project's description, which is included in pkg-message.in, should appear in pkg-descr instead.

 - The Makefile's post-install message is redundant.

 - The default answer to each reporting question should be "yes".

 - The tests for /etc/periodic.conf and /etc/rc.conf could be a little simpler and not produce grep errors when these files don't exist.

 - The interactive prompts during installation could be written better.
>How-To-Repeat:

>Fix:
I've attached a patch that updates four of the port's files:

 - Makefile
 - files/pkg-message.in
 - pkg-descr
 - pkg-install

patch -d /usr < /path/to/bsdstats-update.diff.txt

Patch attached with submission follows:

diff -u ports/sysutils/bsdstats/Makefile.old ports/sysutils/bsdstats/Makefile
--- ports/sysutils/bsdstats/Makefile.old	2012-01-10 19:40:59.000000000 -0500
+++ ports/sysutils/bsdstats/Makefile	2012-08-24 21:37:04.158357000 -0400
@@ -22,13 +22,8 @@
 	${MKDIR} ${PREFIX}/etc/periodic/monthly
 	${INSTALL_SCRIPT} ${WRKDIR}/300.statistics ${PREFIX}/etc/periodic/monthly
 post-install:
-	@${CAT} ${PKGMESSAGE}
 .if defined(BATCH) || defined(PACKAGE_BUILDING)
-	@${ECHO_MSG} "	To activate monthly statistics reporting in /etc/periodic.conf,"
-	@${ECHO_MSG} "	execute the following as root user:"
-	@${ECHO_MSG}
-	@${ECHO_MSG} "PKG_PREFIX=\"${PREFIX}\" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL"
-	@${ECHO_MSG}
+	@${CAT} ${PKGMESSAGE}
 .else
 	@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 .endif
diff -u ports/sysutils/bsdstats/files/pkg-message.in.old ports/sysutils/bsdstats/files/pkg-message.in
--- ports/sysutils/bsdstats/files/pkg-message.in.old	2010-08-18 23:06:13.000000000 -0400
+++ ports/sysutils/bsdstats/files/pkg-message.in	2012-08-24 21:37:04.158357000 -0400
@@ -1,30 +1,15 @@
-
-This script, meant to be run monthly, submits statistics anonymously
-to a central checkin server (http://bsdstats.org), in an attempt to
-generate reasonably accurate demographics of both *BSD usage, as well
-as devices in use.
-
-Steps have been taken to make eliminate security concerns brought up
-in earlier releases of this, including, but not limited to, not storing
-anything in the database that has been deemed as 'sensitive' (ie. IP of
-the reporting server, and hostname).
-
 ********************
-To enable monthly reporting, edit or create /etc/periodic.conf and add this line:
+To enable monthly reporting, add these lines to /etc/periodic.conf:
 	monthly_statistics_enable="YES"
-
-To enable boottime reporting, edit or create /etc/rc.conf and add this line:
-	bsdstats_enable="YES"
-
-To enable device reporting, add this line:
 	monthly_statistics_report_devices="YES"
-
-To enable ports reporting, add this line:
 	monthly_statistics_report_ports="YES"
 
-To run it manually the first time, just run it as:
+To enable reporting on bootup, add this line to /etc/rc.conf:
+	bsdstats_enable="YES"
+
+To run it manually the first time:
 	%%PREFIX%%/etc/periodic/monthly/300.statistics -nodelay
 
 To view current statistics, go to:
-        http://www.bsdstats.org
+	http://www.bsdstats.org/
 ********************
diff -u ports/sysutils/bsdstats/pkg-descr.old ports/sysutils/bsdstats/pkg-descr
--- ports/sysutils/bsdstats/pkg-descr.old	2010-06-02 08:02:59.000000000 -0400
+++ ports/sysutils/bsdstats/pkg-descr	2012-08-24 21:37:04.158357000 -0400
@@ -1,8 +1,15 @@
-The purpose of this port is to attempt to produce reasonably accurate
-statistics on FreeBSD deployment, to be used for both marketing, and 
-advocacy purposes by the project.
+BSDstats is an attempt to produce reasonably accurate statistics on
+deployments of BSD operating systems.  This is useful for marketing,
+project advocacy, hardware vendors and purchasers, device driver
+maintainers, and port maintainers.
 
 The major problem that we are trying to address is vendors who do not
-feel that FreeBSD presents enough of a market to bother supporting.
+feel that BSD operating systems present enough of a market to bother
+supporting.
+
+Meant to be run monthly or during bootup, this script submits
+statistics anonymously to a central server (http://bsdstats.org).
+Potentially sensitive details like IP addresses and hostnames are not
+stored by or relayed through the BSDstats server.
 
 WWW: http://www.bsdstats.org/
diff -u ports/sysutils/bsdstats/pkg-install.old ports/sysutils/bsdstats/pkg-install
--- ports/sysutils/bsdstats/pkg-install.old	2012-07-28 08:27:28.000000000 -0400
+++ ports/sysutils/bsdstats/pkg-install	2012-08-24 21:37:04.158357000 -0400
@@ -3,30 +3,30 @@
 # pkg-install : based off ${PORTSDIR}/mail/courier/files/pkg-install.in
 #
 
-# The default answer to "Would you like to activate monthly reporting in
-# /etc/periodic.conf?" is "no", which you can override by setting the
-# BSDSTATS_MONTHLY_ENABLE environment variable to "yes".
+# The default answer to "Would you like to enable monthly reporting in
+# /etc/periodic.conf?" is "yes", which you can override by setting the
+# BSDSTATS_MONTHLY_ENABLE environment variable to "no".
 #
 # The default answer to "Would you like to send a list of installed hardware
-# as well?" is "no", which you can override by setting the
-# BSDSTATS_MONTHLY_DEVICES environment variable to "yes".
+# as well?" is "yes", which you can override by setting the
+# BSDSTATS_MONTHLY_DEVICES environment variable to "no".
 #
 # The default answer to "Would you like to send a list of installed ports as
-# well?" is "no", which you can override by setting the BSDSTATS_MONTHLY_PORTS
-# environment variable to "yes".
+# well?" is "yes", which you can override by setting the BSDSTATS_MONTHLY_PORTS
+# environment variable to "no".
 #
 # The default answer to "Would you like to run it now?" is "yes", which you can
 # override by setting the BSDSTATS_MONTHLY_NOW environment variable to "no".
 #
-# The default answer to "Would you like to activate reporting on reboot in
-# /etc/rc.conf?" is "no", which you can override by setting the
-# BSDSTATS_REBOOT_REPORTING environment variable to "yes".
-
-BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=no}
-BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=no}
-BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=no}
+# The default answer to "Would you like to enable reporting on bootup in
+# /etc/rc.conf?" is "yes", which you can override by setting the
+# BSDSTATS_REBOOT_REPORTING environment variable to "no".
+
+BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=yes}
+BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=yes}
+BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=yes}
 BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=yes}
-BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no}
+BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=yes}
 
 ask() {
     local question default answer
@@ -58,8 +58,8 @@
 }
 
 if [ "$2" = "POST-INSTALL" ]; then
-    if [ -f "/etc/periodic.conf" -a -z "`grep monthly_statistics /etc/periodic.conf`" ] || [ ! -f "/etc/periodic.conf" ]; then
-        if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" ${BSDSTATS_MONTHLY_ENABLE}; then
+    if [ ! -f "/etc/periodic.conf" ] || [ -z "`grep monthly_statistics /etc/periodic.conf`" ]; then
+        if yesno "Would you like to enable monthly reporting in /etc/periodic.conf" ${BSDSTATS_MONTHLY_ENABLE}; then
             echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf
             if yesno "Would you like to send a list of installed hardware as well" ${BSDSTATS_MONTHLY_DEVICES}; then
                 echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf
@@ -72,15 +72,14 @@
             fi
         fi
     fi
-    if [ -f "/etc/rc.conf" -a -z "`grep bsdstats_enable /etc/rc.conf`" ] || [ ! -f "/etc/rc.conf" ]; then
+    if [ ! -f "/etc/rc.conf" ] || [ -z "`grep bsdstats_enable /etc/rc.conf`" ]; then
         echo ""
-        echo "If running as a desktop, or on a laptop, it is recommended that you"
-        echo "enable bsdstats within /etc/rc.conf, so that it will run on reboot."
+        echo "If you're installing BSDstats on a system that won't always be on, such as a"
+        echo "desktop or a laptop, it is recommended that you enable it in /etc/rc.conf so"
+        echo "that it will run on bootup.  This will ensure that, even if your computer is"
+        echo "off when \"monthly\" runs, your computer will be counted properly."
         echo ""
-        echo "This will ensure that even if your computer is off when monthly runs,"
-        echo "your computer will be properly counted."
-        echo ""
-        if yesno "Would you like to activate reporting on reboot in /etc/rc.conf" ${BSDSTATS_REBOOT_REPORTING}; then
+        if yesno "Would you like to enable reporting on bootup in /etc/rc.conf" ${BSDSTATS_REBOOT_REPORTING}; then
             echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf
         fi
     fi


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208250150.q7P1ocGo013845>