-- Roland Rosenfeld <roland@debian.org> Thu, 09 Dec 2021 16:35:46 +0100
+privoxy (3.0.33-2) UNRELEASED; urgency=medium
+
+ * d/maintscript: Remove orphaned
+ templates/edit-actions-for-url-string-filter (Closes: #1001501).
+ * d/tests/conditional-defines: Check that expected #defines are enabled.
+ * d/rules: --enable-compression at build time (still disabled in config).
+ * d/tests/privoxy-regression-tests: 2 pass check with different options.
+
+ -- Roland Rosenfeld <roland@debian.org> Sat, 11 Dec 2021 10:36:30 +0100
+
privoxy (3.0.33-1) unstable; urgency=medium
* New upstream version 3.0.33.
rm_conffile /etc/privoxy/global.action 3.0.11-1~ privoxy
rm_conffile /etc/privoxy/standard.action 3.0.11-1~ privoxy
rm_conffile /etc/privoxy/templates/show-version 3.0.28-2~ privoxy
+rm_conffile /etc/privoxy/templates/edit-actions-for-url-string-filter 3.0.33-2~ privoxy
#!/usr/bin/make -f
#
-# (c) 2002-2021 Roland Rosenfeld <roland@debian.org>
+# (c) 2002-2022 Roland Rosenfeld <roland@debian.org>
#
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
--enable-external-filters \
--enable-extended-statistics \
--enable-pcre-host-patterns \
+ --enable-compression \
--with-mbedtls \
--with-brotli \
--with-docbook=/usr/share/sgml/docbook/stylesheet/dsssl/modular
--- /dev/null
+#!/bin/sh
+#
+# Check http://config.privoxy.org/show-status for Conditional #defines enabled
+# This wrapper starts privoxy on port 8119 and runs conditional-defines.pl
+#
+# (c) 2022 Roland Rosenfeld <roland@debian.org>
+
+PORT=8119
+
+TESTSDIR=$(dirname "$0")
+
+if [ -z "$AUTOPKGTEST_TMP" ]; then
+ AUTOPKGTEST_TMP=$(mktemp -d)
+fi
+
+trap 'rm -rf "$AUTOPKGTEST_TMP"' EXIT
+
+CONFIG=$AUTOPKGTEST_TMP/config
+PIDFILE=$AUTOPKGTEST_TMP/privoxy.pid
+PRIVOXY=$AUTOPKGTEST_TMP/privoxy
+
+sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
+ -e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
+ < /usr/share/privoxy/config > "$CONFIG"
+
+cp /usr/sbin/privoxy "$PRIVOXY"
+
+echo "Starting privoxy on port $PORT"
+$PRIVOXY --pidfile "$PIDFILE" "$CONFIG"
+
+http_proxy=http://127.0.0.1:$PORT/
+export http_proxy
+
+"$TESTSDIR"/conditional-defines.pl
+EXITVAL=$?
+
+echo "Stopping privoxy on port $PORT"
+# shellcheck disable=SC2046
+kill $(cat "$PIDFILE")
+
+exit $EXITVAL
--- /dev/null
+#!/usr/bin/perl
+#
+# Check http://config.privoxy.org/show-status for Conditional #defines enabled
+#
+# (c) 2022 Roland Rosenfeld <roland@debian.org>
+
+use strict;
+use warnings;
+use LWP::UserAgent ();
+use HTML::TreeBuilder 5 -weak;
+
+my $exitcode = 0;
+
+my $ua = LWP::UserAgent->new(timeout => 10);
+$ua->env_proxy;
+my $response = $ua->get('http://config.privoxy.org/show-status');
+if (!$response->is_success) {
+ die $response->status_line;
+}
+my $tree = HTML::TreeBuilder->new;
+$tree->parse($response->decoded_content);
+
+# Search for "Conditional #defines:" table:
+my $summary = 'The state of some ./configure options and what they do.';
+my $table = $tree->look_down('_tag' => 'table',
+ 'summary' => $summary);
+unless (defined $table) {
+ die "summary '$summary' not found in tables";
+}
+
+# These features are intentionaly disabled, all others should be enabled:
+my %disabled_features = ('FEATURE_ACCEPT_FILTER' => 1, # BSD only
+ 'FEATURE_STRPTIME_SANITY_CHECKS' =>1, # BSD libc only
+ 'FEATURE_GRACEFUL_TERMINATION' =>1, # devel only
+ );
+
+my $enabled = 0;
+my $disabled_ok = 0;
+my $disabled_nok = 0;
+foreach my $tr ($table->look_down('_tag' => 'tr')) {
+ my $td2 = ($tr->look_down('_tag' => 'td')) [1];
+ next unless defined $td2;
+ my $code = $tr->look_down('_tag' => 'code');
+ my $feature = $code->detach_content;
+ my $value = $td2->detach_content;
+ if ($value !~ /Yes/) {
+ # feature disabled, check whitelist
+ if (! defined $disabled_features{$feature}) {
+ printf STDERR "%s is disabled, but should be enabled\n", $feature;
+ $exitcode = 1;
+ $disabled_nok++;
+ } else {
+ $disabled_ok++;
+ }
+ } else {
+ $enabled++;
+ }
+}
+
+printf "%d features enabled\n", $enabled;
+printf "%d features intentionally disabled\n", $disabled_ok;
+printf "%d features unintentionally disabled\n", $disabled_nok;
+
+if ($enabled < 10) {
+ printf STDERR "Found only %d Conditional #defines, seems test ist broken\n",
+ $enabled;
+ $exitcode = 1;
+}
+
+exit $exitcode;
Tests: privoxy-regression-test
Depends: curl, @
+
+Tests: conditional-defines
+Depends: privoxy, libwww-perl, libhtml-tree-perl
# Run privoxy-regression-test.pl on a configuration extended by
# regression-tests.action.
#
-# (c) 2018-2021 Roland Rosenfeld <roland@debian.org>
+# (c) 2018-2022 Roland Rosenfeld <roland@debian.org>
PORT=8119
AUTOPKGTEST_TMP=$(mktemp -d)
fi
-trap "rm -rf $AUTOPKGTEST_TMP" EXIT
+trap 'rm -rf "$AUTOPKGTEST_TMP"' EXIT
CONFIG=$AUTOPKGTEST_TMP/config
PIDFILE=$AUTOPKGTEST_TMP/privoxy.pid
PRIVOXY=$AUTOPKGTEST_TMP/privoxy
+cp /usr/sbin/privoxy "$PRIVOXY"
+
+http_proxy=http://127.0.0.1:$PORT/
+export http_proxy
+
+OUTFILE=$AUTOPKGTEST_TMP/output
+
+
+echo "#### pass 1: some optiones disabled"
+
sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
-e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
- -e "s/^enable-edit-actions.*/enable-edit-actions 1/" \
-e "s/^keep-alive-timeout.*/keep-alive-timeout 21/" \
- -e "s/^#connection-sharing.*/connection-sharing 1/" \
- < /usr/share/privoxy/config > $CONFIG
-echo "actionsfile regression-tests.action" >> $CONFIG
-
-cp /usr/sbin/privoxy $PRIVOXY
+ -e "s/^#connection-sharing.*/connection-sharing 0/" \
+ < /usr/share/privoxy/config > "$CONFIG"
+echo "actionsfile regression-tests.action" >> "$CONFIG"
echo "Starting privoxy on port $PORT"
-$PRIVOXY --pidfile $PIDFILE $CONFIG
+$PRIVOXY --pidfile "$PIDFILE" "$CONFIG"
-http_proxy=http://127.0.0.1:$PORT/
-export http_proxy
+/usr/bin/privoxy-regression-test --max-level 200 --show-skipped-tests \
+ | tee "$OUTFILE" 2>&1
-OUTFILE=$AUTOPKGTEST_TMP/output
+
+echo "#### pass 2 with some more options enabled"
+
+sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
+ -e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
+ -e "s/^enable-remote-toggle.*/enable-remote-toggle 1/" \
+ -e "s/^enable-edit-actions.*/enable-edit-actions 1/" \
+ -e "s/^enable-proxy-authentication-forwarding.*/enable-proxy-authentication-forwarding 1/" \
+ -e "s/^keep-alive-timeout.*/keep-alive-timeout 21/" \
+ -e "s/^#connection-sharing.*/connection-sharing 1/" \
+ < /usr/share/privoxy/config > "$CONFIG"
+echo "actionsfile regression-tests.action" >> "$CONFIG"
/usr/bin/privoxy-regression-test --max-level 200 --show-skipped-tests \
- | tee $OUTFILE 2>&1
+ | tee -a "$OUTFILE" 2>&1
+
echo "Stopping privoxy on port $PORT"
-kill $(cat $PIDFILE)
+kill "$(cat "$PIDFILE")"
-if grep -q 'Executed.*, 0 failures.' $OUTFILE
+# Check that 2 passes have both 0 failures:
+if [ "$(grep -c 'Executed.*, 0 failures' "$OUTFILE")" = 2 ]
then
exit 0
else