From patchwork Mon Feb 8 12:38:13 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: 378589 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4923655jah; Mon, 8 Feb 2021 10:34:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSxVF8zMrVq4VSuKEI8bMjqbatYC+eBCjZjCqLfnKt/KTlPokTsP5J8Zu0UE7tmCBEFkp0 X-Received: by 2002:a25:6082:: with SMTP id u124mr8460686ybb.214.1612809249198; Mon, 08 Feb 2021 10:34:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612809249; cv=none; d=google.com; s=arc-20160816; b=EPFTnroBndAkiRu0kp3DOhK4bY+hBcqHh0L2zUF5QUK0WwBRvp1fMA75zGOqjSR3d/ d5XlK1d1QvMftdUm2HdvjJyH9AFGHTZnQL5Q0VXBwiU0gqwX7URXhZS5z4MIpovgoIKs Qbt10S3gsrn3K9DZi+KNLQ+s9n4kNtDEIaz7k6g81fFFOI8I1N5CeObHx+a6LoLa/gBi bwweD1iczcWXRG8iel3t0HoMygk9Bp1YAmh2kpKqvrAklozOIe/S4v50XUM642VPDrWa fpIl4RU9jmyF0PSWCpxOUU9+TqzJrm7D7JTR1WZsLgmZ2D//9ase5m89pphBODghwlEO Z5vQ== 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=RoLaaNadYsRBQ0vAb9s/24y/SZHflLdIOBsYDO7si7Q=; b=PZMbpnU4aDW/CHb3b9mUN40bNkzsfkRpsgHLu/cixF2UTgznCjNbRYYg4SYJzLXnuk GrnQ8xRJpOe4cmNZqe4EE65svoriZelWEeUiLgCysGUkI0Ipj4aieHLtjyANiUqpqaYk BW1952MYl0aTsRoSUtAgHeBryP9GgUtSm2BEQv2d/G7Xbt3QTvjtK8i5CsLW/SeYoX8B hgSBmNH9whXIIqYbymgMcu4NML1p3M4hpAw/2nuLbRgfCY8KoQtm5deMOtlqk8f5Fv6h lJ5wSdzzcbBJctdKkyhm5bJ2jhlpLmyRlwxthN1jgvQhPDS4Pl2o8DhB6pN6f+WnZ2uY rhkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SFh46pUv; 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 z184si17578540ybc.57.2021.02.08.10.34.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Feb 2021 10:34:09 -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=SFh46pUv; 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]:41380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9BMO-0005YL-Jr for patch@linaro.org; Mon, 08 Feb 2021 13:34:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l95pk-0003jy-8R for qemu-devel@nongnu.org; Mon, 08 Feb 2021 07:40:04 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:52178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l95pO-0007jk-L7 for qemu-devel@nongnu.org; Mon, 08 Feb 2021 07:40:01 -0500 Received: by mail-wm1-x332.google.com with SMTP id t142so10290400wmt.1 for ; Mon, 08 Feb 2021 04:38:40 -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=RoLaaNadYsRBQ0vAb9s/24y/SZHflLdIOBsYDO7si7Q=; b=SFh46pUv8bG11H+AGpkQlYuJrSimUADigf1IARd0lGq/KtAlJjPeDz3REJQpIafiXu Q4dLVSde9LHqlUOuiEsRGiLA/E0X0OGVgH6k9vt5NmZusTMvLw8qiRc8y4GmItwfVhSX d0Dal10C6ekh/IUNbQc2m1Qc4dqPsiDwLPF4tkRH2kKArfXraRmCEIxEZzGNmzArSyrt tY9pcrOPRNZlQ1Yc/LwOBHb1aHjo9P9DcTXR1NtEJ2Bv+RjEP3WuE55USDQuu4gIOQ5y hGwQdOrWYcFot6zAhf+yWu9KTm2p3GaBrMNFSvTPPDvR5IYnBdkXnOtQLyFfF3C/wFSc PKtQ== 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=RoLaaNadYsRBQ0vAb9s/24y/SZHflLdIOBsYDO7si7Q=; b=ZFBXN6+4oSVNJwKsiRj4hxnC2FaKOoUsHf6LXDtkpX6tqXnw+Lj78g8hh/OEhSe7aR 7Qm0B7fuZoBAdzmaRn43Gl+Fsr9w0Bb7IC3m0IvOfF9B7kIygW67jFd+T4uo5AIGMzD2 Nbt47xK9A+DyRyH5R0e7NZbJJHDIY+CBboBivnpQ0cYh92cHYHbo+r17YS+1FkOXLqOO 0EMuybKwhEwoz0d6UNGyBrKmHLDt81uRJsn2G0focUu8Ts6OCLQxMjuryzMoSazEXMoF FVvB9ilPkXd0IEKek/+r/iUDg2VdRYL6bcqT3aGQqVhY548bk1EwX6WjYWTZYbFTMoEh 5QXg== X-Gm-Message-State: AOAM533ZQ6CcGx3pljqyxBb+bx6Yg8K5bqwLcq6xDshUBqk666rA9HZG YanMJr+2t+e1IhO3A34oCSI0CndbZ99cvMYn X-Received: by 2002:a1c:ab57:: with SMTP id u84mr15045031wme.115.1612787918007; Mon, 08 Feb 2021 04:38:38 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a132sm21159311wmf.42.2021.02.08.04.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 04:38:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7ACDE1FF96; Mon, 8 Feb 2021 12:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 08/16] configure: make version_ge more tolerant of shady version input Date: Mon, 8 Feb 2021 12:38:13 +0000 Message-Id: <20210208123821.19818-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210208123821.19818-1-alex.bennee@linaro.org> References: <20210208123821.19818-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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=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: Paolo Bonzini , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 Tested-by: Thomas Huth Reviewed-by: Eric Blake Message-Id: <20210202134001.25738-8-alex.bennee@linaro.org> -- 2.20.1 diff --git a/configure b/configure index a34f91171d..36036aa2f2 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}