From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Apr 30 21:50: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 BF1F49D6 for ; Tue, 30 Apr 2013 21:50: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 A09721B18 for ; Tue, 30 Apr 2013 21:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ULo0Cj041200 for ; Tue, 30 Apr 2013 21:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r3ULo0UA041199; Tue, 30 Apr 2013 21:50:00 GMT (envelope-from gnats) Resent-Date: Tue, 30 Apr 2013 21:50:00 GMT Resent-Message-Id: <201304302150.r3ULo0UA041199@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, Chris Rees Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABCF8889 for ; Tue, 30 Apr 2013 21:47:14 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mk-outboundfilter-5.mail.uk.tiscali.com (mk-outboundfilter-5.mail.uk.tiscali.com [212.74.114.1]) by mx1.freebsd.org (Postfix) with ESMTP id F1BAE1AE8 for ; Tue, 30 Apr 2013 21:47:12 +0000 (UTC) Received: from host-80-43-136-232.as13285.net (HELO pegasus.bayofrum.net) ([80.43.136.232]) by smtp.pipex.tiscali.co.uk with ESMTP; 30 Apr 2013 22:46:39 +0100 Received: by pegasus.bayofrum.net (Postfix, from userid 1001) id 3C6E4223E8; Tue, 30 Apr 2013 22:45:14 +0100 (BST) Message-Id: <20130430214514.3C6E4223E8@pegasus.bayofrum.net> Date: Tue, 30 Apr 2013 22:45:14 +0100 (BST) From: Chris Rees To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/178269: [PATCH] Remove checks for get_pidfile_from_conf function X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Chris Rees List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2013 21:50:00 -0000 >Number: 178269 >Category: ports >Synopsis: [PATCH] Remove checks for get_pidfile_from_conf function >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: Tue Apr 30 21:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Chris Rees >Release: FreeBSD 9.1-STABLE amd64 >Organization: >Environment: System: FreeBSD pegasus.bayofrum.net 9.1-STABLE FreeBSD 9.1-STABLE #0 r247189: Sat Feb 23 15:20:18 GMT 2013 root@pegasus.bayofrum.net:/usr/obj/usr/home/crees/workspace/src/stable/9/sys/PEGASUS amd64 >Description: The function get_pidfile_from_conf was added to base before 8.3-RELEASE, and so it needed wrapping in tests to ensure it was available. It is now available on all supported releases, but uptake has been poor. I suspect it may be something to do with the if type get_pidfile_from_conf incantation, so I've done a sweep of the ports tree and removed all occurrences. >How-To-Repeat: >Fix: (mostly cosmetic changes to please rclint, hence no revision bump) --- patch.txt begins here --- Index: audio/musicpd/files/musicpd.in =================================================================== --- audio/musicpd/files/musicpd.in (revision 316967) +++ audio/musicpd/files/musicpd.in (working copy) @@ -27,8 +27,7 @@ musicpd_getpidfile() { - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf pid_file %%PREFIX%%/etc/musicpd.conf ; then + if get_pidfile_from_conf pid_file %%PREFIX%%/etc/musicpd.conf ; then pidfile="$_pidfile_from_conf" else pidfile="%%MPDDIR%%/.mpd/pid" Index: net-mgmt/hawk/files/hawk.in =================================================================== --- net-mgmt/hawk/files/hawk.in (revision 316967) +++ net-mgmt/hawk/files/hawk.in (working copy) @@ -19,23 +19,21 @@ load_rc_config hawk -: ${hawk_enable:="NO"} +: ${hawk_enable:=NO} command=%%PREFIX%%/sbin/hawk command_interpreter=%%PERL%% command_args='&' +start_precmd=find_pidfile +stop_precmd=find_pidfile find_pidfile() { - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf pidfile %%PREFIX%%/etc/hawk/daemon.conf; then + if get_pidfile_from_conf pidfile %%PREFIX%%/etc/hawk/daemon.conf; then pidfile="$_pidfile_from_conf" else - pidfile='/var/run/hawk.pid' + pidfile=/var/run/hawk.pid fi } -start_precmd=find_pidfile -stop_precmd=find_pidfile - -run_rc_command "$1" +run_rc_command $1 Index: net-mgmt/nrpe2/files/nrpe2.in =================================================================== --- net-mgmt/nrpe2/files/nrpe2.in (revision 316967) +++ net-mgmt/nrpe2/files/nrpe2.in (working copy) @@ -17,7 +17,7 @@ name=nrpe2 rcvar=nrpe2_enable -load_rc_config "${name}" +load_rc_config nrpe2 : ${nrpe2_enable:=NO} : ${nrpe2_configfile:=%%PREFIX%%/etc/nrpe.cfg} @@ -26,7 +26,7 @@ command="%%PREFIX%%/sbin/nrpe2" command_args="-c ${nrpe2_configfile} -d" -extra_commands="reload" +extra_commands=reload sig_reload=HUP start_precmd=nrpe2_prestart @@ -37,8 +37,7 @@ [ -n "$nrpe2_pidfile" ] && warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]" - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then + if get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then pidfile="$_pidfile_from_conf" else pidfile='/var/run/nrpe2/nrpe2.pid' @@ -51,4 +50,4 @@ install -d -o ${nrpe_user:-nagios} ${pidfile%/*} } -run_rc_command "$1" +run_rc_command $1 Index: sysutils/munin-node/files/munin-node.in =================================================================== --- sysutils/munin-node/files/munin-node.in (revision 316967) +++ sysutils/munin-node/files/munin-node.in (working copy) @@ -15,7 +15,7 @@ . /etc/rc.subr -name="munin_node" +name=munin_node rcvar=munin_node_enable load_rc_config $name @@ -31,12 +31,8 @@ find_pidfile() { - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf pid_file $munin_node_config; then - pidfile="$_pidfile_from_conf" - else - pidfile=`awk '$1 == "pid_file" { print $2 }' $munin_node_config` - fi + get_pidfile_from_conf pid_file $munin_node_config + pidfile="$_pidfile_from_conf" } -run_rc_command "$1" +run_rc_command $1 Index: sysutils/munin-node/files/munin-sched.in =================================================================== --- sysutils/munin-node/files/munin-sched.in (revision 316967) +++ sysutils/munin-node/files/munin-sched.in (working copy) @@ -15,7 +15,7 @@ . /etc/rc.subr -name="munin_sched" +name=munin_sched rcvar=munin_sched_enable load_rc_config $name @@ -30,13 +30,9 @@ find_pidfile() { - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf pid_file $munin_sched_config; then + get_pidfile_from_conf pid_file $munin_sched_config pidfile="${_pidfile_from_conf%node*}sched" pidfile="${pidfile}${_pidfile_from_conf#*node}" - else - pidfile=`awk '$1 == "pid_file" { gsub("node","sched",$2); print $2; }' $munin_sched_config` - fi } run_rc_command "$1" Index: x11/slim/files/slim.in =================================================================== --- x11/slim/files/slim.in (revision 316967) +++ x11/slim/files/slim.in (working copy) @@ -17,31 +17,29 @@ . /etc/rc.subr -name="slim" +name=slim rcvar=slim_enable +load_rc_config slim + +: ${slim_enable:=NO} + +command=%%PREFIX%%/bin/slim +command_args=-d start_precmd=${name}_rmfile stop_precmd=${name}_prestop stop_postcmd=${name}_rmfile -load_rc_config $name - -: ${slim_enable="NO"} - -command=%%PREFIX%%/bin/slim -command_args="-d" - find_pidfile() { - if type get_pidfile_from_conf >/dev/null 2>&1 && - get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then + if get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then pidfile="$_pidfile_from_conf" else pidfile="/var/run/${name}.pid" fi } -slim_rmfile () +slim_rmfile() { local file @@ -55,7 +53,7 @@ return 0 } -slim_prestop () +slim_prestop() { local xpid @@ -65,4 +63,4 @@ [ -n "$xpid" ] && kill $xpid } -run_rc_command "$1" +run_rc_command $1 --- patch.txt ends here --- -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. >Release-Note: >Audit-Trail: >Unformatted: