Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 731911873F for ; Wed, 24 Feb 2016 13:55:26 +0000 (UTC) Received: (qmail 91109 invoked by uid 500); 24 Feb 2016 13:55:10 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 91010 invoked by uid 500); 24 Feb 2016 13:55:10 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 90988 invoked by uid 99); 24 Feb 2016 13:55:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 13:55:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C8116E8EA3; Wed, 24 Feb 2016 13:55:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jasobrown@apache.org To: commits@cassandra.apache.org Date: Wed, 24 Feb 2016 13:55:09 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/7] cassandra git commit: Update cqlsh python version checking to find python2.7 Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 66b0d3f01 -> 941d13dac refs/heads/cassandra-3.0 d7e0c3018 -> a62397782 refs/heads/trunk a12188cd4 -> e856d8f81 Update cqlsh python version checking to find python2.7 patch by Jeremiah Jordan; reviewed by Stefania Alborghetti for CASSANDRA-11212 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/941d13da Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/941d13da Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/941d13da Branch: refs/heads/cassandra-2.2 Commit: 941d13dac8f67bf959c3f1f66d1972a4750ba116 Parents: 66b0d3f Author: Jeremiah D Jordan Authored: Mon Feb 22 23:31:34 2016 -0600 Committer: Jason Brown Committed: Wed Feb 24 05:51:42 2016 -0800 ---------------------------------------------------------------------- bin/cqlsh | 11 +++++++++-- bin/cqlsh.py | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/941d13da/bin/cqlsh ---------------------------------------------------------------------- diff --git a/bin/cqlsh b/bin/cqlsh index 89d094f..518b986 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -15,5 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. - -python "`python -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@" +# bash code here; finds a suitable python interpreter and execs this file. +# prefer unqualified "python" if suitable: +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \ + && exec python "`python -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@" +for pyver in 2.7; do + which python$pyver > /dev/null 2>&1 && exec python$pyver "`python$pyver -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@" +done +echo "No appropriate python interpreter found." >&2 +exit 1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cassandra/blob/941d13da/bin/cqlsh.py ---------------------------------------------------------------------- diff --git a/bin/cqlsh.py b/bin/cqlsh.py index c82a294..b3ec1ac 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -20,9 +20,9 @@ """:" # bash code here; finds a suitable python interpreter and execs this file. # prefer unqualified "python" if suitable: -python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))' 2>/dev/null \ +python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \ && exec python "$0" "$@" -for pyver in 2.6 2.7 2.5; do +for pyver in 2.7; do which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@" done echo "No appropriate python interpreter found." >&2