summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-08-13 13:36:10 +0000
committerMark Wielaard <mark@klomp.org>2005-08-13 13:36:10 +0000
commitba6fc0db2682fd0c15c2a9788ccb63ec9ab66109 (patch)
tree413d93cc430bf1020287414b850880ee4c9473b0 /scripts
parent29a3d30388e0f469577334c2fc8769aba403abed (diff)
downloadclasspath-ba6fc0db2682fd0c15c2a9788ccb63ec9ab66109.tar.gz
* scripts/check_jni_methods.sh: Don't create temp files in source dir.
Don't override existing files. Fast fail on errors.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_jni_methods.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/check_jni_methods.sh b/scripts/check_jni_methods.sh
index 587b8792b..a5daa91f4 100755
--- a/scripts/check_jni_methods.sh
+++ b/scripts/check_jni_methods.sh
@@ -1,8 +1,13 @@
#!/bin/sh
-TMPFILE=check-jni-methods.$$.1
-TMPFILE2=check-jni-methods.$$.2
-TMPFILE3=check-jni-methods.$$.3
+# Fail if any command fails
+set -e
+# Don't override existing files
+set -C
+
+TMPFILE=/tmp/check-jni-methods.$$.1
+TMPFILE2=/tmp/check-jni-methods.$$.2
+TMPFILE3=/tmp/check-jni-methods.$$.3
# Find all methods defined in the header files generated
# from the java source files.
@@ -24,10 +29,8 @@ cat > $TMPFILE3 << EOF
EOF
# Compare again silently.
-diff -ub -0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -q -v -f $TMPFILE3
-RESULT=$?
-
-if test "$RESULT" = "0" ; then
+if diff -ub -0 $TMPFILE $TMPFILE2 | grep '^[+-]Java' | grep -q -v -f $TMPFILE3;
+then
echo "Found a problem with the JNI methods declared and implemented."
echo "(-) missing in implementation, (+) missing in header files"