Change order of directory searching for cassandra.in.sh

patch by Wei Deng; reviewed by yukim for CASSANDRA-11628


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c43cf8d7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c43cf8d7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c43cf8d7

Branch: refs/heads/cassandra-3.0
Commit: c43cf8d79b974c8e68938c86f0cc535b700160fa
Parents: 07c9fa2
Author: Wei Deng <weid...@gmail.com>
Authored: Mon Apr 25 20:03:27 2016 -0500
Committer: Yuki Morishita <yu...@apache.org>
Committed: Mon Apr 25 20:03:27 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                      | 1 +
 bin/debug-cql                    | 8 ++++----
 bin/nodetool                     | 9 +++++----
 bin/sstablekeys                  | 9 +++++----
 bin/sstableloader                | 9 +++++----
 bin/sstablescrub                 | 9 +++++----
 bin/sstableupgrade               | 9 +++++----
 tools/bin/cassandra-stress       | 9 +++++----
 tools/bin/cassandra-stressd      | 9 +++++----
 tools/bin/json2sstable           | 9 +++++----
 tools/bin/sstable2json           | 9 +++++----
 tools/bin/sstableexpiredblockers | 9 +++++----
 tools/bin/sstablelevelreset      | 9 +++++----
 tools/bin/sstablemetadata        | 9 +++++----
 tools/bin/sstableofflinerelevel  | 9 +++++----
 tools/bin/sstablerepairedset     | 9 +++++----
 tools/bin/sstablesplit           | 9 +++++----
 17 files changed, 80 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 53945d6..4f6a4db 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Change order of directory searching for cassandra.in.sh to favor local one 
(CASSANDRA-11628)
  * cqlsh COPY FROM fails with []{} chars in UDT/tuple fields/values 
(CASSANDRA-11633)
  * clqsh: COPY FROM throws TypeError with Cython extensions enabled 
(CASSANDRA-11574)
  * cqlsh: COPY FROM ignores NULL values in conversion (CASSANDRA-11549)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/debug-cql
----------------------------------------------------------------------
diff --git a/bin/debug-cql b/bin/debug-cql
index b4ebb82..ae9bfe4 100755
--- a/bin/debug-cql
+++ b/bin/debug-cql
@@ -17,11 +17,11 @@
 
 if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
     # Locations (in order) to use when searching for an include file.
-    for include in /usr/share/cassandra/cassandra.in.sh \
-                   /usr/local/share/cassandra/cassandra.in.sh \
-                   /opt/cassandra/cassandra.in.sh \
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname $0`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/nodetool
----------------------------------------------------------------------
diff --git a/bin/nodetool b/bin/nodetool
index 0ea078f..b6a6fbf 100755
--- a/bin/nodetool
+++ b/bin/nodetool
@@ -23,11 +23,12 @@ if [ "`basename "$0"`" = 'nodeprobe' ]; then
 fi
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/sstablekeys
----------------------------------------------------------------------
diff --git a/bin/sstablekeys b/bin/sstablekeys
index 55b72d9..c0967ef 100755
--- a/bin/sstablekeys
+++ b/bin/sstablekeys
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/sstableloader
----------------------------------------------------------------------
diff --git a/bin/sstableloader b/bin/sstableloader
index b6a6d83..03ab4f9 100755
--- a/bin/sstableloader
+++ b/bin/sstableloader
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/sstablescrub
----------------------------------------------------------------------
diff --git a/bin/sstablescrub b/bin/sstablescrub
index 58bd21b..366a2b7 100755
--- a/bin/sstablescrub
+++ b/bin/sstablescrub
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/bin/sstableupgrade
----------------------------------------------------------------------
diff --git a/bin/sstableupgrade b/bin/sstableupgrade
index a722cdc..7b307eb 100755
--- a/bin/sstableupgrade
+++ b/bin/sstableupgrade
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/cassandra-stress
----------------------------------------------------------------------
diff --git a/tools/bin/cassandra-stress b/tools/bin/cassandra-stress
index 1ffb598..82a3eb5 100755
--- a/tools/bin/cassandra-stress
+++ b/tools/bin/cassandra-stress
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/cassandra-stressd
----------------------------------------------------------------------
diff --git a/tools/bin/cassandra-stressd b/tools/bin/cassandra-stressd
index 229ba0b..48fbef6 100755
--- a/tools/bin/cassandra-stressd
+++ b/tools/bin/cassandra-stressd
@@ -18,11 +18,12 @@
 
 DESC="Cassandra Stress Test Daemon"
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/json2sstable
----------------------------------------------------------------------
diff --git a/tools/bin/json2sstable b/tools/bin/json2sstable
index a58a785..1bed544 100755
--- a/tools/bin/json2sstable
+++ b/tools/bin/json2sstable
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstable2json
----------------------------------------------------------------------
diff --git a/tools/bin/sstable2json b/tools/bin/sstable2json
index 6bbbfc6..92ad5c5 100755
--- a/tools/bin/sstable2json
+++ b/tools/bin/sstable2json
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstableexpiredblockers
----------------------------------------------------------------------
diff --git a/tools/bin/sstableexpiredblockers b/tools/bin/sstableexpiredblockers
index cefdfe3..c1c7e41 100755
--- a/tools/bin/sstableexpiredblockers
+++ b/tools/bin/sstableexpiredblockers
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstablelevelreset
----------------------------------------------------------------------
diff --git a/tools/bin/sstablelevelreset b/tools/bin/sstablelevelreset
index 8191f3d..ec602fd 100755
--- a/tools/bin/sstablelevelreset
+++ b/tools/bin/sstablelevelreset
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstablemetadata
----------------------------------------------------------------------
diff --git a/tools/bin/sstablemetadata b/tools/bin/sstablemetadata
index 5316869..addf39b 100755
--- a/tools/bin/sstablemetadata
+++ b/tools/bin/sstablemetadata
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstableofflinerelevel
----------------------------------------------------------------------
diff --git a/tools/bin/sstableofflinerelevel b/tools/bin/sstableofflinerelevel
index a4ba6cb..4e34515 100755
--- a/tools/bin/sstableofflinerelevel
+++ b/tools/bin/sstableofflinerelevel
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstablerepairedset
----------------------------------------------------------------------
diff --git a/tools/bin/sstablerepairedset b/tools/bin/sstablerepairedset
index efb8a70..225cd11 100755
--- a/tools/bin/sstablerepairedset
+++ b/tools/bin/sstablerepairedset
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c43cf8d7/tools/bin/sstablesplit
----------------------------------------------------------------------
diff --git a/tools/bin/sstablesplit b/tools/bin/sstablesplit
index 90d91ce..037cb63 100755
--- a/tools/bin/sstablesplit
+++ b/tools/bin/sstablesplit
@@ -17,11 +17,12 @@
 # limitations under the License.
 
 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 \
+    # Locations (in order) to use when searching for an include file.
+    for include in "`dirname "$0"`/cassandra.in.sh" \
                    "$HOME/.cassandra.in.sh" \
-                   "`dirname "$0"`/cassandra.in.sh"; do
+                   /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

Reply via email to