Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760222AbaGYLni (ORCPT ); Fri, 25 Jul 2014 07:43:38 -0400 Received: from mailout1.zih.tu-dresden.de ([141.30.67.72]:34860 "EHLO mailout1.zih.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbaGYLnh (ORCPT ); Fri, 25 Jul 2014 07:43:37 -0400 Message-ID: <53D242DC.9070503@tu-dresden.de> Date: Fri, 25 Jul 2014 13:43:24 +0200 From: Thomas Ilsche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Namhyung Kim CC: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Paul Mackerras , Namhyung Kim , LKML , Jiri Olsa Subject: Re: [PATCH 2/2] perf tools: Default to python version 2 References: <53D135F9.1070104@tu-dresden.de> <1406258045-25726-1-git-send-email-namhyung@kernel.org> <1406258045-25726-2-git-send-email-namhyung@kernel.org> <53D22357.9010005@tu-dresden.de> <87wqb1ivnb.fsf@sejong.aot.lge.com> In-Reply-To: <87wqb1ivnb.fsf@sejong.aot.lge.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms090802080603000406090605" X-TUD-Virus-Scanned: mailout1.zih.tu-dresden.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a cryptographically signed message in MIME format. --------------ms090802080603000406090605 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Namhyung, apologies for mixing up your first name earlier. On 2014-07-25 12:24, Namhyung Kim wrote: > Hi Thomas, >=20 > On Fri, 25 Jul 2014 11:28:55 +0200, Thomas Ilsche wrote: >> Hi Kim, >> >> On 2014-07-25 05:14, Namhyung Kim wrote: >>> According to PEP 394 recommendation [1], it's more portable to use >>> python2 rather than plain python to refer python binary version 2. >> >> I tried to find out how backwards-compatible this is. python2(-config)= >> was first available in Python 2.7.3 (April 2012), but it is still not >> available in 2.6.9 (Oct. 2013). So it might be better to use python2 >> as default but fall back to python if python2 is not available. >> >> Best, >> Thomas >> >> Signed-off-by: Thomas Ilsche >> --- >> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile >> index f4f7f58..1b1bc9c 100644 >> --- a/tools/perf/config/Makefile >> +++ b/tools/perf/config/Makefile >> @@ -117,8 +117,8 @@ ifdef PARSER_DEBUG >> endif >> >> ifndef NO_LIBPYTHON >> - override PYTHON :=3D \ >> - $(call get-executable-or-default,PYTHON,python) >> + PYTHON2 :=3D $(call get-executable-or-default,PYTHON,python2) >=20 > But wouldn't it set PYTHON2 to python2 even if the system doesn't have > python2 actually? >=20 >=20 >> + override PYTHON :=3D $(if $(PYTHON2),$(PYTHON2),$(call get-executab= le,python)) >=20 > And then it'll set PYTHON to python2, no? >=20 No, get-executable-or-default only returns anything if it is an actual ex= ecutable (asserted by a 'command -v' and 'test -f $ -a -x $'). At least this is ho= w I understand the Makefile code. I also tested it with a Python 2.6.9 (no python2 in pa= th) and it worked (after fixing some totally unrelated issues in python headers). It will h= owever complain that "The path 'python2' is not executable." before using python. >=20 >> override PYTHON_CONFIG :=3D \ >> $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) >=20 >=20 > I'm thinking about something like below.. but sadly it doesn't work for= > me.. hmm. Actually this appears to work for me (with 2.6.9 & 2.7.6) and I find this= solution more elegant. Best, Thomas >=20 > Thanks, > Namhyung >=20 >=20 >=20 > diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile > index 0f4b7fbc4852..60177278a357 100644 > --- a/tools/perf/config/Makefile > +++ b/tools/perf/config/Makefile > @@ -121,8 +121,8 @@ ifdef PARSER_DEBUG > endif > =20 > ifndef NO_LIBPYTHON > - override PYTHON :=3D \ > - $(call get-executable-or-default,PYTHON,python2) > + PYTHON2 :=3D $(if $(call get-executable,python2),python2,python) > + override PYTHON :=3D $(call get-executable-or-default,PYTHON,$(PYTHO= N2)) > override PYTHON_CONFIG :=3D \ > $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config) > =20 >=20 --=20 Dipl. Inf. Thomas Ilsche Computer Scientist Highly Adaptive Energy-Efficient Computing CRC 912 HAEC: http://tu-dresden.de/sfb912 Technische Universit=E4t Dresden Center for Information Services and High Performance Computing (ZIH) 01062 Dresden, Germany Phone: +49 351 463-42168 Fax: +49 351 463-3773 E-Mail: thomas.ilsche@tu-dresden.de --------------ms090802080603000406090605 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIPhTCC BHQwggNcoAMCAQICCQCJkBEVWD6HmzANBgkqhkiG9w0BAQsFADBxMQswCQYDVQQGEwJERTEc MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0 IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNMTQwMjEx MTMxMTQ1WhcNMTkwNzA5MjM1OTAwWjBaMQswCQYDVQQGEwJERTETMBEGA1UEChMKREZOLVZl cmVpbjEQMA4GA1UECxMHREZOLVBLSTEkMCIGA1UEAxMbREZOLVZlcmVpbiBQQ0EgR2xvYmFs IC0gRzAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6ZvDZ4X5Da71jVTDllA1 PWLpbkztlNcAW5UidNQg6zSP1uzAMQQLmYHiphTSUqAoI4SLdIkEXlvg4njBeMsWyyg1OXst kEXQ7aAAeny/Sg4bAMOG6VwrMRF7DPOCJEOMHDiLamgAmu7cT3ir0sYTm3at7t4m6O8Br3QP wQmi9mvOvdPNFDBP9eXjpMhim4IaAycwDQJlYE3t0Qk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XQgRHJlc2RlbjEM MAoGA1UECxMDWklIMRwwGgYDVQQDExNUVSBEcmVzZGVuIENBIC0gRzAyMSAwHgYJKoZIhvcN AQkBFhFwa2lAdHUtZHJlc2Rlbi5kZQIHFyxZ1i7USDCBpAYLKoZIhvcNAQkQAgsxgZSggZEw gYUxCzAJBgNVBAYTAkRFMSgwJgYDVQQKEx9UZWNobmlzY2hlIFVuaXZlcnNpdGFldCBEcmVz ZGVuMQwwCgYDVQQLEwNaSUgxHDAaBgNVBAMTE1RVIERyZXNkZW4gQ0EgLSBHMDIxIDAeBgkq hkiG9w0BCQEWEXBraUB0dS1kcmVzZGVuLmRlAgcXLFnWLtRIMA0GCSqGSIb3DQEBAQUABIIB ALn73xqlpzaU+2jm4Vx2lO7XPsNoOW3gnSqfN9DiiG8cZ8vfDnbE7Ud0TiiMDTkYqGXuQuhV +Zi6IPNPz7+GpYWBAqjlEVfCqnve77aLEejONHpe1DaIWZJWJPdZThABLuYK9XkR1TUIlunZ ETodPua6lCZEs0Xwsf9kMrUneUFN0piBvFen43TktMcQB72+CtTt67jDKHyf2FVUB2gpgSSy 2G5ak1ATeonM8fV9CLLkYwnuOxns17Ns+6TRWCltN1QqIPbWSfDfxadrw9KUIkr3wKQ4A9BM yKkagCH1jM7n9oahcXxSoI7La3gNmUO22bmjmZS9E0JuKCW8oJ919ywAAAAAAAA= --------------ms090802080603000406090605-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/