[coreboot-gerrit] Change in coreboot[master]: util/scrips/maintainers.go: Allow file to appear in multiple components

Patrick Georgi (Code Review) gerrit at coreboot.org
Mon Nov 12 17:34:28 CET 2018


Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/29602


Change subject: util/scrips/maintainers.go: Allow file to appear in multiple components
......................................................................

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 at google.com>
---
M util/scripts/maintainers.go
1 file changed, 10 insertions(+), 4 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/29602/1

diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go
index 1b8b645..352d0a1 100644
--- a/util/scripts/maintainers.go
+++ b/util/scripts/maintainers.go
@@ -206,6 +206,7 @@
 }
 
 func find_maintainer(fname string) {
+	success := false
 	for _, subsystem := range subsystems {
 		matched, err := match_file(fname, subsystem.file)
 		if err != nil {
@@ -213,16 +214,19 @@
 			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) {
+	success := false
 	for _, subsystem := range subsystems {
 		matched, err := match_file(fname, subsystem.file)
 		if err != nil {
@@ -230,12 +234,14 @@
 			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() {

-- 
To view, visit https://review.coreboot.org/29602
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib59b13c50b61c48e3cb200bf57e28c9453590819
Gerrit-Change-Number: 29602
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181112/b62c3c1d/attachment.html>


More information about the coreboot-gerrit mailing list