classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: check_jni_methods.sh fixlets


From: Mark Wielaard
Subject: [cp-patches] FYI: check_jni_methods.sh fixlets
Date: Sat, 13 Aug 2005 15:35:36 +0200

Hi,

Our check jni methods script would try to create temporary files in the
source directory which can be write protected. It would silently fail,
but not report any errors about this. The following patch fixes this.

2005-08-13  Mark Wielaard  <address@hidden>

    * scripts/check_jni_methods.sh: Don't create temp files in source dir.
    Don't override existing files. Fast fail on errors.

Committed,

Mark
Index: scripts/check_jni_methods.sh
===================================================================
RCS file: /cvsroot/classpath/classpath/scripts/check_jni_methods.sh,v
retrieving revision 1.6
diff -u -r1.6 check_jni_methods.sh
--- scripts/check_jni_methods.sh        19 Jan 2005 09:52:37 -0000      1.6
+++ scripts/check_jni_methods.sh        13 Aug 2005 13:34:39 -0000
@@ -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 @@
 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"
 

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]