From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0F41C433DB for ; Tue, 2 Feb 2021 10:49:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72240614A7 for ; Tue, 2 Feb 2021 10:49:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72240614A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6tFu-00024W-6x for qemu-devel@archiver.kernel.org; Tue, 02 Feb 2021 05:49:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6tFJ-0001XE-O3 for qemu-devel@nongnu.org; Tue, 02 Feb 2021 05:49:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l6tFG-0004nG-RX for qemu-devel@nongnu.org; Tue, 02 Feb 2021 05:49:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612262957; 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=A5h1HXRNSBp+mfxVjV+xMwZjINj+Mnpl5p1y5QBW+ewnivWjkBTBPBscN3ymY9pe/fABJ5 L2LdAKHvjWyFVDd/x5YqTNoiTa7y9Hk7wloV1HChKrxHQxC9BZMnUyo4vwJhVkHhyaXUda IX79ZEtgqWLw4NkDPcnxsGf8tNla1L8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-UDfVP7_lM4GcQyHO8Aki9Q-1; Tue, 02 Feb 2021 05:49:15 -0500 X-MC-Unique: UDfVP7_lM4GcQyHO8Aki9Q-1 Received: by mail-wm1-f69.google.com with SMTP id y9so1243111wmi.8 for ; Tue, 02 Feb 2021 02:49:15 -0800 (PST) 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=puIfAc0J+Cxked931l/pAGi3YIfca1qkORLr1r2WoqKB/Db5kMF5o6uvEQWUhtRkKZ vz6GzK115mNRPN17FEVarKb7ksikehbJyblDwD1X00eftheXJub1a40tVeMyVKigy4Ny g5SOaT8quwpBCCXI87h/lUDGfY4ahrQTd2oHpzCmuU8UuurRTP+RyLI12g9XezJS6Yiq epxh4gwuv88QadFX5EX9BnHi0t6/92SaBHCRkgIGyQikXVcd22y5xGDK6sZys69Lz3lD /Jv9iPGqv7C1/odZKzj3doQTDmS34cFtTNPbKJA6Aa3tcwZP7cDPAx9U7upOtZFPboj/ KNYA== X-Gm-Message-State: AOAM5326U03xn7FJXvx6B6CrZKXEpKZ6WnfybfpQhqwI2fyuxX1zpTzm NHEbP+WEUUwpG6x6LEKodYaPW/AYLpjMoV2/l5ckFamNwc65judJBcTVhTL3aDuTPg7akb2qZI4 5Ao9Bmf7aE8whV/l+73jW2Ktl5ld6k6vgqje3HKtgUz3NfzjcyrizuclBUWQ95Cxc X-Received: by 2002:adf:e404:: with SMTP id g4mr22753045wrm.416.1612262954135; 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) 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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: 8bit Received-SPF: pass client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.351, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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=$($gdb_bin --version | head -n 1) if version_ge ${gdb_version##* } 8.3.1; then echo "HAVE_GDB_BIN=$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é --- 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=${2-0} # 'shift 2' if $2 is set, or 'shift' if $2 is not set shift ${2:+2} - local_ver1=$* + local_ver1=$(echo $* | sed -E 's/(^[0-9]+).*/\1/') set x $local_ver2 # the second argument finished, the first must be greater or equal test $# = 1 && return 0 -- 2.26.2