Browse Source

HADOOP-11524. hadoop_do_classpath_subcommand throws a shellcheck warning. Contributed by Chris Nauroth.

cnauroth 10 years ago
parent
commit
4528eb9fb2

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -187,6 +187,9 @@ Trunk (Unreleased)
     HADOOP-10115. Exclude duplicate jars in hadoop package under different
     component's lib (Vinayakumar B via aw)
 
+    HADOOP-11524. hadoop_do_classpath_subcommand throws a shellcheck warning.
+    (cnauroth)
+
   BUG FIXES
 
     HADOOP-11473. test-patch says "-1 overall" even when all checks are +1

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/bin/hadoop

@@ -125,7 +125,7 @@ case ${COMMAND} in
     CLASS=org.apache.hadoop.util.NativeLibraryChecker
   ;;
   classpath)
-    hadoop_do_classpath_subcommand "$@"
+    hadoop_do_classpath_subcommand CLASS "$@"
   ;;
   credential)
     CLASS=org.apache.hadoop.security.alias.CredentialShell

+ 2 - 2
hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

@@ -1305,8 +1305,8 @@ function hadoop_verify_user
 
 function hadoop_do_classpath_subcommand
 {
-  if [[ "$#" -gt 0 ]]; then
-    CLASS=org.apache.hadoop.util.Classpath
+  if [[ "$#" -gt 1 ]]; then
+    eval "$1"=org.apache.hadoop.util.Classpath
   else
     hadoop_finalize
     echo "${CLASSPATH}"

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/bin/hdfs

@@ -94,7 +94,7 @@ case ${COMMAND} in
     CLASS=org.apache.hadoop.hdfs.tools.CacheAdmin
   ;;
   classpath)
-    hadoop_do_classpath_subcommand "$@"
+    hadoop_do_classpath_subcommand CLASS "$@"
   ;;
   crypto)
     CLASS=org.apache.hadoop.hdfs.tools.CryptoAdmin

+ 1 - 1
hadoop-mapreduce-project/bin/mapred

@@ -78,7 +78,7 @@ case ${COMMAND} in
     HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_CLIENT_OPTS}"
   ;;
   classpath)
-    hadoop_do_classpath_subcommand "$@" 
+    hadoop_do_classpath_subcommand CLASS "$@"
   ;;
   distcp)
     CLASS=org.apache.hadoop.tools.DistCp

+ 1 - 1
hadoop-yarn-project/hadoop-yarn/bin/yarn

@@ -82,7 +82,7 @@ case "${COMMAND}" in
     set -- "${COMMAND}" "$@"
   ;;
   classpath)
-    hadoop_do_classpath_subcommand "$@"
+    hadoop_do_classpath_subcommand CLASS "$@"
   ;;
   cluster)
     CLASS=org.apache.hadoop.yarn.client.cli.ClusterCLI