[75015] trunk/dports/www/privoxy/Portfile

kimuraw at macports.org kimuraw at macports.org
Tue Jan 11 09:12:46 PST 2011


Revision: 75015
          http://trac.macports.org/changeset/75015
Author:   kimuraw at macports.org
Date:     2011-01-11 09:12:39 -0800 (Tue, 11 Jan 2011)
Log Message:
-----------
www/privoxy: fix #23970, config files was deleted at port upgrade.
   and upgrade to 3.0.17

Modified Paths:
--------------
    trunk/dports/www/privoxy/Portfile

Modified: trunk/dports/www/privoxy/Portfile
===================================================================
--- trunk/dports/www/privoxy/Portfile	2011-01-11 16:33:13 UTC (rev 75014)
+++ trunk/dports/www/privoxy/Portfile	2011-01-11 17:12:39 UTC (rev 75015)
@@ -2,7 +2,8 @@
 
 PortSystem			1.0
 name				privoxy
-version				3.0.16
+version				3.0.17
+revision			0
 categories			www security net
 maintainers			nomaintainer
 description			Advanced filtering web proxy
@@ -20,9 +21,9 @@
 master_sites		sourceforge:ijbswa
 distname			${name}-${version}-stable-src
 
-checksums           md5     64d3ffcdf8307e04a375773bb4eb255e \
-                    sha1    2c9c44034ff0509c124fac98cb741a2c2572edcd \
-                    rmd160  36723f0269f9a03394c959eb6587b57fdb7eb713
+checksums           md5     9d363d738a3f3d73e774d6dfeafdb15f \
+                    sha1    cadef2eb8ec182278e092322d3d56f225cb69c93 \
+                    rmd160  8e4acc60ca7e7be20a92e1aece92eecedd4d1997
 
 worksrcdir			${name}-${version}-stable
 
@@ -67,12 +68,19 @@
 		reinplace "s|@@PRIVOXY_USER@@|${privoxyUser}|g" \
 			${destroot}${prefix}/etc/rc.d/privoxy.sh
 	}
-	# Rename these so local modifications are not removed on uninstall
-	foreach privoxyConf {config.new trust.new user.action.new user.filter.new} {
+	# Rename these so local modifications are not removed on uninstall.
+	# NOTE: Always overwrite default.action and default.filter.
+	foreach privoxyConf {config match-all.action trust user.action user.filter} {
             if [file exists ${destroot}${prefix}/etc/privoxy/${privoxyConf}] {
 		file rename ${destroot}${prefix}/etc/privoxy/${privoxyConf} \
-			${destroot}${prefix}/etc/privoxy/${privoxyConf}-dist 
+			${destroot}${prefix}/etc/privoxy/${privoxyConf}.new
             }
+	    # backup config files before fix #23970
+            if {[file exists ${prefix}/etc/privoxy/${privoxyConf}] \
+	    && ![file exists ${prefix}/etc/privoxy/${privoxyConf}.new]} {
+		file copy ${prefix}/etc/privoxy/${privoxyConf} \
+			${destroot}${prefix}/etc/privoxy/${privoxyConf}.mp_backup
+            }
 	}
 	# Remove the preinstalled log files as, otherwise, a rotation script
 	# will fail when trying to rename and compress due to gzip not liking
@@ -92,10 +100,16 @@
 			-group ${privoxyGroup} -owner ${privoxyUser} \
 			-permissions 0660
 	}
-	foreach privoxyConf {config trust user.action} {
+	foreach privoxyConf {config match-all.action trust user.action user.filter} {
 		if ![file exists ${prefix}/etc/privoxy/${privoxyConf}] {
-			file copy ${prefix}/etc/privoxy/${privoxyConf}.new \
-				${prefix}/etc/privoxy/${privoxyConf}
+			# restore config files before fix #23970
+			if [file exists ${prefix}/etc/privoxy/${privoxyConf}.mp_backup] {
+			    file copy ${prefix}/etc/privoxy/${privoxyConf}.mp_backup \
+				    ${prefix}/etc/privoxy/${privoxyConf}
+			} else {
+			    file copy ${prefix}/etc/privoxy/${privoxyConf}.new \
+				    ${prefix}/etc/privoxy/${privoxyConf}
+			}
 			file attributes ${prefix}/etc/privoxy/${privoxyConf} \
 				-group ${privoxyGroup} -owner ${privoxyUser} \
 				-permissions 0660
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110111/065eea78/attachment.html>


More information about the macports-changes mailing list