diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2014-01-27 19:02:21 -0200 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2014-01-29 18:13:01 -0200 |
commit | 4d2f05a9bad2c8d177dd461586787e7b43b6253c (patch) | |
tree | d46f958425c1ac3b863f9a8dd65048071a6549c7 /scripts/get-maintainer | |
parent | 524e4a6a25828168ff79e6323d58651d0f8c5eb4 (diff) | |
download | meta-fsl-arm-4d2f05a9bad2c8d177dd461586787e7b43b6253c.tar.gz |
scripts/get-maintainer: Allow query of maintainer
The number of boards has been raising in last months and, as result,
the maintainance effort. It is quite difficult to keep all boards in
good shape without sharing the maintenance load among several people.
A maintainer field is now in machine configuration file of
meta-fsl-arm and meta-fsl-arm-extra and this script prints that
information.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'scripts/get-maintainer')
-rwxr-xr-x | scripts/get-maintainer | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/get-maintainer b/scripts/get-maintainer new file mode 100755 index 0000000..d5a7907 --- /dev/null +++ b/scripts/get-maintainer | |||
@@ -0,0 +1,75 @@ | |||
1 | #!/bin/sh | ||
2 | # -*- mode: shell-script; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
3 | # | ||
4 | # Copyright (C) 2014 O.S. Systems Software LTDA. | ||
5 | # Authored-by: Otavio Salvador <otavio@ossystems.com.br> | ||
6 | # | ||
7 | # This program is free software; you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU General Public License version 2 as | ||
9 | # published by the Free Software Foundation. | ||
10 | # | ||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | # GNU General Public License for more details. | ||
15 | # | ||
16 | # You should have received a copy of the GNU General Public License along | ||
17 | # with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | |||
20 | usage() { | ||
21 | cat<<EOF | ||
22 | Usage: | ||
23 | |||
24 | $0 <path> [machine] | ||
25 | |||
26 | Options: | ||
27 | |||
28 | path: directory to look for machine definition files | ||
29 | machine: optinal param to restrict the printing for a specific machine name | ||
30 | |||
31 | |||
32 | EOF | ||
33 | } | ||
34 | |||
35 | path=$1 | ||
36 | specific_machine=$2 | ||
37 | |||
38 | if [ -z "$1" ]; then | ||
39 | usage | ||
40 | return 1 | ||
41 | fi | ||
42 | |||
43 | maintained=`mktemp` | ||
44 | orphan=`mktemp` | ||
45 | |||
46 | machines=`find $path -wholename '*/conf/machine/*.conf'` | ||
47 | for m in $machines; do | ||
48 | machine=`basename $m | sed 's,\.conf$,,g'` | ||
49 | if [ -n "$specific_machine" ] && [ "$machine" != "$specific_machine" ]; then | ||
50 | continue | ||
51 | fi | ||
52 | |||
53 | name=`sed -n 's,#@NAME:\s*\(.*\)\s*,\1,p' $m` | ||
54 | maint=`sed -n 's,#@MAINTAINER:\s*\(.*\)\s*,\1,p' $m` | ||
55 | |||
56 | if [ -n "$maint" ]; then | ||
57 | printf "%-25s %-50s %-50s\n" "$machine" "$name" "$maint" >> $maintained | ||
58 | else | ||
59 | printf "%-25s %-50s %-50s\n" "$machine" "$name" "Orphan" >> $orphan | ||
60 | fi | ||
61 | done | ||
62 | |||
63 | cat <<EOF | ||
64 | ========================= ================================================== ================================================== | ||
65 | Machine Name Maintainer | ||
66 | ========================= ================================================== ================================================== | ||
67 | EOF | ||
68 | sort -u -k 2 $maintained | grep -v $^ | ||
69 | |||
70 | sort -u -k 2 $orphan | grep -v $^ | ||
71 | |||
72 | cat <<EOF | ||
73 | ========================= ================================================== ================================================== | ||
74 | EOF | ||
75 | rm $maintained $orphan | ||