pinxi cleanups

This commit is contained in:
Harald Hope 2023-12-10 00:10:27 -08:00
parent d305ab6767
commit 4aa471d81f

18
pinxi
View file

@ -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.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'; # $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\)]+)/){ if ($result =~ /(gcc|clang).*?version\s([^,\s\)]+)/){
$version = $2; @$compiler = ($1,$2);
$version ||= 'N/A';
@$compiler = ($1,$version);
} }
# new styles: compiler + stuff + x.y.z. Ignores modifiers to number: -4, -ubuntu
elsif ($result =~ /(gcc|clang).*?\s(\d+(\.\d+){2,4})[)\s,_-]/){ elsif ($result =~ /(gcc|clang).*?\s(\d+(\.\d+){2,4})[)\s,_-]/){
@$compiler = ($1,$2); @$compiler = ($1,$2);
} }
# failed, let's at least try for compiler type
elsif ($result =~ /(gcc|clang)/){ elsif ($result =~ /(gcc|clang)/){
@$compiler = ($1,'N/A'); @$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; main::log_data('dump','@$compiler',$compiler) if $b_log;
eval $end if $b_log; eval $end if $b_log;