From owner-freebsd-ports@FreeBSD.ORG Fri Jan 4 15:52:28 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDC80BB9 for ; Fri, 4 Jan 2013 15:52:28 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by mx1.freebsd.org (Postfix) with ESMTP id B52229EE for ; Fri, 4 Jan 2013 15:52:28 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id k13so19803288iea.22 for ; Fri, 04 Jan 2013 07:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cp0pTXb9xfA0dLG1MAnJrzj0YmH5P6KnSQDPetoFsjE=; b=wQXpuKWlJRr/lf3fh3dCYgm6MscP0u5Zpwf6/LEhTQwrbUrELElgMWBmYilxgeqqeK tQAYojB50DREAGAgCEh5d3QqaHvtEvT5+f2mGWwnOKV2GxHyS34rFqL5vaJrJePo9fny uadjA/C173P6NqqWogIaH97o1KdOKjVoonRQ8ZGC/jLLQ/Pkxt8DN9g/M0KBmsHaK+L4 tvDP3pWNI7l7sLCIAGVUoC+v0oqZoLb5UbFGDQliFGpisx+dnZlgu+DC4CSyd8KGUg/h +WZ5jnlSukTQcbLh6D/ybMdFoSWAofbNJAHDHXrPaRNSj9gaJ7QIPvu41Prpi7K6UDxT 1VZA== MIME-Version: 1.0 Received: by 10.50.190.163 with SMTP id gr3mr41162151igc.106.1357314747918; Fri, 04 Jan 2013 07:52:27 -0800 (PST) Received: by 10.50.49.3 with HTTP; Fri, 4 Jan 2013 07:52:27 -0800 (PST) In-Reply-To: <50E6A021.9000203@gmx.de> References: <50E49A73.2070008@quip.cz> <50E5FCDA.80906@quip.cz> <50E6A021.9000203@gmx.de> Date: Fri, 4 Jan 2013 09:52:27 -0600 Message-ID: Subject: Re: What is policy about auto-editing config files on port install / deinstall? From: Scot Hetzel To: olli hauer Content-Type: text/plain; charset=ISO-8859-1 Cc: Miroslav Lachman <000.fbsd@quip.cz>, freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 15:52:28 -0000 On Fri, Jan 4, 2013 at 3:25 AM, olli hauer wrote: >>> 456 @${ECHO} "@unexec ${SED} -i '' -E >>> '/LoadModule[[:blank:]]+%%AP_NAME%%_module/d' >>> %D/%%APACHEETCDIR%%/httpd.conf" >> ${PLIST} >> >> Found the reason for this sed line, as it is used to remove the >> LoadModule line from the httpd.conf file so that when Apache is >> uninstalled, the httpd.conf could be removed, if there were no changes >> from the original. >> >> see http://svnweb.freebsd.org/ports?view=revision&revision=194395 >> >> I still think it is better to disable the module on uninstall, and >> enable the module on install. >> > > Hi Scot, > > have you also read the commit log? > - Fix leftover httpd.conf for AP_GEN_PLIST using ports. The problem is that > apxs does not remove module line from httpd.conf, it merely comments it out. > Later, on Apache deinstall, the file differs from stock httpd.conf and is not > deleted. > I had read the commit log and still think it is wrong to remove the LoadModule lines from the httpd.conf file, as the LoadModule line may not be the only change to the httpd.conf file for that module. How difficult would it be to create 2 temp files by striping all the comments out of the httpd.conf* files, then compare those files to determine if httpd.conf should be removed. > The issue is the following. > In case the LoadModule line is not removed from httpd.conf the port will be marked as broken by the ports build system. > > > I'm thinking about an parameter which change the semantic in bsd.apache.mk so the module can be installed enabled. > For example the following will do that (quick hack) > > Index: bsd.apache.mk > =================================================================== > --- bsd.apache.mk (revision 309921) > +++ bsd.apache.mk (working copy) > @@ -455,7 +445,11 @@ > # apache22 > @${ECHO} "@unexec ${SED} -i '' -E '/LoadModule[[:blank:]]+%%AP_NAME%%_module/d' %D/%%APACHEETCDIR%%/httpd.conf" >> ${PLIST} > @${ECHO} "%%APACHEMODDIR%%/%%AP_MODULE%%" >> ${PLIST} > +.if defined(AP_MODENABLE) > + @${ECHO} "@exec %D/sbin/apxs -e -a -n %%AP_NAME%% %D/%F" >> ${PLIST} > +.else > @${ECHO} "@exec %D/sbin/apxs -e -A -n %%AP_NAME%% %D/%F" >> ${PLIST} > +.endif > @${ECHO} "@unexec echo \"Don't forget to remove all ${MODULENAME}-related directives in your httpd.conf\"">> ${PLIST} > . endif > .else > > That could work, how about putting a .if !defined(AP_MODENABLE) .. .endif around the SED line, and adding @unexec %D/sbin/apxs -e -A -n %%AP_NAME%% %D/%F" >> ${PLIST} in the .if defined(AP_MODENABLE) .. .else. Of course the do-install target would also need to be changed to have .if defined(AP_MODENABLE) enable module .else disable module .endif upon install. -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.