From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Sep 25 07:10:02 2007 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 40B1316A41B for ; Tue, 25 Sep 2007 07:10:02 +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 11F9D13C457 for ; Tue, 25 Sep 2007 07:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8P7A15g038595 for ; Tue, 25 Sep 2007 07:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8P7A1F5038590; Tue, 25 Sep 2007 07:10:01 GMT (envelope-from gnats) Resent-Date: Tue, 25 Sep 2007 07:10:01 GMT Resent-Message-Id: <200709250710.l8P7A1F5038590@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, Eygene Ryabinkin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DC3716A421 for ; Tue, 25 Sep 2007 07:02:27 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id C5E3A13C455 for ; Tue, 25 Sep 2007 07:02:26 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by pobox.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256) id 1Ia4R7-000LhF-RG; Tue, 25 Sep 2007 11:02:25 +0400 Message-Id: <20070925070225.57FB21AF41C@void.codelabs.ru> Date: Tue, 25 Sep 2007 11:02:25 +0400 (MSD) From: Eygene Ryabinkin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: clement@FreeBSD.org Subject: ports/116627: [patch] www/apache22: completely shut up rc.d script when no profiles are enabled X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eygene Ryabinkin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 07:10:02 -0000 >Number: 116627 >Category: ports >Synopsis: [patch] www/apache22: completely shut up rc.d script when no profiles are enabled >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 Sep 25 07:10:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Eygene Ryabinkin >Release: FreeBSD 7.0-CURRENT i386 >Organization: Code Labs >Environment: System: FreeBSD XXX 7.0-CURRENT FreeBSD 7.0-CURRENT #10: Wed Sep 12 16:16:49 MSD 2007 root@XXX:/usr/src/sys/i386/compile/XXX i386 >Description: If one has a number of Apache profiles, but has apache22_enable set to NO, rc.d script still prints the names of the profiles (but, of cource, does no further actions). This is a bit annoying as it can provoke the thoughts that something gone terribly wrong. >How-To-Repeat: Add a couple of Apache profiles, do not set individual values for apache22__enable and set apache22_enable to NO. Run /usr/local/etc/rc.d/apache22 start and see the profile banners. The same effect can be achieved if not all apache22__enable are set to 'yes': rc.d script will still output names of all profiles. >Fix: The following patch fixes the situation. Furthermore, it checks the apache22*_enable values to be 'yes', 'no' or 'none' and issues warning if some variable has the other value. --- apache22.sh.in.respect-enable.patch begins here --- --- apache22.sh.in.orig 2007-09-25 09:55:57.000000000 +0400 +++ apache22.sh.in 2007-09-25 10:54:20.000000000 +0400 @@ -89,6 +89,26 @@ else if [ "x${apache22_profiles}" != "x" -a "x$1" != "x" ]; then for profile in ${apache22_profiles}; do + eval _enable="\${apache22_${profile}_enable}" + case "x${_enable:-${apache22_enable}}" in + x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee]) + continue + ;; + x[Yy][Ee][Ss]) + ;; + *) + if test -z "$_enable"; then + _var=apache22_enable + else + _var=apache22_"${profile}"_enable + fi + echo "Bad value" \ + "'${_enable:-${apache22_enable}}'" \ + "for ${_var}. " \ + "Profile ${profile} skipped." + continue + ;; + esac echo "===> apache22 profile: ${profile}" %%PREFIX%%/etc/rc.d/apache22%%RC_SUBR_SUFFIX%% $1 ${profile} retcode="$?" --- apache22.sh.in.respect-enable.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: