master
text 51 lines 1.27 KB
Raw
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0-or-later
3
4 missing=0
5 present=0
6
7 grep -E '^(R|M):' MAINTAINERS | \
8 sed -E -e 's/^(M|R): //' -e 's/ <.*//' | \
9 sort | uniq > names.txt
10 while IFS= read -r NAME
11 do
12 grep "$NAME" .gitlab-map-{auto,manual} > /dev/null
13 if test $? != 0
14 then
15 echo "Missing GitLab handle for maintainer '$NAME'"
16 missing=$(($missing + 1))
17 else
18 present=$(($present + 1))
19 fi
20 done < names.txt
21 rm -f names.txt
22
23 echo "GitLab handles missing: $missing / present: $present"
24
25 # .gitlab-map-manual is to provide alternate real names
26 # for cases where name in MAINTAINERS does not match
27 # the GitLab account real name. As such...
28
29 # ...all gitlab handles in .gitlab-map-manual must also exist
30 # in .gitlab-map-auto and ....
31 for HANDLE in $(grep -v '^#' .gitlab-map-manual | awk '{print $1}')
32 do
33 grep -E "^$HANDLE\s" .gitlab-map-auto >/dev/null
34 if test $? != 0
35 then
36 echo "Unexpected GitLab handle '$HANDLE' is not a member"
37 fi
38 done
39
40 # ...and all realnames in .gitlab-map-manual must also
41 # exist in MAINTAINERS
42 grep -v '^#' .gitlab-map-manual | \
43 awk '{ $1 = ""; print substr($0, 2) }' | \
44 while IFS= read -r NAME
45 do
46 grep -E "\s$NAME\s" MAINTAINERS >/dev/null
47 if test $? != 0
48 then
49 echo "Unexpected real name '$NAME' is not a maintainer"
50 fi
51 done