diff options
| author | Mario Domenech Goulart <mario@ossystems.com.br> | 2014-04-25 10:43:28 -0300 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2014-04-25 11:30:17 -0300 |
| commit | 805327430a71e9065f4839a3190cc121ca5f2f16 (patch) | |
| tree | da970ff226d062cba9195ebb2530cd3eca4be447 /meta-fsl-arm/scripts | |
| parent | 6cdc48c8f5d6142b8700611c22ef178aeefbf176 (diff) | |
| download | meta-freescale-805327430a71e9065f4839a3190cc121ca5f2f16.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 'meta-fsl-arm/scripts')
| -rwxr-xr-x | meta-fsl-arm/scripts/get-maintainer | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/meta-fsl-arm/scripts/get-maintainer b/meta-fsl-arm/scripts/get-maintainer index 5b82e3552..9d1c0a627 100755 --- a/meta-fsl-arm/scripts/get-maintainer +++ b/meta-fsl-arm/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 | |||
| 34 | EOF | 39 | EOF |
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | path= | 42 | path= |
| 38 | specific_machine= | 43 | specific_machine= |
| 44 | dump_mode= | ||
| 39 | 45 | ||
| 40 | for opt in ${*}; do | 46 | for 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 | ||
| 71 | done | 87 | done |
| 72 | 88 | ||
| 73 | cat <<EOF | 89 | display() { |
| 90 | sort -u -k 2 $maintained | grep -v $^ | ||
| 91 | sort -u -k 2 $orphan | grep -v $^ | ||
| 92 | } | ||
| 93 | |||
| 94 | if [ -n "$dump_mode" ]; then | ||
| 95 | display | ||
| 96 | else | ||
| 97 | cat <<EOF | ||
| 74 | ========================= ================================================== ================================================== | 98 | ========================= ================================================== ================================================== |
| 75 | Machine Name Maintainer | 99 | Machine Name Maintainer |
| 76 | ========================= ================================================== ================================================== | 100 | ========================= ================================================== ================================================== |
| 77 | EOF | 101 | EOF |
| 78 | sort -u -k 2 $maintained | grep -v $^ | 102 | display |
| 79 | 103 | cat <<EOF | |
| 80 | sort -u -k 2 $orphan | grep -v $^ | ||
| 81 | |||
| 82 | cat <<EOF | ||
| 83 | ========================= ================================================== ================================================== | 104 | ========================= ================================================== ================================================== |
| 84 | EOF | 105 | EOF |
| 106 | fi | ||
| 85 | rm $maintained $orphan | 107 | rm $maintained $orphan |
