From 4aa471d81f1698a51944a69d1f7f2234ca8346ea Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Sun, 10 Dec 2023 00:10:27 -0800 Subject: [PATCH] pinxi cleanups --- pinxi | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pinxi b/pinxi index 1397df2..3829c4e 100755 --- a/pinxi +++ b/pinxi @@ -28850,28 +28850,18 @@ sub version_proc { # $result='Linux version 6.5.0-9-generic (buildd@bos03-amd64-043) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) #9-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 7 01:35:40 UTC 2023'; # $result='Linux version 6.5.13-un-def-alt1 (builder@localhost.localdomain) (gcc-13 (GCC) 13.2.1 20230817 (ALT Sisyphus 13.2.1-alt2), GNU ld (GNU Binutils) 2.41.0.20230826) #1 SMP PREEMPT_DYNAMIC Wed Nov 29 15:54:38 UTC 2023'; } - # 'clang version 9.0.0 ('; 'gcc version 7.5.0' + # cleanest, old style: 'clang version 9.0.0 (' | 'gcc version 7.5.0' if ($result =~ /(gcc|clang).*?version\s([^,\s\)]+)/){ - $version = $2; - $version ||= 'N/A'; - @$compiler = ($1,$version); + @$compiler = ($1,$2); } + # new styles: compiler + stuff + x.y.z. Ignores modifiers to number: -4, -ubuntu elsif ($result =~ /(gcc|clang).*?\s(\d+(\.\d+){2,4})[)\s,_-]/){ @$compiler = ($1,$2); } + # failed, let's at least try for compiler type elsif ($result =~ /(gcc|clang)/){ @$compiler = ($1,'N/A'); } -# elsif ($result =~ /\((gcc|clang)[^\(]*\([^\)]+\)\s+([0-9\.]+)(\s[^.]*)?,\s*/){ -# $version = $2; -# $version ||= 'N/A'; -# @$compiler = ($1,$version); -# } -# elsif ($result =~ /\((\S+\s*)(gcc|clang)[^\(]*\([^\)]+\)\s+([0-9\.]+)(\s[^.]*)?,\s*/){ -# $version = $3; -# $version ||= 'N/A'; -# @$compiler = ($2,$version); -# } } main::log_data('dump','@$compiler',$compiler) if $b_log; eval $end if $b_log;