From nobody Fri May 17 00:34:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612262960; cv=none; d=zohomail.com; s=zohoarc; b=Iez92f3YFCkUijKgqO08tagfrnxdynt3Gh01EM5keaD6zI517qGEohd3GQ9DZrxItdshgXaUpLooYFt6kCpKo9Pyt5Ys6oJEibDpg9rl8OCH15en6ZlezlOvZaBBvn0tzZq2g84XkGTOdHFAk88bvWOBGaOwC7CNoEnOeaHGBmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612262960; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=810wxp/9K6X+ioRQSFDs4FbQGo2HFJmLTPYdgC9Myro=; b=GeClgIAy59rP0BQHW+KEqq9d9+AsD3cTdOuvUxzLW/JJ5WPRxoBLBGzIad2VaFozWSH/shPDBHphJf2depQnqMg+NERp1VgLaXV3ReITdg3SThyZiXOspawl3iWfWKKqmfvRckyuOzOUlmV95Otrw4RmqgH8BnmzQnLq4NHmhtg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1612262960091483.0983378453643; Tue, 2 Feb 2021 02:49:20 -0800 (PST) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-iHzM_BUbPQOaoyspTzHpNQ-1; Tue, 02 Feb 2021 05:49:15 -0500 Received: by mail-wm1-f71.google.com with SMTP id j204so1256745wmj.4 for ; Tue, 02 Feb 2021 02:49:15 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (7.red-83-57-171.dynamicip.rima-tde.net. [83.57.171.7]) by smtp.gmail.com with ESMTPSA id l11sm29712075wrt.23.2021.02.02.02.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612262959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=810wxp/9K6X+ioRQSFDs4FbQGo2HFJmLTPYdgC9Myro=; b=R/v39G7v4iIUKr4FvacknW0Wpl+F4fFUNFsVQ3+wMXzjqiTGHpDVjjN6qPqExODI3TAxJ2 AhP8vLFbkA+C6yNXfK0bt0cmKZHss2lkMjfdgyZSHFWVkgACP6UEcTBOOzBUMYTgW/8mB1 4xYJkcQgW+xLn8A01OW/GSET0EJm/ZU= X-MC-Unique: iHzM_BUbPQOaoyspTzHpNQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=810wxp/9K6X+ioRQSFDs4FbQGo2HFJmLTPYdgC9Myro=; b=G4K8ZXBN75OveamwXW/QrycNjHXvi759IxeEErEuY/+jojc+1L/jBrsSG55U3xKJaC hWvceMf2OEt9iO8va4MeoJduCUPHiyD2f8wqB37tsQxw5G0ENY73jd74flSSt5w7YUWb C8GMg7579bbI0suXDWBfAFBb+VZrKkFVtkjtj3FkUuODUUbiN2jjmFjeIKvDqWNiASrf M0CfS1y1G23s+j4CI592ORE03OgvDvEV1NLrx7TuLiootCMpsE7nwW1e2o0raAhZDag3 t73jYsjNs1qaAlWHNQC5EcTX6GMYz18IHpku4VKI34beu/QzH5SvPGxtBnDyJLrHvCih s/eg== X-Gm-Message-State: AOAM530G6+Azt3wq97t+oFTaXtY0iGUVhPfY7wS7HOo3KPOSGN5EPyJH s6maq2yY4TyyDoIxBtZPD7M7H+Vr4quBnQHpI2Bwq/cv1mI38JtnQxNcOjy3lTh/LoKhpnueTYy eX7KrxqvVa3er4A== X-Received: by 2002:adf:e404:: with SMTP id g4mr22753030wrm.416.1612262954024; Tue, 02 Feb 2021 02:49:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQxPqTSDYwGVplBMIqLnkYUj8GUcId3gYNhdRUrynVDOH+BZvSLM6qal70AIANGssvgKvbvQ== X-Received: by 2002:adf:e404:: with SMTP id g4mr22753011wrm.416.1612262953816; Tue, 02 Feb 2021 02:49:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] configure: Escape non-numbers in version_ge() Date: Tue, 2 Feb 2021 11:49:11 +0100 Message-Id: <20210202104911.879393-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) On Red Hat based distributions, the configure script emits various warnings: # ./configure Using './build' as the directory for build output ./configure: line 212: test: 2-15: integer expression expected ./configure: line 213: test: 2-15: integer expression expected ./configure: line 212: test: el8: integer expression expected ./configure: line 213: test: el8: integer expression expected This is produced by the gdb version check introduced in commit b1863ccc957 ("configure: gate our use of GDB to 8.3.1 or above"): gdb_version=3D$($gdb_bin --version | head -n 1) if version_ge ${gdb_version##* } 8.3.1; then echo "HAVE_GDB_BIN=3D$gdb_bin" >> $config_host_mak fi Because on RHEL/Fedora the minor version is not a plain number: $ gdb --version | head -n 1 GNU gdb (GDB) Fedora 9.1-7.fc32 $ gdb --version | head -n 1 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-15.el8 Fix by only using the leading numbers, stripping the rest. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index e85d6baf8f8..21f6530a812 100755 --- a/configure +++ b/configure @@ -205,7 +205,7 @@ version_ge () { local_first=3D${2-0} # 'shift 2' if $2 is set, or 'shift' if $2 is not set shift ${2:+2} - local_ver1=3D$* + local_ver1=3D$(echo $* | sed -E 's/(^[0-9]+).*/\1/') set x $local_ver2 # the second argument finished, the first must be greater or equal test $# =3D 1 && return 0 --=20 2.26.2