aboutsummaryrefslogtreecommitdiffstats
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
parent5640eb575ee7b828713d3d44b3245c8b983b1d6e (diff)
downloadmeta-fsl-arm-7d387273ae2e994daaf988b9d4312ca1f7d75a79.tar.gz
meta-fsl-arm-7d387273ae2e994daaf988b9d4312ca1f7d75a79.tar.bz2
meta-fsl-arm-7d387273ae2e994daaf988b9d4312ca1f7d75a79.zip
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>
-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:
--machine=<machine>
Optional param to restrict the printing for a specific machine name.
+ --dump
+ Generate output in a format which is easier to parse. Columns
+ are separated by TAB. Empty cells for the "Maintainer" column
+ represent "no maintainer".
+
EOF
}
path=
specific_machine=
+dump_mode=
for opt in ${*}; do
if [ "`echo $opt | cut -b-10`" = "--machine=" ]; then
specific_machine="`echo $opt | cut -b11-`"
+ elif [ "$opt" = "--dump" ]; then
+ dump_mode=1
else
path="$path $opt"
fi
@@ -63,23 +71,37 @@ for m in $machines; do
name=`sed -n 's,#@NAME:\s*\(.*\)\s*,\1,p' $m`
maint=`sed -n 's,#@MAINTAINER:\s*\(.*\)\s*,\1,p' $m`
- if [ -n "$maint" ]; then
- printf "%-25s %-50s %-50s\n" "$machine" "$name" "$maint" >> $maintained
- else
- printf "%-25s %-50s %-50s\n" "$machine" "$name" "Orphan" >> $orphan
- fi
+ if [ -n "$dump_mode" ]; then
+ if [ -n "$maint" ]; then
+ echo -e "${machine}\t${name}\t${maint}" >> $maintained
+ else
+ echo -e "${machine}\t${name}" >> $orphan
+ fi
+ else
+ if [ -n "$maint" ]; then
+ printf "%-25s %-50s %-50s\n" "$machine" "$name" "$maint" >> $maintained
+ else
+ printf "%-25s %-50s %-50s\n" "$machine" "$name" "Orphan" >> $orphan
+ fi
+ fi
done
-cat <<EOF
+display() {
+ sort -u -k 2 $maintained | grep -v $^
+ sort -u -k 2 $orphan | grep -v $^
+}
+
+if [ -n "$dump_mode" ]; then
+ display
+else
+ cat <<EOF
========================= ================================================== ==================================================
Machine Name Maintainer
========================= ================================================== ==================================================
EOF
-sort -u -k 2 $maintained | grep -v $^
-
-sort -u -k 2 $orphan | grep -v $^
-
-cat <<EOF
+ display
+ cat <<EOF
========================= ================================================== ==================================================
EOF
+fi
rm $maintained $orphan