ctfdwdiff: allow specifying just one file again

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-22 13:06:41 -03:00
parent 17b83fcbf1
commit c1d567f047
1 changed files with 23 additions and 14 deletions

View File

@ -21,19 +21,28 @@ diff_one() {
fi
}
diff_dir() {
find . -type d | \
while read dir ; do
cd $dir
ls *.o 2> /dev/null |
while read obj ; do
ncus=$(readelf -wi $obj | grep DW_TAG_compile_unit | wc -l)
if [ $ncus -ne 1 ] ; then
continue
fi
echo $obj
diff_one $obj $1
done
cd - > /dev/null
done
}
rm -rf $results_dir
mkdir $results_dir
find . -type d | \
while read dir ; do
cd $dir
ls *.o 2> /dev/null |
while read obj ; do
ncus=$(readelf -wi $obj | grep DW_TAG_compile_unit | wc -l)
if [ $ncus -ne 1 ] ; then
continue
fi
echo $obj
diff_one $obj $1
done
cd - > /dev/null
done
if [ $# -lt 2 ] ; then
diff_dir
else
diff_one $*
fi