summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMario Domenech Goulart <mario@ossystems.com.br>2014-04-25 10:43:28 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2014-04-25 11:30:17 -0300
commit7d387273ae2e994daaf988b9d4312ca1f7d75a79 (patch)
tree703e575d6de1c38de64b2b4e7d82da3146ad75b4 /scripts
parent5640eb575ee7b828713d3d44b3245c8b983b1d6e (diff)
downloadmeta-fsl-arm-7d387273ae2e994daaf988b9d4312ca1f7d75a79.tar.gz
scripts/get-maintainer: add --dump command line option
--dump generates output in a format which is easier to parse. Columns are separated by TAB. Empty cells for the "Maintainer" column represent "no maintainer". Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get-maintainer44
1 files changed, 33 insertions, 11 deletions
diff --git a/scripts/get-maintainer b/scripts/get-maintainer
index 5b82e35..9d1c0a6 100755
--- a/scripts/get-maintainer
+++ b/scripts/get-maintainer
@@ -31,15 +31,23 @@ Usage:
31 --machine=<machine> 31 --machine=<machine>
32 Optional param to restrict the printing for a specific machine name. 32 Optional param to restrict the printing for a specific machine name.
33 33
34 --dump
35 Generate output in a format which is easier to parse. Columns
36 are separated by TAB. Empty cells for the "Maintainer" column
37 represent "no maintainer".
38
34EOF 39EOF
35} 40}
36 41
37path= 42path=
38specific_machine= 43specific_machine=
44dump_mode=
39 45
40for opt in ${*}; do 46for opt in ${*}; do
41 if [ "`echo $opt | cut -b-10`" = "--machine=" ]; then 47 if [ "`echo $opt | cut -b-10`" = "--machine=" ]; then
42 specific_machine="`echo $opt | cut -b11-`" 48 specific_machine="`echo $opt | cut -b11-`"
49 elif [ "$opt" = "--dump" ]; then
50 dump_mode=1
43 else 51 else
44 path="$path $opt" 52 path="$path $opt"
45 fi 53 fi
@@ -63,23 +71,37 @@ for m in $machines; do
63 name=`sed -n 's,#@NAME:\s*\(.*\)\s*,\1,p' $m` 71 name=`sed -n 's,#@NAME:\s*\(.*\)\s*,\1,p' $m`
64 maint=`sed -n 's,#@MAINTAINER:\s*\(.*\)\s*,\1,p' $m` 72 maint=`sed -n 's,#@MAINTAINER:\s*\(.*\)\s*,\1,p' $m`
65 73
66 if [ -n "$maint" ]; then 74 if [ -n "$dump_mode" ]; then
67 printf "%-25s %-50s %-50s\n" "$machine" "$name" "$maint" >> $maintained 75 if [ -n "$maint" ]; then
68 else 76 echo -e "${machine}\t${name}\t${maint}" >> $maintained
69 printf "%-25s %-50s %-50s\n" "$machine" "$name" "Orphan" >> $orphan 77 else
70 fi 78 echo -e "${machine}\t${name}" >> $orphan
79 fi
80 else
81 if [ -n "$maint" ]; then
82 printf "%-25s %-50s %-50s\n" "$machine" "$name" "$maint" >> $maintained
83 else
84 printf "%-25s %-50s %-50s\n" "$machine" "$name" "Orphan" >> $orphan
85 fi
86 fi
71done 87done
72 88
73cat <<EOF 89display() {
90 sort -u -k 2 $maintained | grep -v $^
91 sort -u -k 2 $orphan | grep -v $^
92}
93
94if [ -n "$dump_mode" ]; then
95 display
96else
97 cat <<EOF
74========================= ================================================== ================================================== 98========================= ================================================== ==================================================
75 Machine Name Maintainer 99 Machine Name Maintainer
76========================= ================================================== ================================================== 100========================= ================================================== ==================================================
77EOF 101EOF
78sort -u -k 2 $maintained | grep -v $^ 102 display
79 103 cat <<EOF
80sort -u -k 2 $orphan | grep -v $^
81
82cat <<EOF
83========================= ================================================== ================================================== 104========================= ================================================== ==================================================
84EOF 105EOF
106fi
85rm $maintained $orphan 107rm $maintained $orphan