From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 07142429E37 for ; Wed, 7 Dec 2011 01:46:33 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yLp3wh3jQUyb for ; Wed, 7 Dec 2011 01:46:32 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 38192429E26 for ; Wed, 7 Dec 2011 01:46:32 -0800 (PST) Received: from thor.loria.fr (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 271096A0028; Wed, 7 Dec 2011 10:46:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1323251190; bh=8qA6k34z1+ycCRIZYHYiFdffnSgIq5uMciCzVgIspqw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=CZw2RJ/8gq0AEVWYMsq+fHtdARjky1bUyQQvjX7QC/9PvTVqzIhxoEHLSx41PLMkF ljaGG/VwR5ofHef0uSt3xaiWBDnbHQzUOHUbe6VbiKffbyUTf8eeciIQX3QLeYDDvQ 2rAwOyNuvpHxQG3Cz+nOYXP+IHL5jBqg3cARBaFA= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 2/2] test: use python2 instead of python if available Date: Wed, 7 Dec 2011 10:46:18 +0100 Message-Id: <1323251178-20409-2-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1323251178-20409-1-git-send-email-schnouki@schnouki.net> References: <1323251178-20409-1-git-send-email-schnouki@schnouki.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2011 09:46:33 -0000 Some distros (Arch Linux) ship Python as python2 and Python 3 as python. Checking for python2 is necessary for the Python tests to work on these platforms. --- test/test-lib.sh | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 519bd84..155ad3c 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -923,8 +923,14 @@ test_python() { export LD_LIBRARY_PATH=$TEST_DIRECTORY/../lib export PYTHONPATH=$TEST_DIRECTORY/../bindings/python + # Some distros (e.g. Arch Linux) ship Python 2.* as /usr/bin/python2, + # most others as /usr/bin/python. So first try python2, and fallback to + # python if python2 doesn't exist. + cmd=python2 + [[ "$test_missing_external_prereq_python2_" = t ]] && cmd=python + (echo "import sys; _orig_stdout=sys.stdout; sys.stdout=open('OUTPUT', 'w')"; cat) \ - | python - + | $cmd - } test_reset_state_ () { @@ -1157,3 +1163,4 @@ test_declare_external_prereq emacsclient test_declare_external_prereq gdb test_declare_external_prereq gpg test_declare_external_prereq python +test_declare_external_prereq python2 -- 1.7.8