- assigned_to: nobody --> pabigot
tos-locate-jre (tinyos-2.x/tools/tinyos/misc/tos-locate-jre) was modified to search for 32 bit or 64 bit versions of the java toolkit.
The modifications that effected this change don't look right and look like they fail if either the version or the home of the tool kit aren't found.
At a minimum this needs to be checked out.
osian/tinyos-2.x, merge between gc/pu and gc/upstream, conflict:
case `uname` in
CYGWIN*)
# Hopefully this will always work on cygwin with Sun's Java
<<<<<<< HEAD
# Need to check both 32-bit and 64-bit registries
for wow in '' -w -W ; do
jversion=`regtool ${wow} -q get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'`
if [ $? != 0 ]; then
continue
fi
jhome=`regtool ${wow} -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'`
if [ $? != 0 ]; then
continue
fi
jhome=`cygpath -u "$jhome"`
break
done
=======
jversion=`regtool -q -w get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`regtool -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`cygpath -u "$jhome"`
>>>>>>> gc/upstream
;;
from gc/upstream, the code reads as follows...
case `uname` in
CYGWIN*)
# Hopefully this will always work on cygwin with Sun's Java
jversion=`regtool -q -w get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`regtool -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'`
if [ $? != 0 ]; then
exit 1
fi
jhome=`cygpath -u "$jhome"`
;;
note that if it can't find what it is looking for it aborts with an "exit 1"
And your code:
case `uname` in
CYGWIN*)
# Hopefully this will always work on cygwin with Sun's Java
# Need to check both 32-bit and 64-bit registries
for wow in '' -w -W ; do
jversion=`regtool ${wow} -q get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'`
if [ $? != 0 ]; then
continue
fi
jhome=`regtool ${wow} -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'`
if [ $? != 0 ]; then
continue
fi
jhome=`cygpath -u "$jhome"`
break
done
;;
This replaces the exits with continues. If neither 32 or 64 bit is found, neither jversion nor jhome will be set but the program will
continue on its merry way.
Is this what was intended?
The following code should fix this:
case `uname` in
CYGWIN*)
# Hopefully this will always work on cygwin with Sun's Java
# Need to check both 32-bit and 64-bit registries
for wow in '' -w -W ; do
jversion=`regtool ${wow} -q get '\\HKLM\\SOFTWARE\\JavaSoft\\Java Development Kit\\CurrentVersion'`
if [ $? != 0 ]; then
continue
fi
jhome=`regtool ${wow} -q get '\\HKLM\SOFTWARE\\JavaSoft\\Java Development Kit\\'$jversion'\\JavaHome'`
if [ $? != 0 ]; then
unset jversion
continue
fi
jhome=`cygpath -u "$jhome"`
break
done
if [ -z "$jversion" ]; then
exit 1
fi
;;
The above code needs to be verified.