aboutsummaryrefslogtreecommitdiffstats
path: root/t.validate-xhtml10
blob: 2d36efdf62233911d6a47e0dd42aaf8baa8778c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh

# This test script validates all *.html files as XHTML.

set -eu
e=0
fail=
IFS=$(printf '\n\t')

# smoke test validator for XHTML 1.0 Transitional, and skip if it fails
cat - <<'_EOF'  | xmllint 2>/dev/null --nonet --postvalid --noout - || exit 77
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head><title /></head><body></body></html>
_EOF

for i in "${srcdir}"/*.html ; do
    case "$i" in
	*/fetchmail-man.html) continue ;;
	*/Mailbox-Names-UTF7.html) continue ;;
    esac
    xmllint --nonet --postvalid --noout "$i" || { e=1 ; fail="$i${fail:+" "}$fail" ; }
done
if [ $e != 0 ] ; then
    echo >&2 ">>>>> Invalid XHTML in files: ${fail}."
fi
exit $e
class="w"> "Sep", 243, "Oct", 273, "Nov", 304, "Dec", 334, ); sub day_offset { my($datestring) = @_; my($wday, $month, $day, $time, $zone, $year) = split(' ', $datestring); my($jdate); # We don't deal with leap years here because the baseline day is after # the last leap year (1996) and there's a long time before the next # one (2004). $jdate = ($year - 1996) * 365; $jdate += $month_offsets{$month}; $jdate += ($day - 1); # Baseline day for the size data was Fri Oct 25 23:02:26 EDT 1996 $jdate -= 297; return($jdate); } open(NEWS, "NEWS"); $timestamp = `date`; chop $timestamp; $release = "unknown"; $lines = "unknown"; $date = "unknown"; $jdate = "unknown"; print <<EOF; # Population data from fetchmail NEWS file, as of $timestamp. # # Output other than pass-through % lines is tab-separated fields. # Field 1: release ID # Field 2: count of source lines under version control # Field 3: count of fetchmail-friends subscribers # Field 4: count of fetchmail-announce subscribers # Field 5: total subscribers to both lists # Field 6: date of release (days since first datum) # Field 7: date of release (RFC822 date format) # EOF while ($_ = <NEWS>) { my($sum); if (/^%/) { print $_; } elsif (/^fetchmail-([^ ]*) \(([^)]+)\)(, [0-9]* lines)?:/) { $release = $1; $date = $2; $jdate = &day_offset($date); if ($3) { $lines = substr($3, 2, length($3) - 8); } else { $lines = 'na' } } elsif (/There are ([0-9]*) people on fetchmail-friends and ([0-9]*) on fetchmail-announce/) { $sum = $1 + $2; print "${release}\t${lines}\t$1\t$2\t${sum}\t${jdate}\t${date}\n"; $release = "unknown"; $date = "unknown"; } elsif (/There are ([0-9]*) people on the fetchmail-friends list./) { print "$release\t${lines}\t$1\t0\t$1\t$jdate\t$date\n"; $release = "unknown"; $date = "unknown"; } } # end