xref: /minix/libexec/httpd/testsuite/html_cmp (revision 9f81acbc)
1#! /bin/sh
2#
3#	$eterna: html_cmp,v 1.9 2011/11/17 22:18:02 mrg Exp $
4#
5# like cmp(1) but compares to files after making their `Date: ' headers
6# the same, to allow `now' and `then' to work properly.  it also tries
7# to find servername's that might be the local host and converts those
8# as well..
9#
10# it must be called like `cmp file1 file1' *only*.
11
12h=`hostname || uname -n`
13
14sedcmd="s/^Date: .*/Date: nowish/;
15	s/^Last-Modified: .*/Last-Modified: nowish/;
16	s/[a-zA-Z0-9-]*\.eterna\.com\.au/$h/g;
17	s/^Server: .*/^Server: bozotic HTTP server version 5.08/;
18	s/^Content-Length: .*/Content-Length: 223/;"
19
20sed -e "$sedcmd" < "$1" > "f1.tmp.$$"
21sed -e "$sedcmd" < "$2" > "f2.tmp.$$"
22
23cmp -s "f1.tmp.$$" "f2.tmp.$$"
24rv=$?
25rm -f "f1.tmp.$$" "f2.tmp.$$"
26
27exit $rv
28