1
0

Match also as string

This commit is contained in:
dump_stack() 2023-04-05 18:01:04 +00:00
parent 72d51c0e1c
commit b98abe4a83
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -182,11 +182,11 @@ func matchDebImagePkg(container, mask string) (pkgs []string, err error) {
return
}
kernels := r.FindAll([]byte(output), -1)
for _, k := range kernels {
pkg := string(k)
for _, pkg := range strings.Fields(output) {
if r.MatchString(pkg) || strings.Contains(pkg, mask) {
pkgs = append(pkgs, pkg)
}
}
return
}