Clément Lardeur created CASSANDRA-9598:
------------------------------------------

             Summary: bad classapth for 'sstablerepairedset' in 
'cassandra-tools' package
                 Key: CASSANDRA-9598
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9598
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
         Environment: Debian 3.16.7, cassandra-tools 2.1.6, cassandra 2.1.6
            Reporter: Clément Lardeur
            Priority: Minor


The script 'sstablerepairedset' is not ready out of the box for debian distro, 
maybe due to the refactoring of CASSANDRA-7160 to pack out tools from the bin 
directory.

Actually in 'sstablerepairedset' the classapth is calculated with:
{code}
if [ "x$CLASSPATH" = "x" ]; then
    
    # execute from the build dir.
    if [ -d `dirname $0`/../../build/classes ]; then
        for directory in `dirname $0`/../../build/classes/*; do
            CLASSPATH=$CLASSPATH:$directory
        done
    else
        if [ -f `dirname $0`/../lib/stress.jar ]; then
            CLASSPATH=`dirname $0`/../lib/stress.jar
        fi
    fi

    for jar in `dirname $0`/../../lib/*.jar; do
        CLASSPATH=$CLASSPATH:$jar
    done
fi
{code}

Whereas in other scripts from the 'bin/tools', the classpath is calculated with:
{code}
if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
    for include in "`dirname "$0"`/cassandra.in.sh" \
                   "$HOME/.cassandra.in.sh" \
                   /usr/share/cassandra/cassandra.in.sh \
                   /usr/local/share/cassandra/cassandra.in.sh \
                   /opt/cassandra/cassandra.in.sh; do
        if [ -r "$include" ]; then
            . "$include"
            break
        fi
    done
elif [ -r "$CASSANDRA_INCLUDE" ]; then
    . "$CASSANDRA_INCLUDE"
fi
{code}

I think that a little refactoring could be good to extract the common part of 
these scripts like the computation of the CLASSPATH and the set of JAVA_HOME.






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to