From b96e25d3685da8f4f4a8bdec99d24b8bef1154a2 Mon Sep 17 00:00:00 2001 From: Phil Pennock Date: Sat, 29 Jan 2011 21:30:38 -0500 Subject: Use perl if pcregrep not available. Update comment in Tidytxt --- doc/doc-docbook/SanityTestText | 13 +++++++++---- doc/doc-docbook/Tidytxt | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/doc-docbook/SanityTestText b/doc/doc-docbook/SanityTestText index 90b9aeb6d..25b181e3d 100755 --- a/doc/doc-docbook/SanityTestText +++ b/doc/doc-docbook/SanityTestText @@ -4,14 +4,19 @@ # This tool is only used in building spec.txt for a release, not used as # part of the normal build/install process, so only Maintainers are affected # by requirements here. -# -# This tool requires pcregrep(1). filename="$1" -pcregrep -q '[^\x{20}-\x{7E}]' "$filename" +if echo a | pcregrep -q a 2>/dev/null +then + pcregrep -q '[^\x{20}-\x{7E}]' "$filename" + grepstatus=$? +else + perl -ne 'BEGIN {$rv=1};END {exit $rv}; + if (/[^\r\n\x{20}-\x{7E}]/) { $rv = 0; last }' < "$filename" + grepstatus=$? +fi -grepstatus=$? case $grepstatus in 0) echo >&2 "$0: found non-ASCII characters in $filename" diff --git a/doc/doc-docbook/Tidytxt b/doc/doc-docbook/Tidytxt index 53ae8ccac..a628b6dcf 100755 --- a/doc/doc-docbook/Tidytxt +++ b/doc/doc-docbook/Tidytxt @@ -39,8 +39,8 @@ foreach $line (@lines) $line =~ s/\x{e2}\x{95}\x{b3}/X/g; # w3m rendering issue apparently only seen by pdp - # affects section numbers after the ToC - #$line =~ s/^(\d+(?:\.\d+)?)\x{c2}/$1./g; + # affects section numbers after the ToC, some info on spool-file -lines, etc + # always appears to be a spurious extra character, safely just dropped. $line =~ s/\x{c2}//g; if ($line =~ /^\s*$/) -- cgit v1.2.1