Accept + within kernel versions

This commit is contained in:
David McFarlane
2024-06-18 11:06:29 +10:00
committed by Jonathon Anderson
parent 2dfd28cb6c
commit 5bb73c90c5
2 changed files with 2 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed ### Changed
- Explicitly ignore compat-style NIS lines in passwd/group during syncuser. #1286 - Explicitly ignore compat-style NIS lines in passwd/group during syncuser. #1286
- Accept `+` within kernel version. #1268
## v4.5.4, 2024-06-12 ## v4.5.4, 2024-06-12

View File

@@ -252,7 +252,7 @@ func FindKernel(root string) (kPath string, version string, err error) {
} }
for _, foundKernel := range potentialKernel { for _, foundKernel := range potentialKernel {
wwlog.Debug("Parsing out kernel version for %s", foundKernel) wwlog.Debug("Parsing out kernel version for %s", foundKernel)
re := regexp.MustCompile(fmt.Sprintf(path.Join(root, searchPath), `([\w\d-\.]*)`)) re := regexp.MustCompile(fmt.Sprintf(path.Join(root, searchPath), `([\w\d-\.+]*)`))
version := re.FindAllStringSubmatch(foundKernel, -1) version := re.FindAllStringSubmatch(foundKernel, -1)
if version == nil { if version == nil {
return foundKernel, "", fmt.Errorf("could not parse kernel version") return foundKernel, "", fmt.Errorf("could not parse kernel version")