diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-09 09:57:51 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-09 09:57:51 +0200 |
| commit | 65a44e22ba217ef7272b9d3735e9d12cfaa204f6 (patch) | |
| tree | 3b88984491a6ca26a688c31adaf7e80134e3a30f /pkg/report/linux.go | |
| parent | e8d62d0c21fa78504c492a1418b84cb2477e06fa (diff) | |
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
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 12 |
1 files changed, 8 insertions, 4 deletions
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 } |
