#!/bin/csh
set new = `cat patchlevel`
set old = $new
@ old--
set tmp = /tmp/md.$old
mkdir $tmp
set here = `pwd`
cd ..
set there = `pwd`
cd $tmp
gunzip -c $there/md.$old.tar.gz | tar xf -
cd $here
set diffs = ../md.$new.$old.diffs
rm -f $diffs
foreach f (`ls -1 $here`)
    if ( ! -l ${here}/${f} ) then
        if ( ! -e ${tmp}/md/${f} ) then
            echo "new ${f}"
            touch ${tmp}/md/${f}
	endif
	diff -c ${tmp}/md/${f} ${here}/${f} >> ${diffs}
	if ( $status == 1 ) then
	    echo "dif ${f}"
	endif
    endif
end
rm -R $tmp
echo $diffs
