From b7daa22561cbd9285f431f097a71cc66bec1dc34 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 27 Oct 2010 16:49:49 +0200 Subject: purify_html: Rewritten in order to maintain the files' original timestamps unless they're actually modified. --- purify_html | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'purify_html') diff --git a/purify_html b/purify_html index 4cf582af..9c3a7862 100755 --- a/purify_html +++ b/purify_html @@ -1,15 +1,39 @@ #!/bin/sh -# Mangle the rendered files to cause fewer differernces upon re-rendering. +# Mangle the rendered files to cause fewer differences after re-rendering. -# Written by Thomas Schwinge . +# Written by Thomas Schwinge . # Un-mangle mailto links: convert HTML character entities to real characters. find ./ -name \*.html -print0 \ - | xargs -0 \ - perl -p -i -l -e \ - 'BEGIN { $replacing = 0; } - # The replacing-toggling logic is a bit rough, but so is life. - $replacing = 1 if /$file.new") or die "open: $file: $!"; + select(OUT) or die "select: $file: $!"; + } + + while (<>) { + # The replacing-toggling logic is a bit rough, but so is life. + $replacing = 1 if /