git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Handle compiler versions containing a dash

From
Mike Hommey <mh@glandium.org>
Date
Apr 23, 2023, 09:12 UTC
Message-ID
<20230423091249.2591136-1-mh@glandium.org>
The version reported by e.g. x86_64-w64-mingw32-gcc on Debian bullseye
looks like:
  gcc version 10-win32 20210110 (GCC)
This ends up with detect-compiler failing with:
  ./detect-compiler: 30: test: Illegal number: 10-win32
This change removes the -win32 part by excluding the dash and everything
that follows from the version.
---
 detect-compiler | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/detect-compiler b/detect-compiler
index 50087f5670..d961df5fb5 100755
--- a/detect-compiler
+++ b/detect-compiler
@@ -17,7 +17,7 @@ get_family() {
 }
 
 get_version() {
-	get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/'
+	get_version_line | sed 's/^.* version \([0-9][^ -]*\).*/\1/'
 }
 
 print_flags() {
-- 
2.40.0.1.gc689dad23e
Next: Junio C Hamano
Message 1 of 3 in “Handle compiler versions containing a dash”
  1. Handle compiler versions containing a dashMike Hommey, Apr 23, 2023
  2. Junio C HamanoApr 24, 2023
  3. Handle some compiler versions containing a dashMike Hommey, Apr 26, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.