From owner-freebsd-ports-bugs@FreeBSD.ORG Sun May 12 13:30:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82716CFC for ; Sun, 12 May 2013 13:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 68BCBB6A for ; Sun, 12 May 2013 13:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4CDU0oa000705 for ; Sun, 12 May 2013 13:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4CDU0j2000704; Sun, 12 May 2013 13:30:00 GMT (envelope-from gnats) Resent-Date: Sun, 12 May 2013 13:30:00 GMT Resent-Message-Id: <201305121330.r4CDU0j2000704@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Claudius Herder Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0AF5CE6 for ; Sun, 12 May 2013 13:28:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.FreeBSD.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id E1D9DB61 for ; Sun, 12 May 2013 13:28:20 +0000 (UTC) Received: from oldred.FreeBSD.org ([127.0.1.6]) by oldred.FreeBSD.org (8.14.5/8.14.5) with ESMTP id r4CDSKdK063682 for ; Sun, 12 May 2013 13:28:20 GMT (envelope-from nobody@oldred.FreeBSD.org) Received: (from nobody@localhost) by oldred.FreeBSD.org (8.14.5/8.14.5/Submit) id r4CDSKNu063681; Sun, 12 May 2013 13:28:20 GMT (envelope-from nobody) Message-Id: <201305121328.r4CDSKNu063681@oldred.FreeBSD.org> Date: Sun, 12 May 2013 13:28:20 GMT From: Claudius Herder To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/178532: [PATCH] sysutils/munin-node: add PORT_OPTIONS for SNMP and CIDR, remove interactive questions from pkg-install and pkg-deinstall, remove initscripts from pkg-install X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 May 2013 13:30:00 -0000 >Number: 178532 >Category: ports >Synopsis: [PATCH] sysutils/munin-node: add PORT_OPTIONS for SNMP and CIDR, remove interactive questions from pkg-install and pkg-deinstall, remove initscripts from pkg-install >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun May 12 13:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Claudius Herder >Release: FreeBSD 9.1-STABLE FreeBSD 9.1-STABLE #1 r250556: Sun May 12 11:38:33 CEST >Organization: >Environment: >Description: Add PORT_OPTIONS for optional SNMP and CIDR dependencies. I would like to see the interactive questions removed from munin-node. Answering the same questions with every update is quite annoying and forces commands like portmaster -af to wait for userinput everytime. In my opinion running munin-node-configure --shell |sh -x with every update is also not optimal. For example I only use postgres_*_ALL, with the current implementation I have to remove > 50 plugins after updating. >How-To-Repeat: >Fix: Patch attached with submission follows: ===> Updating from SVN Updating '.': At revision 317951. ===> Generating patch ===> Viewing diff with more Index: Makefile =================================================================== --- Makefile (revision 317951) +++ Makefile (working copy) @@ -15,14 +15,11 @@ p5-DateTime-HiRes>=0:${PORTSDIR}/devel/p5-DateTime-HiRes \ munin-common>=0:${PORTSDIR}/sysutils/munin-common \ p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \ - p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP \ bash:${PORTSDIR}/shells/bash RUN_DEPENDS= p5-Cache-Cache>=0:${PORTSDIR}/devel/p5-Cache-Cache \ p5-DateTime-HiRes>=0:${PORTSDIR}/devel/p5-DateTime-HiRes \ munin-common>=0:${PORTSDIR}/sysutils/munin-common \ p5-Net-Server>=0:${PORTSDIR}/net/p5-Net-Server \ - p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP \ - p5-Net-CIDR>=0:${PORTSDIR}/net-mgmt/p5-Net-CIDR \ bash:${PORTSDIR}/shells/bash DISTINFO_FILE= ${MUNIN_DISTINFO} @@ -39,6 +36,22 @@ ALL_TARGET= build-node build-plugins INSTALL_TARGET= install-node-prime install-plugins-prime +OPTIONS_DEFINE= SNMP CIDR +OPTIONS_DEFAULT= SNMP CIDR +SNMP_DESC= Include support for SNMP plugins +CIDR_DESC= Enable support for CIDR notation in munin-node.conf + +.include + +.if ${PORT_OPTIONS:MSNMP} +BUILD_DEPENDS+= p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP +RUN_DEPENDS+= p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP +.endif + +.if ${PORT_OPTIONS:MCIDR} +RUN_DEPENDS+= p5-Net-CIDR>=0:${PORTSDIR}/net-mgmt/p5-Net-CIDR +.endif + MAN1= munin-node-configure.1 \ munin-node.1 \ munin-run.1 \ Index: files/pkg-message.in =================================================================== --- files/pkg-message.in (revision 317951) +++ files/pkg-message.in (working copy) @@ -17,3 +17,8 @@ %%PREFIX%%/etc/rc.d/munin-node start ******************************************************************** + +For a list of plugins that will probably work run +%%PREFIX%%/sbin/munin-node-configure --suggest +or +%%PREFIX%%/sbin/munin-node-configure --shell | sh -x to install them automatically Index: pkg-deinstall =================================================================== --- pkg-deinstall (revision 317951) +++ pkg-deinstall (working copy) @@ -1,34 +1,5 @@ #! /bin/sh -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - stop_process() { STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node @@ -51,10 +22,9 @@ exit 0 elif [ "$ENTRY" = "$DEFAULT" ]; then delnewsyslog - elif yesno "You have changed the default munin-node entry in \"/etc/newsyslog.conf\". -Do you want me to delete it?" y; then - delnewsyslog - echo "Done." + else + echo "You have changed the default munin-node entry in \"/etc/newsyslog.conf\"". + echo "If you deinstall munin-node permanently, you have to manually remove it" fi } Index: pkg-install =================================================================== --- pkg-install (revision 317951) +++ pkg-install (working copy) @@ -29,21 +29,6 @@ done } -init_plugins() { - if [ -f /tmp/.munin-node.version ]; then - prevver=$(cat /tmp/.munin-node.version) - fi - - if [ -n "$prevver" ]; then - echo -n "Initializing new plugins.." - ${PKG_PREFIX}/sbin/munin-node-configure --shell --newer "${prevver%-*}" | sh -x - else - echo -n "Initializing plugins.." - ${PKG_PREFIX}/sbin/munin-node-configure --shell | sh -x - fi - echo "done." -} - create_crontab_entries() { local sched prog sched=$1 @@ -65,7 +50,6 @@ } newsyslog() { - if yesno "Would you like me to set up log rotation" y; then if grep -q /var/log/munin/munin-node.log /etc/newsyslog.conf; then : else @@ -73,9 +57,6 @@ /var/log/munin/munin-node.log 644 7 * @T00 Z /var/run/munin/munin-node.pid EOT fi - else - echo "/var/log/munin-node.log will grow without bounds." - fi } @@ -86,7 +67,6 @@ ;; POST-INSTALL) if [ -z "${PACKAGE_BUILDING}" ]; then - init_plugins ${PKG_PREFIX}/etc/rc.d/munin-node start newsyslog fi ===> Done >Release-Note: >Audit-Trail: >Unformatted: