From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: [PATCH v2 2/3] build: clang version may not be followed by extra words
Date: Fri, 6 Aug 2021 13:52:34 -0700 [thread overview]
Message-ID: <20210806205235.988761-3-gitster@pobox.com> (raw)
In-Reply-To: <20210806205235.988761-1-gitster@pobox.com>
From: Jeff King <peff@peff.net>
The get_family and get_version helpers of detect-compiler assume
that the line to identify the version from the compilers have a
token "version", followed by the version number, followed by some
other string, e.g.
$ CC=gcc get_version_line
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
But that is not necessarily true, e.g.
$ CC=clang get_version_line
Debian clang version 11.0.1-2
Tweak the script not to require extra string after the version.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
detect-compiler | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/detect-compiler b/detect-compiler
index c85be83c64..955be1c906 100755
--- a/detect-compiler
+++ b/detect-compiler
@@ -13,11 +13,11 @@ get_version_line() {
}
get_family() {
- get_version_line | sed 's/^\(.*\) version [0-9][^ ]* .*/\1/'
+ get_version_line | sed 's/^\(.*\) version [0-9].*/\1/'
}
get_version() {
- get_version_line | sed 's/^.* version \([0-9][^ ]*\) .*/\1/'
+ get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
}
print_flags() {
--
2.33.0-rc1-159-gdd7297d7fa
next prev parent reply other threads:[~2021-08-06 20:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 8:06 [PATCH] makefile: update detect-compiler for newer Xcode version Carlo Marcelo Arenas Belón
2021-08-06 12:00 ` Bagas Sanjaya
2021-08-06 13:32 ` Carlo Arenas
2021-08-06 16:37 ` Eric Sunshine
2021-08-06 13:42 ` Atharva Raykar
2021-08-06 18:11 ` Junio C Hamano
2021-08-06 19:20 ` Jeff King
2021-08-06 20:52 ` [PATCH v2 0/3] detect-compiler: clang updates Junio C Hamano
2021-08-06 20:52 ` [PATCH v2 1/3] build: update detect-compiler for newer Xcode version Junio C Hamano
2021-08-06 20:52 ` Junio C Hamano [this message]
2021-08-06 20:52 ` [PATCH v2 3/3] build: catch clang that identifies itself as "$VENDOR clang" Junio C Hamano
2021-08-07 2:09 ` Jeff King
2021-08-07 2:02 ` [PATCH v2 0/3] detect-compiler: clang updates Ævar Arnfjörð Bjarmason
2021-08-07 2:15 ` Jeff King
2021-08-07 2:56 ` Ævar Arnfjörð Bjarmason
2021-08-07 14:13 ` Jeff King
2021-08-07 14:26 ` Ævar Arnfjörð Bjarmason
2021-08-07 14:40 ` Jeff King
2021-08-07 15:36 ` Ævar Arnfjörð Bjarmason
2021-08-09 18:10 ` Jeff King
2021-08-08 0:30 ` Carlo Arenas
2021-08-09 18:08 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210806205235.988761-3-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).