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