Do not update files for trivial differences

This commit is contained in:
Diomidis Spinellis 2014-10-28 20:15:40 +02:00
parent abeb6c22e0
commit 786d98cd71
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Update the reference test data to match what is actually produced
# This should only be executed after manually verifying that the
@ -8,6 +8,12 @@
#
#
# Remove elements that do not affect the structure of a file
remove_trivia()
{
grep -v 'Generated by' "$@"
}
for i in dot umldoc
do
git ls-files testdata/*-ref |
@ -15,7 +21,7 @@ do
while read refname outname
do
if [ -r "$outname" -a -r "$outname" ] && \
! cmp -s $refname $outname
! diff <(remove_trivia $refname) <(remove_trivia $outname) >/dev/null
then
cp $outname $refname
fi