From owner-svn-ports-all@FreeBSD.ORG Wed Jan 8 13:54:00 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2796A87C; Wed, 8 Jan 2014 13:54:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 07F861B28; Wed, 8 Jan 2014 13:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s08DrxKm098628; Wed, 8 Jan 2014 13:53:59 GMT (envelope-from lme@svn.freebsd.org) Received: (from lme@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s08DrxB9098626; Wed, 8 Jan 2014 13:53:59 GMT (envelope-from lme@svn.freebsd.org) Message-Id: <201401081353.s08DrxB9098626@svn.freebsd.org> From: Lars Engels Date: Wed, 8 Jan 2014 13:53:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r339133 - head/sysutils/bsdstats X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2014 13:54:00 -0000 Author: lme Date: Wed Jan 8 13:53:59 2014 New Revision: 339133 URL: http://svnweb.freebsd.org/changeset/ports/339133 Log: - Add DIG command to SUB_LIST, not overwrite the list - Use correct OSVERSION for the dig(1) / drill(1) change - Don't add anything to rc.conf and periodic.conf when WITH_PACKAGE_BUILDING is set to pet poudriere and tinderbox - Re-word pkg-message - Bump PORTREVISION PR: ports/175879 Submitted by: Alex Keda Approved by: maintainer Reported by: Alex Keda, 2A, and dvl Patched by: A.J. Kehoe and me Modified: head/sysutils/bsdstats/Makefile head/sysutils/bsdstats/pkg-install Modified: head/sysutils/bsdstats/Makefile ============================================================================== --- head/sysutils/bsdstats/Makefile Wed Jan 8 13:51:12 2014 (r339132) +++ head/sysutils/bsdstats/Makefile Wed Jan 8 13:53:59 2014 (r339133) @@ -3,7 +3,7 @@ PORTNAME= bsdstats PORTVERSION= 5.5 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= sysutils DISTFILES= @@ -13,11 +13,11 @@ COMMENT= Monthly script for reporting an NO_BUILD= yes USE_RC_SUBR= bsdstats SUB_FILES= 300.statistics pkg-message -SUB_LIST= DIG=${DIG} +SUB_LIST+= DIG=${DIG} -.include +.include -.if ${OSVERSION} >= 1000100 +.if ${OSVERSION} >= 1000500 DIG= drill .else DIG= dig @@ -28,4 +28,9 @@ do-install: ${INSTALL_SCRIPT} ${WRKDIR}/300.statistics \ ${STAGEDIR}${PREFIX}/etc/periodic/monthly -.include +post-install: +.if ! defined(BATCH) && ! defined(PACKAGE_BUILDING) + @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif + +.include Modified: head/sysutils/bsdstats/pkg-install ============================================================================== --- head/sysutils/bsdstats/pkg-install Wed Jan 8 13:51:12 2014 (r339132) +++ head/sysutils/bsdstats/pkg-install Wed Jan 8 13:53:59 2014 (r339133) @@ -1,86 +1,84 @@ #!/bin/sh -# # pkg-install : based off ${PORTSDIR}/mail/courier/files/pkg-install.in -# -# 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 "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 "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 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:=yes} +# The default answer to each of the installation questions is "yes". You can +# override a questions's default by setting its environment variable to "no". +# +# Environment Variable | Question +# --------------------------+------------------------------------------------------------------ +# BSDSTATS_MONTHLY_ENABLE | Would you like to enable monthly reporting in /etc/periodic.conf? +# BSDSTATS_MONTHLY_DEVICES | Would you like to send a list of installed hardware as well? +# BSDSTATS_MONTHLY_PORTS | Would you like to send a list of installed ports as well? +# BSDSTATS_MONTHLY_NOW | Would you like to run it now? +# BSDSTATS_REBOOT_REPORTING | Would you like to enable reporting on bootup in /etc/rc.conf? + +if [ -n "$PACKAGE_BUILDING" ]; then + BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=no} + BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=no} + BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=no} + BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=no} + BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no} +else + 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:=yes} +fi ask() { - local question default answer + local question default answer - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ -z "${answer}" ]; then - answer=${default} - fi - echo ${answer} + question=$1 + default=$2 + if [ -z "$BATCH" -a -z "$PACKAGE_BUILDING" ]; then + read -p "$question [$default]? " answer + fi + if [ -z "$answer" ]; then + answer=$default + fi + echo $answer } yesno() { - local question default answer + local question default answer - question=$1 - default=$2 - while :; do - answer=$(ask "${question}" "${default}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done + question=$1 + default=$2 + while :; do + answer=$(ask "$question" "$default") + case "$answer" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done } if [ "$2" = "POST-INSTALL" ]; 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 - fi - if yesno "Would you like to send a list of installed ports as well" ${BSDSTATS_MONTHLY_PORTS}; then - echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf - fi - if yesno "Would you like to run it now" ${BSDSTATS_MONTHLY_NOW}; then - ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay - fi - fi - fi - if [ ! -f "/etc/rc.conf" ] || [ -z "`grep bsdstats_enable /etc/rc.conf`" ]; then - echo "" - 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 "" - 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 + 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 + fi + if yesno "Would you like to send a list of installed ports as well" $BSDSTATS_MONTHLY_PORTS; then + echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf + fi + if yesno "Would you like to run it now" $BSDSTATS_MONTHLY_NOW; then + ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay + fi + fi + fi + if [ ! -f "/etc/rc.conf" ] || [ -z "`grep bsdstats_enable /etc/rc.conf`" ]; then + echo + 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 + 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 fi