From: Ian Silvester <iansilvester@fastmail.fm>
Date: Mon, 12 Mar 2012 02:16:03 +0000 (+0000)
Subject: resolve bug #3501855 - correct values for confdir and logdir parameters not written... 
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/user-manual/developer-manual/static/gitweb.js?a=commitdiff_plain;h=362800d69fbcfe19adc20160d06e20f77739c1dc;p=OSXPackageBuilder.git

resolve bug #3501855 - correct values for confdir and logdir parameters not written into config
---

diff --git a/constructPkgContent.sh b/constructPkgContent.sh
index f81a01d..54177b6 100755
--- a/constructPkgContent.sh
+++ b/constructPkgContent.sh
@@ -31,32 +31,30 @@
 #                changes ought to be passed back to the macsetup module.
 #
 
-# 1. Remove existing 'pkg content' folder if found
+# Remove existing 'pkg content' folder if found
 echo ""
 echo "Remove existing 'pkg content' folder if found"
-echo ""
 rm -rf pkg\ content
 
-# 1. Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'
-echo ""
+# Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'
 echo ""
 echo "Copy the package skeleton (the unchanging content) to a new folder named 'pkg content'"
 echo ""
 cp -vR pkg\ content\ skeleton pkg\ content
 
-# 2. Copy the compiled privoxy binary from the 'current' project
+# Copy the compiled privoxy binary from the 'current' project
 echo ""
 echo ""
 echo "Copy the compiled privoxy binary from the 'current' project"
 echo ""
 cp -v ../current/privoxy pkg\ content/usr/local/sbin
 
-# 3. Copy the configuration hierarchy from the 'current' project
+# Copy the configuration hierarchy from the 'current' project
 echo ""
 echo ""
-echo "Copy the configuration hierarchy from the 'current' project"
+echo "Copy most of the configuration hierarchy from the 'current' project"
 echo ""
-for i in default.action default.filter match-all.action config trust user.action user.filter templates; do
+for i in default.action default.filter match-all.action trust user.action user.filter templates; do
 	if [ "$i" = "templates" ]; then
 		# for the templates subfolder copy all files therein
 		cp -vR ../current/$i pkg\ content/usr/local/etc/privoxy/vanilla/$i
@@ -66,7 +64,16 @@ for i in default.action default.filter match-all.action config trust user.action
 	fi
 done
 
-# 4. Copy the documentation hierarchy from the 'current' project
+# Enter the correct values for confdir and logdir into the config file 
+echo ""
+echo ""
+echo "Copy the config file from the 'current' project, modifying the confdir and logdir in passing"
+echo ""
+sed 's/confdir ./confdir \/usr\/local\/etc\/privoxy/g' ../current/config > pkg\ content/usr/local/etc/privoxy/vanilla/config_temp
+sed 's/logdir ./logdir \/var\/log\/privoxy/g' pkg\ content/usr/local/etc/privoxy/vanilla/config_temp > pkg\ content/usr/local/etc/privoxy/vanilla/config
+rm -f pkg\ content/usr/local/etc/privoxy/vanilla/config_temp
+
+# Copy the documentation hierarchy from the 'current' project
 echo ""
 echo ""
 echo "Copy the documentation hierarchy from the 'current' project"
@@ -84,17 +91,18 @@ for i in AUTHORS ChangeLog LICENSE README; do
 	cp -v ../current/$i pkg\ content/usr/local/share/doc/privoxy/$i
 done
 
-# 5. Copy the manpage from the 'current' project
+# Copy the manpage from the 'current' project
 echo ""
 echo ""
 echo "Copy the manpage from the 'current' project"
 echo ""
 cp -v ../current/privoxy.1 pkg\ content/usr/local/share/man/man1
 
-# 6. Remove unnecessary CVS administration files
+# Remove CVS administration files
 echo ""
 echo ""
 echo "Remove CVS administration files"
 echo ""
 find pkg\ content -name CVS.sandboxinfo -exec rm -rf {} \;
 find pkg\ content -name CVS -exec rm -rf {} \;
+