From 65a44e22ba217ef7272b9d3735e9d12cfaa204f6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 9 May 2020 09:57:51 +0200 Subject: pkg/build: find maintainers for build errors Extract build error source file and obtain maintainers so that we can mail the report to the right people. Update #1667 --- pkg/report/linux.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 0657c4a13..95d1447a4 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -452,12 +452,16 @@ func (ctx *linux) getMaintainers(file string) ([]string, error) { if ctx.kernelSrc == "" { return nil, nil } - mtrs, err := ctx.getMaintainersImpl(file, false) + return GetLinuxMaintainers(ctx.kernelSrc, file) +} + +func GetLinuxMaintainers(kernelSrc, file string) ([]string, error) { + mtrs, err := getMaintainersImpl(kernelSrc, file, false) if err != nil { return nil, err } if len(mtrs) <= 1 { - mtrs, err = ctx.getMaintainersImpl(file, true) + mtrs, err = getMaintainersImpl(kernelSrc, file, true) if err != nil { return nil, err } @@ -465,7 +469,7 @@ func (ctx *linux) getMaintainers(file string) ([]string, error) { return mtrs, nil } -func (ctx *linux) getMaintainersImpl(file string, blame bool) ([]string, error) { +func getMaintainersImpl(kernelSrc, file string, blame bool) ([]string, error) { // See #1441 re --git-min-percent. args := []string{"--no-n", "--no-rolestats", "--git-min-percent=15"} if blame { @@ -473,7 +477,7 @@ func (ctx *linux) getMaintainersImpl(file string, blame bool) ([]string, error) } args = append(args, "-f", file) script := filepath.FromSlash("scripts/get_maintainer.pl") - output, err := osutil.RunCmd(time.Minute, ctx.kernelSrc, script, args...) + output, err := osutil.RunCmd(time.Minute, kernelSrc, script, args...) if err != nil { return nil, err } -- cgit mrf-deployment