From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WbY8e-0003xl-80 for ptxdist@pengutronix.de; Sat, 19 Apr 2014 18:29:18 +0200 Received: by mail-ee0-f43.google.com with SMTP id e53so2460722eek.16 for ; Sat, 19 Apr 2014 09:29:06 -0700 (PDT) Received: from omega (p200300648D45E451E2CB4EFFFE1BB546.dip0.t-ipconnect.de. [2003:64:8d45:e451:e2cb:4eff:fe1b:b546]) by mx.google.com with ESMTPSA id 48sm86905430eee.2.2014.04.19.09.29.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Apr 2014 09:29:05 -0700 (PDT) Date: Sat, 19 Apr 2014 18:29:00 +0200 From: Alexander Aring Message-ID: <20140419162858.GA17216@omega> References: <1397554615-5820-1-git-send-email-alex.aring@gmail.com> <1397554615-5820-3-git-send-email-alex.aring@gmail.com> <20140417073834.GA30047@omega> <20140419141521.GA18640@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140419141521.GA18640@pengutronix.de> Subject: Re: [ptxdist] [PATCH v3 2/4] configure.ac: add check for python 2.x version Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi, On Sat, Apr 19, 2014 at 04:15:21PM +0200, Michael Olbrich wrote: > On Thu, Apr 17, 2014 at 09:38:36AM +0200, Alexander Aring wrote: > > Hi, > > > > On Tue, Apr 15, 2014 at 11:36:53AM +0200, Alexander Aring wrote: > > > Signed-off-by: Alexander Aring > > > --- > > > configure.ac | 12 ++++++++++++ > > > 1 file changed, 12 insertions(+) > > > > > > diff --git a/configure.ac b/configure.ac > > > index 2a97944..ce4e539 100644 > > > --- a/configure.ac > > > +++ b/configure.ac > > > @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl > > > AC_PATH_PROGS(PYTHON, python2.7 python2.6 python) > > > AC_SUBST(PYTHON) > > > ]) > > > + > > > +dnl > > > +dnl Check for Python 2.x > > > +dnl > > > +AC_MSG_CHECKING([check for Python major version]) > > > +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null` > > > > I think a $PYTHON -c "import sys; print(sys.version_info.major) is > > $ python2.6 -c "import sys; print(sys.version_info.major)" > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'tuple' object has no attribute 'major' > grml :( > > better here instead of the array access. I wait for Michaels opinion for > > the rest of the patches in this series. If all seems fine I will resend a v4. > > Maybe parsing "$PYTHON --version" is a better idea? > Yea, I will falling back on the sed solution, which was my first solution to check on the python version. Need to redirect stderr to stdout for this because the version is printed out on stderr. Thanks for you opinion and test with python 2.6. - Alex -- ptxdist mailing list ptxdist@pengutronix.de