From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40C8B80408 for ; Thu, 16 Mar 2017 10:58:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A0FAC054918; Thu, 16 Mar 2017 17:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9A0FAC054918 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9A0FAC054918 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-73.phx2.redhat.com [10.3.116.73]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05AEE62922; Thu, 16 Mar 2017 17:58:52 +0000 (UTC) To: Jordan Justen , edk2-devel@lists.01.org References: <20170316175258.28091-1-jordan.l.justen@intel.com> From: Laszlo Ersek Message-ID: <7423b414-ccad-c6be-04f3-7e51d41a1a2d@redhat.com> Date: Thu, 16 Mar 2017 18:58:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170316175258.28091-1-jordan.l.justen@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Mar 2017 17:58:53 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg/build.sh: Parse qemu version in more cases X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 17:58:53 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/16/17 18:52, Jordan Justen wrote: > Since qemu v2.7.0, the pkgversion appears to have a bug: > > $ ./configure --target-list=x86_64-softmmu --with-pkgversion=foo > > Results in this output: > > $ x86_64-softmmu/qemu-system-x86_64 -version > QEMU emulator version 2.8.90(foo) > Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers > > This appears to have been introduced in: > > 67a1de0d19 Makefile: Derive "PKGVERSION" from "git describe" by default > > The previous commit (077de81a4c) produces this output: > > $ x86_64-softmmu/qemu-system-x86_64 -version > QEMU emulator version 2.6.50 (foo), Copyright (c) 2003-2008 Fabrice Bellard > > Now the script use grep with '-o' to return only the matched text. > > grep -E is also used with a simple regex to extract only the digits of > the version. > > qemu-bug: https://bugs.launchpad.net/bugs/1673373 > > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jordan Justen > --- > OvmfPkg/build.sh | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh > index b6e936056c..f1acd55883 100755 > --- a/OvmfPkg/build.sh > +++ b/OvmfPkg/build.sh > @@ -223,7 +223,9 @@ if [ -z "$PLATFORMFILE" ]; then > fi > > if [[ "$RUN_QEMU" == "yes" ]]; then > - qemu_version=$($QEMU_COMMAND -version 2>&1 | tail -1 | awk '{print $4}') > + qemu_version=$($QEMU_COMMAND -version 2>&1 | \ > + grep -o -E 'version [0-9]+\.[0-9]+\.[0-9]+' | \ > + awk '{print $2}') > case $qemu_version in > 1.[6-9].*|1.[1-9][0-9].*|2.*.*) > ENABLE_FLASH=yes > Reviewed-by: Laszlo Ersek