Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jan 2012 00:20:25 +0100 (CET)
From:      Olli Hauer <ohauer@FreeBSD.org>
To:        <FreeBSD-gnats-submit@FreeBSD.org>
Cc:        "Lev A. Serebryakov" <lev@FreeBSD.org>
Subject:   ports/164033: [patch] port devel/subversion change pkg-install and pkg-deinstall script
Message-ID:  <20120111232025.2CC6B20828@p578be941.dip0.t-ipconnect.de>
Resent-Message-ID: <201201112330.q0BNUDpP066588@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164033
>Category:       ports
>Synopsis:       [patch] port devel/subversion ports change pkg-install and pkg-deinstall script
>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:   Wed Jan 11 23:30:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Olli Hauer
>Release:        
>Organization:
>Environment:


>Description:
The pkg-install script should be more expilzit.

The pkg-deinstall script should only check for LoadModule (apache20/22/24),
AddModule was only used for apache13.

Also during deinstall the changed script will cleanup lines prefixed with `#'
and is tolerant against reformating httpd.conf by the user.


>How-To-Repeat:
- change spacing in httpd.conf and install subversion
  (add additional tab/spaces in the Line LoadModule dav_module)

- prefix a subversion module line with `#' and deinstall subversion


>Fix:

--- patch_subversion.txt begins here ---
Index: subversion/files/pkg-deinstall.in
===================================================================
RCS file: /home/pcvs/ports/devel/subversion/files/pkg-deinstall.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-deinstall.in
--- subversion/files/pkg-deinstall.in	19 Apr 2010 10:39:12 -0000	1.1
+++ subversion/files/pkg-deinstall.in	11 Jan 2012 22:47:46 -0000
@@ -51,15 +51,12 @@
 
 for i in ${conffile}; do
 	echo -n Removing dav_svn_module, authz_svn_module and dontdothat_module from $i in config dir: ${confdir}...
-	awk '{if (!/^LoadModule dav_svn_module/    && 
-		  !/^AddModule mod_dav_svn.c/      && \
-		  !/^LoadModule authz_svn_module/  && \
-		  !/^AddModule mod_authz_svn.c/    && \
-		  !/^LoadModule dontdothat_module/ && \
-		  !/^AddModule mod_dontdothat.c/    ) \
+	awk '{if (!/LoadModule[[:blank:]]+dav_svn_module/    &&
+		  !/LoadModule[[:blank:]]+authz_svn_module/  &&
+		  !/LoadModule[[:blank:]]+dontdothat_module/ )
 	    print $0}' < "${confdir}/$i" > "${tmpdir}/$i"
 	AWKRC=$?
-	diff "${confdir}/$i" "${tmpdir}/$i" | grep "^[<>]" | grep -Evq "^< (Load|Add)Module "
+	diff "${confdir}/$i" "${tmpdir}/$i" | grep "^[<>]" | sed -e 's/#//g' | grep -Evq "^<[[:blank:]]+LoadModule"
 	GREPRC=$?
 	# last grep should not find anything
 	if [ "x${AWKRC}" = "x0" -a "x${GREPRC}" = "x1"  ] ; then
Index: subversion/files/pkg-install.in
===================================================================
RCS file: /home/pcvs/ports/devel/subversion/files/pkg-install.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install.in
--- subversion/files/pkg-install.in	19 Apr 2010 10:39:12 -0000	1.1
+++ subversion/files/pkg-install.in	11 Jan 2012 22:47:46 -0000
@@ -43,7 +43,7 @@
 fi
 
 # use only 'egrep -e' else the check works not correct
-if [ ! -n "`egrep -e '^(Load|Add)Module.*dav_module' ${SYSCONFDIR}/${CONFFILE}`" ]; then
+if [ ! -n "`egrep -e '^LoadModule[[:blank:]]+dav_module' ${SYSCONFDIR}/${CONFFILE}`" ]; then
 	if [ -f ${LIBEXECDIR}/mod_dav.so ]; then
 		${APXSCMD} -e -S LIBEXECDIR=${LIBEXECDIR} -a -n dav ${LIBEXECDIR}/mod_dav.so
 	else
Index: subversion16/files/pkg-deinstall.in
===================================================================
RCS file: /home/pcvs/ports/devel/subversion16/files/pkg-deinstall.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-deinstall.in
--- subversion16/files/pkg-deinstall.in	19 Apr 2010 10:39:12 -0000	1.1
+++ subversion16/files/pkg-deinstall.in	11 Jan 2012 22:47:46 -0000
@@ -51,15 +51,12 @@
 
 for i in ${conffile}; do
 	echo -n Removing dav_svn_module, authz_svn_module and dontdothat_module from $i in config dir: ${confdir}...
-	awk '{if (!/^LoadModule dav_svn_module/    && 
-		  !/^AddModule mod_dav_svn.c/      && \
-		  !/^LoadModule authz_svn_module/  && \
-		  !/^AddModule mod_authz_svn.c/    && \
-		  !/^LoadModule dontdothat_module/ && \
-		  !/^AddModule mod_dontdothat.c/    ) \
+	awk '{if (!/LoadModule[[:blank:]]+dav_svn_module/    &&
+		  !/LoadModule[[:blank:]]+authz_svn_module/  &&
+		  !/LoadModule[[:blank:]]+dontdothat_module/ )
 	    print $0}' < "${confdir}/$i" > "${tmpdir}/$i"
 	AWKRC=$?
-	diff "${confdir}/$i" "${tmpdir}/$i" | grep "^[<>]" | grep -Evq "^< (Load|Add)Module "
+	diff "${confdir}/$i" "${tmpdir}/$i" | grep "^[<>]" | sed -e 's/#//g' | grep -Evq "^<[[:blank:]]+LoadModule"
 	GREPRC=$?
 	# last grep should not find anything
 	if [ "x${AWKRC}" = "x0" -a "x${GREPRC}" = "x1"  ] ; then
Index: subversion16/files/pkg-install.in
===================================================================
RCS file: /home/pcvs/ports/devel/subversion16/files/pkg-install.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-install.in
--- subversion16/files/pkg-install.in	19 Apr 2010 10:39:12 -0000	1.1
+++ subversion16/files/pkg-install.in	11 Jan 2012 22:47:46 -0000
@@ -43,7 +43,7 @@
 fi
 
 # use only 'egrep -e' else the check works not correct
-if [ ! -n "`egrep -e '^(Load|Add)Module.*dav_module' ${SYSCONFDIR}/${CONFFILE}`" ]; then
+if [ ! -n "`egrep -e '^LoadModule[[:blank:]]+dav_module' ${SYSCONFDIR}/${CONFFILE}`" ]; then
 	if [ -f ${LIBEXECDIR}/mod_dav.so ]; then
 		${APXSCMD} -e -S LIBEXECDIR=${LIBEXECDIR} -a -n dav ${LIBEXECDIR}/mod_dav.so
 	else
--- patch_subversion.txt ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120111232025.2CC6B20828>