public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] Handle compiler versions containing a dash
@ 2023-04-23  9:12 Mike Hommey
  2023-04-24 21:40 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2023-04-23  9:12 UTC (permalink / raw)
  To: git; +Cc: gitster, Mike Hommey

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-26  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-23  9:12 [PATCH] Handle compiler versions containing a dash Mike Hommey
2023-04-24 21:40 ` Junio C Hamano
2023-04-26  0:48   ` [PATCH] Handle some " Mike Hommey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox