Re: [Qemu-devel] [PATCH] configure: more resilient Python version capture

2019-08-26 Thread Cleber Rosa
On Sat, Aug 24, 2019 at 07:32:24AM +, tony.ngu...@bt.com wrote: > > -python_version=$($python -V 2>&1 | sed -e 's/Python\ //') > > +python_version=$(python2 -c 'import sys; print("%d.%d.%d" % > > (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' > > 2>/dev/null) > > On a

Re: [Qemu-devel] [PATCH] configure: more resilient Python version capture

2019-08-25 Thread Peter Maydell
On Sat, 24 Aug 2019 at 08:32, wrote: > > -echo "PYTHON_VERSION=$python_version" >> $config_host_mak > > +echo "PYTHON2=$python2" >> $config_host_mak > ... > > -ifneq ($(findstring v2,"v$(PYTHON_VERSION)"),v2) > > +ifneq ($(PYTHON2),y) > > Succinctly, if Python 3. > > We can further ween the world

Re: [Qemu-devel] [PATCH] configure: more resilient Python version capture

2019-08-24 Thread tony.nguyen
> -python_version=$($python -V 2>&1 | sed -e 's/Python\ //') > +python_version=$(python2 -c 'import sys; print("%d.%d.%d" % > (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) On a Python 3 only system, configure will no longer print the version. e.g. /*

[Qemu-devel] [PATCH] configure: more resilient Python version capture

2019-08-23 Thread Cleber Rosa
The current approach to capture the Python version is fragile, as it was demonstrated by a very specific build of Python 3 on Fedora 29 that, under non-interactive shells would print multiline version information. The (badly) stripped version output would be sent to config-host.mak, producing bad