From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Nov 2 07:50:13 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B90E106566C for ; Tue, 2 Nov 2010 07:50:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E8F7E8FC1F for ; Tue, 2 Nov 2010 07:50:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA27oCKb036719 for ; Tue, 2 Nov 2010 07:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA27oC0i036718; Tue, 2 Nov 2010 07:50:12 GMT (envelope-from gnats) Date: Tue, 2 Nov 2010 07:50:12 GMT Message-Id: <201011020750.oA27oC0i036718@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Panagiotis Christias Cc: Subject: Re: ports/151837: [patch] sysutils/bsdstats : does honor BATCH when installed from package X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Panagiotis Christias List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2010 07:50:13 -0000 The following reply was made to PR ports/151837; it has been noted by GNATS. From: Panagiotis Christias To: bug-followup@FreeBSD.org Cc: wen heping , Panagiotis Christias Subject: Re: ports/151837: [patch] sysutils/bsdstats : does honor BATCH when installed from package Date: Tue, 02 Nov 2010 09:43:05 +0200 This is a multi-part message in MIME format. --------------050104040100060901020200 Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit oops, forgot an "#!/bin/sh -x", resending. -- Panagiotis J. Christias Network Management Center p.christias@noc.ntua.gr National Technical Univ. of Athens, GREECE --------------050104040100060901020200 Content-Type: text/plain; name="bsdstats.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bsdstats.diff.txt" diff -Nur bsdstats.orig/Makefile bsdstats/Makefile --- bsdstats.orig/Makefile 2010-08-19 06:06:13.000000000 +0300 +++ bsdstats/Makefile 2010-11-02 09:03:03.000000000 +0200 @@ -7,7 +7,7 @@ PORTNAME= bsdstats PORTVERSION= 5.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils DISTFILES= @@ -16,21 +16,14 @@ NO_BUILD= yes USE_RC_SUBR= bsdstats -SUB_FILES= 300.statistics pkg-message +SUB_LIST= SH=${SH} PKGINSTALL=${PKGINSTALL} PKGNAME=${PKGNAME} +SUB_FILES= 300.statistics pkg-message pkg-install do-install: ${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} -.else @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL -.endif .include diff -Nur bsdstats.orig/files/pkg-install.in bsdstats/files/pkg-install.in --- bsdstats.orig/files/pkg-install.in 1970-01-01 02:00:00.000000000 +0200 +++ bsdstats/files/pkg-install.in 2010-11-02 09:03:03.000000000 +0200 @@ -0,0 +1,103 @@ +#!/bin/sh +# +# pkg-install : based off ${PORTSDIR}/mail/courier/files/pkg-install.in +# +LOCALBASE=${LOCALBASE:=/usr/local} + +ask() { + 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} +} + +yesno() { + 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 +} + +if [ ":$2" = ":POST-INSTALL" ]; then + if [ -n "${BATCH}" -o -n "${PACKAGE_BUILDING}" ]; then + if [ ":$OSVERSION" != ":" ]; then + echo + echo "To activate monthly statistics reporting in /etc/periodic.conf," + echo "execute the following as root user:" + echo + echo "PKG_PREFIX=\"%%PREFIX%%\" %%SH%% %%PKGINSTALL%% %%PKGNAME%% POST-INSTALL" + echo + fi + exit 0 + fi + if [ -f "/etc/periodic.conf" ]; then + if [ `grep monthly_statistics /etc/periodic.conf | wc -l` = 0 ]; then + if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then + echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf + if yesno "Would you like to send a list of installed hardware as well" n; 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" n; then + echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf + fi + if yesno "Would you like to run it now" y; then + ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay + fi + fi + fi + elif [ ! -f "/etc/periodic.conf" ]; then + if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then + echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf + if yesno "Would you like to send a list of installed hardware as well" n; 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" n; then + echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf + fi + if yesno "Would you like to run it now" y; then + ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay + fi + fi + fi + if [ -f "/etc/rc.conf" ]; then + if [ `grep bsdstats_enable /etc/rc.conf | wc -l` = 0 ]; 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 "" + 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" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi + elif [ ! -f "/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 "" + 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" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi +fi + diff -Nur bsdstats.orig/pkg-install bsdstats/pkg-install --- bsdstats.orig/pkg-install 2007-12-20 06:39:11.000000000 +0200 +++ bsdstats/pkg-install 1970-01-01 02:00:00.000000000 +0200 @@ -1,92 +0,0 @@ -#!/bin/sh -# -# pkg-install : based off ${PORTSDIR}/mail/courier/files/pkg-install.in -# -LOCALBASE=${LOCALBASE:=/usr/local} - -ask() { - 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} -} - -yesno() { - 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 -} - -if [ ":$2" = ":POST-INSTALL" ]; then - if [ -f "/etc/periodic.conf" ]; then - if [ `grep monthly_statistics /etc/periodic.conf | wc -l` = 0 ]; then - if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then - echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf - if yesno "Would you like to send a list of installed hardware as well" n; 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" n; then - echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf - fi - if yesno "Would you like to run it now" y; then - ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay - fi - fi - fi - elif [ ! -f "/etc/periodic.conf" ]; then - if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then - echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf - if yesno "Would you like to send a list of installed hardware as well" n; 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" n; then - echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf - fi - if yesno "Would you like to run it now" y; then - ${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay - fi - fi - fi - if [ -f "/etc/rc.conf" ]; then - if [ `grep bsdstats_enable /etc/rc.conf | wc -l` = 0 ]; 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 "" - 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" n; then - echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf - fi - fi - elif [ ! -f "/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 "" - 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" n; then - echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf - fi - fi -fi - --------------050104040100060901020200--