Bug#282250: gjdoc: line 21: syntax error near unexpected token `fi'

Loïc Minier Loïc Minier , 282250@bugs.debian.org
Sat Nov 20 14:24:01 2004


--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

reassign 282250 gjdoc
tags 282250 + patch
thanks

Kurt Roeckx <Q@ping.be> - Sat, Nov 20, 2004:

> /usr/bin/gjdoc: line 21: syntax error near unexpected token `fi'
> /usr/bin/gjdoc: line 21: `fi'
> make: *** [build] Error 2

 You'll get that every time the gjdoc command is used, there's a syntax
 error in the script.

 I'm reassigning the bug to gjdoc, with the attached patch, right now
 the gjdoc and hence dh_javadoc can't be used.

 The patch:
 - fixes the syntax error (superfluous fi),
 - adds sanitizing double-quotes,
 - hence supports spaces in commands or classpath,
 - uses /usr/bin/java as the default JVM when the PATH is broken,
 - breaks fallback on "kaffe" when java isn't in the PATH (admin has to
   fix his alternatives!).

   Regards,

--=20
Lo=EFc Minier <lool@dooz.org>

--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gjdoc_0.6.1-12_syntax.patch"

--- /usr/bin/gjdoc	2004-11-18 16:36:31.000000000 +0100
+++ ./gjdoc	2004-11-20 22:04:19.000000000 +0100
@@ -2,22 +2,22 @@
 
 GJDOCCP=/usr/share/java/gjdoc.jar:/usr/share/java/gnujaxp.jar
 
-if [ -z $CLASSPATH ] ; then
-    CLASSPATH=$GJDOCCP
+if [ -z "$CLASSPATH" ] ; then
+    CLASSPATH="$GJDOCCP"
 else
-    CLASSPATH=$CLASSPATH:$GJDOCCP
+    CLASSPATH="$CLASSPATH:$GJDOCCP"
 fi
 
 if [ -z "$JAVACMD" ] ; then
-  if [ -n "$JAVA_HOME"  ] ; then
-      JAVACMD="$JAVA_HOME/bin/java"
+    if [ -n "$JAVA_HOME"  ] ; then
+        JAVACMD="$JAVA_HOME/bin/java"
+    else
+        JAVACMD="`which java 2> /dev/null`"
+        if [ -z "$JAVACMD" ] ; then
+            JAVACMD="/usr/bin/java"
+        fi
     fi
-  else
-    JAVACMD=`which java 2> /dev/null `
-    if [ -z "$JAVACMD" ] ; then
-        JAVACMD=kaffe
-    fi
-  fi
 fi
 
-LD_LIBRARY_PATH=/usr/lib/jni exec $JAVACMD -classpath $CLASSPATH gnu.classpath.tools.gjdoc.Main "$@" 
+LD_LIBRARY_PATH="/usr/lib/jni" exec "$JAVACMD" -classpath "$CLASSPATH" gnu.classpath.tools.gjdoc.Main "$@"
+

--TB36FDmn/VVEgNH/--