From patchwork Fri Jan 22 18:18:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 368657 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1749106jam; Fri, 22 Jan 2021 10:24:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAwNN9CsuKfBINcNCIBcQRNEwSAudQrBE2FYtAyWCPOaI1adhmfkh/6fOtI3Ok/78IaZEg X-Received: by 2002:a25:b5cd:: with SMTP id d13mr8361481ybg.252.1611339851433; Fri, 22 Jan 2021 10:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611339851; cv=none; d=google.com; s=arc-20160816; b=YvCMabalXFyjdLaDuLP7+c+1CBYDMgn1Nczq7W+rRuvgNoHK+rzqG0yUv/+JHj9zrx WEJyQDhSjxpUU2duBOp3HjUnzObBwWpO8Q4VsUbWBuG6IqEc2xsTszpMlUbRt0be9PTY sc700//xefCAK813VBY4gCKlNKTBLwbYAO7aFIs61vaJ5Xl1KbJ4ge9tybX4gYTz2Ko6 T6iBZkTAbUm1c1C5AcW2/9KehqdgRs+VcrkrN1tOK8RjMtAz1Mvi3FLD65iEFI4I4E2K iEVqlSyrplKeYmihT+1DFNOhgWZ9MvCDT0fBfjW5C1PqONpW5Wb2eWxQxU36qrGUOwEi 487A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=f6zl2v9LPncQJucBqnlmMhx3Qi+VNlQAjrIpZhJtkg0=; b=uS4VCjsO2mnmCE2GjoYi2v6ZZmNdGhjP1rD+EK/qfiFhXdn5x1P++fhBxvyIWGGNfT zN3c4xN2SsYyKWaTHuFXbR4/CTrlgauEVo8XQ5kWWVNIt1DZFItq2CXuAZ9hSfmFptBG uA9l5P1QAHNOicMceRpTLk+qhF+Im1rklTWQBYbvICHYTToMG3CJOp5pG72+o8MQ5PEv 30EZ08D/CwjOJ5W66QbrxGIDjnjhjoJnPGuBYLw+9YAqYwYZiN37Ybm2KavDBNergI14 OQpkvTrpArcjfWNm95MquFQnC1BLo9Qnsckdhq1qzMMFPCfqqOla0wJ9jaDy74RdFrK6 Lbdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YgWtAWsv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l31si9608456ybj.104.2021.01.22.10.24.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jan 2021 10:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YgWtAWsv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l316Q-0007DY-Qy for patch@linaro.org; Fri, 22 Jan 2021 13:24:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l311a-0007ak-H9 for qemu-devel@nongnu.org; Fri, 22 Jan 2021 13:19:12 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l311Y-0006tg-RV for qemu-devel@nongnu.org; Fri, 22 Jan 2021 13:19:10 -0500 Received: by mail-wr1-x432.google.com with SMTP id 6so5973220wri.3 for ; Fri, 22 Jan 2021 10:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f6zl2v9LPncQJucBqnlmMhx3Qi+VNlQAjrIpZhJtkg0=; b=YgWtAWsvMlOXXBRmv8vIr3lvZRL4nUPjpiJWS35NlRmW/vMfw9ljNADhUMcfqZ8wUZ T5ZlVL9VBRuj2zPCWqcr3fhmDL0/kOLp6Ns6PiIZbeZ6AFaanY0uyI7CKF/P4Kbm61VQ LWr8BhM1CAc+EqFASEkwdQMKPvph1WBVq2ODTT5ykLgdKEfANPdMLv/G7nIRfO6Qa2/g mqJm09Bpu5DtsyR9nIdfl95lxlNg+2pxnwF1eiQuh4N6UJRLFMiyMBxPCJa2XBcOn/77 Aju+DyF9oXvcByzmA1fNFktcNxvdtfCQmOllFJ1gyZ5BWQ93dS0Eed/w1FxrhZ32OVqX 99jw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=f6zl2v9LPncQJucBqnlmMhx3Qi+VNlQAjrIpZhJtkg0=; b=PMetDSy3d14Q3YqvK20vn8SaQJCmc/i4Ih2e8A/gsQWQZUjZDUFjSYrcGhASyRTSek 669dFIQyInCaHbkhd6aAUdZA6AVORPwMfBiBybkgwbKAQYEuJwJ+ws1QfQ/HuFvcYyCR 3FtIQiQhIxtvZHGtZAw1OPCAXRacPrvLufD936HHI5BqUmY1b3I3RIyX0z7WKYzHY1/s SEQxbXp9HDZsi1x97du8EyONpUnDrnOR62pTf4r2fA6QDjiOuv7+cOOVFVw7C1Gh9/FU qrY4SAnRtJM2X2vtIL+pgXWwEzs8zmF2xhpxndrDgnRBw/Sc6Z6IpSG5e2MBOn4bywJQ DUwg== X-Gm-Message-State: AOAM531gX6IhnaM4oZ6Xb+XeCX4+ByuKJhgIpmXIwcYk6WRI1n12zq9g ae/dnCKXIsSrR6s2tld933CFJw== X-Received: by 2002:adf:cd83:: with SMTP id q3mr1878250wrj.225.1611339547462; Fri, 22 Jan 2021 10:19:07 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l20sm13999756wrh.82.2021.01.22.10.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 10:18:59 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 480A61FF93; Fri, 22 Jan 2021 18:18:55 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 7/8] configure: make version_ge more tolerant of shady version input Date: Fri, 22 Jan 2021 18:18:53 +0000 Message-Id: <20210122181854.23105-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210122181854.23105-1-alex.bennee@linaro.org> References: <20210122181854.23105-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When checking GDB versions we have to tolerate all sorts of random distro extensions to the version string. While we already attempt to do some of that before we call version_ge is makes sense to try and regularise the first input by stripping extraneous -'s. While we at it convert the old-style shell quoting into a cleaner form t shut up my editors linter lest it confuse me by underlining the whole line. Suggested-by: Paolo Bonzini Signed-off-by: Alex Bennée --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Tested-by: Thomas Huth diff --git a/configure b/configure index 6f6a319c2f..dd99939b34 100755 --- a/configure +++ b/configure @@ -198,8 +198,8 @@ has() { } version_ge () { - local_ver1=`echo $1 | tr . ' '` - local_ver2=`echo $2 | tr . ' '` + local_ver1=$(expr "$1" : '\([0-9.]*\)' | tr . ' ') + local_ver2=$(echo "$2" | tr . ' ') while true; do set x $local_ver1 local_first=${2-0}