cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r793975 - /incubator/cassandra/trunk/bin/cassandra-cli
Date Tue, 14 Jul 2009 17:00:33 GMT
Author: eevans
Date: Tue Jul 14 17:00:33 2009
New Revision: 793975

URL: http://svn.apache.org/viewvc?rev=793975&view=rev
Log:
use consistent mechanisms for setting classpath

Patch by Anthony Molinaro; reviewd by eevans for CASSANDRA-274

Modified:
    incubator/cassandra/trunk/bin/cassandra-cli

Modified: incubator/cassandra/trunk/bin/cassandra-cli
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/bin/cassandra-cli?rev=793975&r1=793974&r2=793975&view=diff
==============================================================================
--- incubator/cassandra/trunk/bin/cassandra-cli (original)
+++ incubator/cassandra/trunk/bin/cassandra-cli Tue Jul 14 17:00:33 2009
@@ -16,23 +16,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-classpath()
-{
-    cassandra_home=`dirname $0`/..
-    classp=$cassandra_home/build/classes
-
-    for j in $cassandra_home/lib/*.jar; do
-        classp=$classp:$j
+if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
+    for include in /usr/share/cassandra/cassandra.in.sh \
+                   /usr/local/share/cassandra/cassandra.in.sh \
+                   /opt/cassandra/cassandra.in.sh \
+                   `dirname $0`/cassandra.in.sh; do
+        if [ -r $include ]; then
+            . $include
+            break
+        fi
     done
-
-    printf $classp
-}
+elif [ -r $CASSANDRA_INCLUDE ]; then
+    . $CASSANDRA_INCLUDE
+fi
 
 if [ -z $CLASSPATH ]; then
-    jvmargs="-cp `classpath`"
+    echo "You must set the CLASSPATH var" >&2
+    exit 1
 fi
 
-java $jvmargs org.apache.cassandra.cli.CliMain "$@"
+java -cp $CLASSPATH  org.apache.cassandra.cli.CliMain "$@"
 
 # vi:ai sw=4 ts=4 tw=0 et



Mime
View raw message