ports/106426: www/Privoxy port upgrade clobbers existing config file
Fabian Keil
fk at fabiankeil.de
Sat Dec 9 21:30:17 UTC 2006
The following reply was made to PR ports/106426; it has been noted by GNATS.
From: Fabian Keil <fk at fabiankeil.de>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/106426: www/Privoxy port upgrade clobbers existing config
file
Date: Sat, 9 Dec 2006 22:19:16 +0100
--MP_w4XnBxLQVQApSHLlQqMucO_
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
The "clobbering" was documented in pkg-message.in.
Anyway, the attached update:
- Copies the config file as example file and
leaves old versions unmodified. The rc script later
copies the example if the config file is missing.
(Requested by Pete Slagle)
- Makes the make output less noisy.
- Compiles with TOGGLE option disabled.
(Thanks to Peter Thoenen for reporting)
--MP_w4XnBxLQVQApSHLlQqMucO_
Content-Type: text/x-patch; name=privoxy-3.0.6-1.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=privoxy-3.0.6-1.diff
diff -ruN www/privoxy/Makefile www/privoxy-3.0.6-1/Makefile
--- www/privoxy/Makefile Wed Dec 6 09:52:27 2006
+++ www/privoxy-3.0.6-1/Makefile Sat Dec 9 19:53:52 2006
@@ -7,6 +7,7 @@
PORTNAME= privoxy
PORTVERSION= 3.0.6
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ijbswa
@@ -78,25 +79,31 @@
@${MKDIR} ${PREFIX}/etc/privoxy/templates
@${INSTALL_PROGRAM} ${WRKSRC}/privoxy ${PREFIX}/sbin
@${INSTALL_DATA} ${WRKSRC}/templates/[a-z]* ${PREFIX}/etc/privoxy/templates
-.for file in config default.action standard.action default.filter trust
- @${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/etc/privoxy
+.for defaultfile in default.action standard.action default.filter
+ @${INSTALL_DATA} ${WRKSRC}/${defaultfile} ${PREFIX}/etc/privoxy
+ @${CHOWN} privoxy:privoxy ${PREFIX}/etc/privoxy/${defaultfile}
+ @${CHMOD} 0640 ${PREFIX}/etc/privoxy/${defaultfile}
+.endfor
+ @${MKDIR} ${PREFIX}/share/examples/privoxy
+.for examplefile in config trust user.action
+ @${INSTALL_DATA} ${WRKSRC}/${examplefile} ${PREFIX}/share/examples/privoxy
+ @${CHOWN} privoxy:privoxy ${PREFIX}/share/examples/privoxy/${examplefile}
+ @${CHMOD} 0640 ${PREFIX}/share/examples/privoxy/${examplefile}
.endfor
@${INSTALL_MAN} ${WRKSRC}/privoxy.1 ${MANPREFIX}/man/man1
-# @${MKDIR} ${PREFIX}/share/examples/privoxy
-# @${INSTALL_DATA} ${WRKSRC}/user.action ${PREFIX}/share/examples/privoxy
.if !defined(NOPORTDOCS)
@${MKDIR} ${PREFIX}/share/doc/privoxy-manual
- ${INSTALL_DATA} ${WRKSRC}/doc/webserver/user-manual/[a-z]* ${PREFIX}/share/doc/privoxy-manual
- ${INSTALL_DATA} ${WRKSRC}/doc/webserver/p_doc.css ${PREFIX}/share/doc/privoxy-manual
+ @${INSTALL_DATA} ${WRKSRC}/doc/webserver/user-manual/[a-z]* ${PREFIX}/share/doc/privoxy-manual
+ @${INSTALL_DATA} ${WRKSRC}/doc/webserver/p_doc.css ${PREFIX}/share/doc/privoxy-manual
.endif
post-install:
- ${MKDIR} /var/log/privoxy
- ${CHOWN} privoxy:privoxy /var/log/privoxy
- ${CHMOD} 0750 /var/log/privoxy
- ${MKDIR} /var/run/privoxy
- ${CHOWN} privoxy:privoxy /var/run/privoxy
- ${CHMOD} 0750 /var/run/privoxy
+ @${MKDIR} /var/log/privoxy
+ @${CHOWN} privoxy:privoxy /var/log/privoxy
+ @${CHMOD} 0750 /var/log/privoxy
+ @${MKDIR} /var/run/privoxy
+ @${CHOWN} privoxy:privoxy /var/run/privoxy
+ @${CHMOD} 0750 /var/run/privoxy
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff -ruN www/privoxy/files/patch-cgi.c www/privoxy-3.0.6-1/files/patch-cgi.c
--- www/privoxy/files/patch-cgi.c Thu Jan 1 01:00:00 1970
+++ www/privoxy-3.0.6-1/files/patch-cgi.c Sat Dec 9 17:49:09 2006
@@ -0,0 +1,15 @@
+--- cgi.c Mon Nov 13 20:05:50 2006
++++ cgi.c Sat Dec 9 14:49:16 2006
+@@ -571,10 +579,12 @@
+ "Look up which actions apply to a URL and why",
+ TRUE },
+ #ifdef FEATURE_CGI_EDIT_ACTIONS
++#ifdef FEATURE_TOGGLE
+ { "toggle",
+ cgi_toggle,
+ "Toggle Privoxy on or off",
+ FALSE },
++#endif /* def FEATURE_TOGGLE */
+ { "edit-actions", /* Edit the actions list */
+ cgi_edit_actions,
+ NULL, FALSE },
diff -ruN www/privoxy/files/patch-cgiedit.c www/privoxy-3.0.6-1/files/patch-cgiedit.c
--- www/privoxy/files/patch-cgiedit.c Thu Jan 1 01:00:00 1970
+++ www/privoxy-3.0.6-1/files/patch-cgiedit.c Sat Dec 9 17:48:51 2006
@@ -0,0 +1,32 @@
+--- cgiedit.c Tue Jul 18 16:48:45 2006
++++ cgiedit.c Sat Dec 9 14:49:16 2006
+@@ -333,8 +337,10 @@
+ #include "miscutil.h"
+ #include "errlog.h"
+ #include "loaders.h"
+-#include "loadcfg.h"
++#ifdef FEATURE_TOGGLE
+ /* loadcfg.h is for global_toggle_state only */
++#include "loadcfg.h"
++#endif /* def FEATURE_TOGGLE */
+ #include "urlmatch.h"
+
+ const char cgiedit_h_rcs[] = CGIEDIT_H_VERSION;
+@@ -4232,7 +4238,7 @@
+ return cgi_redirect(rsp, target);
+ }
+
+-
++#ifdef FEATURE_TOGGLE
+ /*********************************************************************
+ *
+ * Function : cgi_toggle
+@@ -4300,7 +4306,7 @@
+
+ return template_fill_for_cgi(csp, template_name, exports, rsp);
+ }
+-
++#endif /* def FEATURE_TOGGLE */
+
+ /*********************************************************************
+ *
diff -ruN www/privoxy/files/pkg-message.in www/privoxy-3.0.6-1/files/pkg-message.in
--- www/privoxy/files/pkg-message.in Sat Oct 7 18:47:15 2006
+++ www/privoxy-3.0.6-1/files/pkg-message.in Sat Dec 9 15:46:35 2006
@@ -1,13 +1,6 @@
***********************************************************
-** Privoxy's default configuration file is: **
-** %%PREFIX%%/etc/privoxy/config **
-** It gets overwritten on (re)install, if you make your **
-** own modifications, you should rename it first. **
-** **
** To start Privoxy on boot, add: privoxy_enable="YES" **
-** to /etc/rc.conf. If you changed the location of the **
-** configuration file, additionally add: **
-** privoxy_config="%%PREFIX%%/etc/privoxy/your-config" **
+** to /etc/rc.conf. **
** **
** To start Privoxy manually, run: **
** %%PREFIX%%/etc/rc.d/privoxy forcestart **
@@ -15,11 +8,20 @@
** in rc(8), it also contains a list of other rc **
** variables you can use. **
** **
+** Privoxy example files were copied to: **
+** %%PREFIX%%/share/examples/privoxy **
+** **
+** For documentation see: **
+** %%PREFIX%%/share/doc/privoxy-manual or 'man privoxy' **
+** **
+** Note that default.filter, standard.action and **
+** default.action get overwritten with each Privoxy **
+** update. Instead of changing them you should use **
+** your own action and filter files as described in **
+** Privoxy's manual. **
+** **
** If you installed Privoxy as package and are using the **
** default configuration, you have to make sure the **
** directories /var/log/privoxy and /var/run/privoxy **
** exist and are owned by privoxy:privoxy. **
-** **
-** For documentation see: **
-** %%PREFIX%%/share/doc/privoxy-manual or 'man privoxy' **
***********************************************************
diff -ruN www/privoxy/files/privoxy.in www/privoxy-3.0.6-1/files/privoxy.in
--- www/privoxy/files/privoxy.in Sat Oct 7 18:47:15 2006
+++ www/privoxy-3.0.6-1/files/privoxy.in Sat Dec 9 15:29:14 2006
@@ -34,6 +34,11 @@
: ${privoxy_user="privoxy"}
: ${privoxy_pidfile="/var/run/privoxy/privoxy.pid"}
+start_precmd="if [ ! -e ${privoxy_config} ]; then\
+ echo ${privoxy_config} not found. Copying default configuration.;\
+ cp %%PREFIX%%/share/examples/privoxy/config ${privoxy_config};\
+ chown ${privoxy_user}:${privoxy_user} ${privoxy_config};\
+fi"
command="%%PREFIX%%/sbin/privoxy"
command_args="${privoxy_flags} --pidfile ${privoxy_pidfile} ${privoxy_config}"
diff -ruN www/privoxy/pkg-plist www/privoxy-3.0.6-1/pkg-plist
--- www/privoxy/pkg-plist Wed Dec 6 09:52:27 2006
+++ www/privoxy-3.0.6-1/pkg-plist Sat Dec 9 16:06:40 2006
@@ -1,9 +1,7 @@
sbin/privoxy
-etc/privoxy/config
etc/privoxy/default.action
-etc/privoxy/standard.action
etc/privoxy/default.filter
-etc/privoxy/trust
+etc/privoxy/standard.action
etc/privoxy/templates/blocked
etc/privoxy/templates/cgi-error-404
etc/privoxy/templates/cgi-error-bad-param
@@ -57,6 +55,10 @@
%%PORTDOCS%%share/doc/privoxy-manual/templates.html
%%PORTDOCS%%share/doc/privoxy-manual/upgradersnote.html
%%PORTDOCS%%share/doc/privoxy-manual/whatsnew.html
+share/examples/privoxy/config
+share/examples/privoxy/trust
+share/examples/privoxy/user.action
+ at dirrm share/examples/privoxy
%%PORTDOCS%%@dirrm share/doc/privoxy-manual
@dirrm etc/privoxy/templates
@dirrm etc/privoxy
--MP_w4XnBxLQVQApSHLlQqMucO_--
More information about the freebsd-ports-bugs
mailing list