You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2011/09/30 00:44:48 UTC

svn commit: r1177455 - in /pig/trunk: CHANGES.txt bin/pig

Author: daijy
Date: Thu Sep 29 22:44:48 2011
New Revision: 1177455

URL: http://svn.apache.org/viewvc?rev=1177455&view=rev
Log:
PIG-2310: bin/pig fail when both pig-0.9.1.jar and pig.jar are in PIG_HOME

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/bin/pig

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1177455&r1=1177454&r2=1177455&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Thu Sep 29 22:44:48 2011
@@ -249,6 +249,8 @@ PIG-2221: Couldnt find documentation for
 
 BUG FIXES
 
+PIG-2310: bin/pig fail when both pig-0.9.1.jar and pig.jar are in PIG_HOME (daijy)
+
 PIG-1857: Create an package integration project (eyang via daijy)
 
 PIG-2013: Penny gets a null pointer when no properties are set (breed via daijy)

Modified: pig/trunk/bin/pig
URL: http://svn.apache.org/viewvc/pig/trunk/bin/pig?rev=1177455&r1=1177454&r2=1177455&view=diff
==============================================================================
--- pig/trunk/bin/pig (original)
+++ pig/trunk/bin/pig Thu Sep 29 22:44:48 2011
@@ -57,7 +57,7 @@ done
 this="${BASH_SOURCE-$0}"
 
 # convert relative path to absolute path
-bin=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
+bin=$(cd -P -- "$(dirname -- "$this")">/dev/null && pwd -P)
 script="$(basename -- "$this")"
 this="$bin/$script"
 
@@ -223,7 +223,11 @@ if [ -n "$HADOOP_BIN" ]; then
         echo "Find hadoop at $HADOOP_BIN"
     fi
 
-    PIG_JAR=`echo $PIG_HOME/pig-*withouthadoop.jar`
+    if [ -f $PIG_HOME/pig-withouthadoop.jar ]; then
+        PIG_JAR=$PIG_HOME/pig-withouthadoop.jar
+    else
+        PIG_JAR=`echo $PIG_HOME/pig-?.*withouthadoop.jar`
+    fi
 
     # for deb/rpm package, add pig jar in /usr/share/pig
     if [ -z "$PIG_JAR" ]; then
@@ -255,7 +259,11 @@ else
         echo "Cannot find local hadoop installation, using bundled hadoop 20.2"
     fi
 
-    PIG_JAR=`echo $PIG_HOME/pig!(*withouthadoop).jar`
+    if [ -f $PIG_HOME/pig.jar ]; then
+        PIG_JAR=$PIG_HOME/pig.jar
+    else
+        PIG_JAR=`echo $PIG_HOME/pig-?.!(*withouthadoop).jar`
+    fi
 
     if [ -n "$PIG_JAR" ]; then
         CLASSPATH="${CLASSPATH}:$PIG_JAR"