check_jni_methods.sh: Don't depend on diff -b ignoring a single trailing whitespace.

* scripts/check_jni_methods.sh: Don't depend on diff -b ignoring
a single trailing whitespace.

From-SVN: r128910
This commit is contained in:
Alexandre Oliva 2007-10-01 19:56:46 +00:00 committed by Alexandre Oliva
parent 96cbc7348f
commit 11cd03c125
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2007-10-01 Alexandre Oliva <aoliva@redhat.com>
* scripts/check_jni_methods.sh: Don't depend on diff -b ignoring
a single trailing whitespace.
2007-08-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/util/EnumSet.java:

View File

@ -16,16 +16,16 @@ grep -h '^JNIEXPORT .* Java_' include/*.h | \
# Find all methods in the JNI C source files.
find native/jni -name \*.c | \
xargs grep -h '^Java_' | \
LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' > $TMPFILE2
LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\).*$,\1,' > $TMPFILE2
# Or in the the C++ files. (Note that cpp doesn't follow gnu conventions atm)
# So we try to match both GNU style and some other style.
find native/jni -name \*.cpp | \
xargs grep -h '^Java_' | \
LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' >> $TMPFILE2
LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2
find native/jni -name \*.cpp | \
xargs egrep -h '^(JNIEXPORT .* JNICALL )?Java_' | \
cut -f4 -d\ | \
LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\) *(.*$,\1,' >> $TMPFILE2
LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2
mv $TMPFILE2 $TMPFILE3
sort $TMPFILE3 | uniq > $TMPFILE2
rm $TMPFILE3
@ -40,7 +40,7 @@ EOF
# Compare again silently.
# Use fgrep and direct the output to /dev/null for compatibility with older
# grep instead of using the non portable -q.
if diff -b -U 0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | \
if diff -U 0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | \
fgrep -v -f $TMPFILE3 > /dev/null;
then
PROBLEM=1
@ -48,7 +48,7 @@ then
echo "(-) missing in implementation, (+) missing in header files"
# Compare the found method lists.
diff -b -U 0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | fgrep -v -f $TMPFILE3
diff -U 0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | fgrep -v -f $TMPFILE3
fi
# Cleanup.