Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-432 - JAVA_PLATFORM with spaces breaks bin/nutch.

Andrzej Bialeckifb7d9057f426
diff --git a/CHANGES.txt b/CHANGES.txt
index 8cb42719a..c9530d310 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -148,6 +148,9 @@ Unreleased changes (0.9-dev)
49. NUTCH-449 - Make junit output format configurable. (nigel via cutting)
+50. NUTCH-432 - Fix a bug where platform name with spaces would break the
+ bin/nutch script. (Brian Whitman via ab)
+
Release 0.8 - 2006-07-25
diff --git a/bin/nutch b/bin/nutch
index e20e6c11a..1e2610322 100755
--- a/bin/nutch
+++ b/bin/nutch
@@ -125,11 +125,15 @@ for f in $NUTCH_HOME/lib/jetty-ext/*.jar; do
CLASSPATH=${CLASSPATH}:$f;
done
+# cygwin path translation
+if $cygwin; then
+ CLASSPATH=`cygpath -p -w "$CLASSPATH"`
+fi
# setup 'java.library.path' for native-hadoop code if necessary
JAVA_LIBRARY_PATH=''
if [ -d "${NUTCH_HOME}/build/native" -o -d "${NUTCH_HOME}/lib/native" ]; then
- JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName`
+ JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed -e 's/ /_/g'`
if [ -d "$NUTCH_HOME/build/native" ]; then
JAVA_LIBRARY_PATH=${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib
@@ -144,6 +148,10 @@ if [ -d "${NUTCH_HOME}/build/native" -o -d "${NUTCH_HOME}/lib/native" ]; then
fi
fi
+if [ $cygwin -a "X${JAVA_LIBRARY_PATH}" != "X" ]; then
+ JAVA_LIBRARY_PATH=`cygpath -p -w "$JAVA_LIBRARY_PATH"`
+fi
+
# restore ordinary behaviour
unset IFS
@@ -217,11 +225,6 @@ else
CLASS=$COMMAND
fi
-# cygwin path translation
-if $cygwin; then
- CLASSPATH=`cygpath -p -w "$CLASSPATH"`
-fi
-
# run it
exec "$JAVA" $JAVA_HEAP_MAX $NUTCH_OPTS -classpath "$CLASSPATH" $CLASS "$@"