[PATCH] Handle compiler versions containing a dash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux