Closed dezza closed 2 years ago
~Out of curiosity, why did you close the PR? This seems like a valuable change.~ Nevermind, I now see your other PR #89.
Yeah.. On afterthought, maybe it would be wiser to drop the regex and do
kernel_info = `uname -r`
version_str, distribution = kernel_info.split('-')
version, major_revision = version_str.split('.')
Polyphony fails to build if
uname -sr
is not formed a certain way, since$KERNEL_INFO_RE
does not match on some systems.Current regex requires:
Other samples I found:
Linux 5.10.60.1-microsoft-standard-WSL2
(Windows Subsystem for Linux), includes-
in word.Linux 5.10.63+
(raspbian), no word presentI propose:
Linux (\d)\.(\d+)(?:\.)?((?:\d+\.?)*)(?:\-)?([\w\-]+)?
Which will match on:
Linux 5.10.63.62.63
, infinite patch numbersLinux 5.10.60.1-microsoft-standard-WSL2
, word at the end including-
This should ensure
Test: https://regex101.com/r/CLX00x/1