GnuTLS control constants exposed to Makefile.
[exim.git] / doc / doc-docbook / SanityTestText
CommitLineData
b32a9711
PP
1#!/bin/sh
2
3# Portability note:
4# This tool is only used in building spec.txt for a release, not used as
5# part of the normal build/install process, so only Maintainers are affected
6# by requirements here.
7
8filename="$1"
9
10if echo a | pcregrep -q a 2>/dev/null
11then
12 pcregrep -q '[^\x{20}-\x{7E}]' "$filename"
13 grepstatus=$?
14else
15 perl -ne 'BEGIN {$rv=1};END {exit $rv};
16 if (/[^\r\n\x{20}-\x{7E}]/) { $rv = 0; last }' < "$filename"
17 grepstatus=$?
18fi
19
20case $grepstatus in
210)
22 echo >&2 "$0: found non-ASCII characters in $filename"
23 exit 1
24 ;;
251)
26 exit 0
27 ;;
282)
29 echo >&2 "$0: problem checking for non-ASCII characters in $filename"
30 exit 2
31 ;;
32*)
33 echo >&2 "$0: unhandled return value from pcregrep: $grepstatus"
34 exit 3
35 ;;
36esac