summaryrefslogtreecommitdiff
path: root/util/scripts
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-11-12 17:29:49 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-11-13 17:43:28 +0000
commit2e5d6a8153756fe036c9eba54fbd7a6c87b157b8 (patch)
treeac0b26b3babd04cfaf114cbb8ac3789a9ec17f5f /util/scripts
parentcca1f371d2c1f775fce69e526a20bd424a4aecb8 (diff)
downloadcoreboot-2e5d6a8153756fe036c9eba54fbd7a6c87b157b8.tar.xz
util/scrips/maintainers.go: Allow file to appear in multiple components
Without this change, the tool only reports the first hit. We want to see all of them. Change-Id: Ib59b13c50b61c48e3cb200bf57e28c9453590819 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/29602 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'util/scripts')
-rw-r--r--util/scripts/maintainers.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index a45758147d..0474b77f90 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -177,6 +177,8 @@ func match_file(fname string, files []string) (bool, error) {
}
func find_maintainer(fname string) {
+ var success bool
+
for _, subsystem := range subsystems {
matched, err := match_file(fname, subsystem.file)
if err != nil {
@@ -184,16 +186,20 @@ func find_maintainer(fname string) {
return
}
if matched && subsystem.name != "THE REST" {
+ success = true
fmt.Println(fname, "is in subsystem",
subsystem.name)
fmt.Println("Maintainers: ", subsystem.maintainer)
- return
}
}
- fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ if !success {
+ fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ }
}
func find_unmaintained(fname string) {
+ var success bool
+
for _, subsystem := range subsystems {
matched, err := match_file(fname, subsystem.file)
if err != nil {
@@ -201,12 +207,14 @@ func find_unmaintained(fname string) {
return
}
if matched && subsystem.name != "THE REST" {
+ success = true
fmt.Println(fname, "is in subsystem",
subsystem.name)
- return
}
}
- fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ if !success {
+ fmt.Println(fname, "has no subsystem defined in MAINTAINERS")
+ }
}
func main() {