5
Last change
on this file since 74172b7d was
76ad756c,
checked in by Chris Johns <chrisj@…>, on 07/10/14 at 05:56:11
|
FreeBSD standard shell does not support substring expansion.
Switch to using awk to get a string of spaces.
|
-
Property mode set to
100755
|
File size:
826 bytes
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | |
---|
3 | base="c/src/lib/libbsp" |
---|
4 | base_e=$(echo ${base} | sed -e 's/\//\\\//g') |
---|
5 | |
---|
6 | last_arch="" |
---|
7 | |
---|
8 | cfg_list=$(LANG=C LC_COLLATE=C find ${base} -name \*.cfg | sort) |
---|
9 | |
---|
10 | max_bsp_len=0 |
---|
11 | |
---|
12 | for bsp in ${cfg_list}; |
---|
13 | do |
---|
14 | bsp=$(echo ${bsp} | sed -e "s/.*\///" -e 's/\.cfg//') |
---|
15 | len=${#bsp} |
---|
16 | if [ $len -gt $max_bsp_len ]; then |
---|
17 | max_bsp_len=$len |
---|
18 | fi |
---|
19 | done |
---|
20 | max_bsp_len=$(expr ${max_bsp_len} + 2) |
---|
21 | |
---|
22 | echo "RTEMS 4.11" |
---|
23 | for bsp_path in ${cfg_list}; |
---|
24 | do |
---|
25 | arch=$(echo ${bsp_path} | sed -e "s/${base_e}*\///" -e 's/\/.*//') |
---|
26 | bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//') |
---|
27 | path=$(echo ${bsp_path} | sed -e "s/\/make.*//") |
---|
28 | if test "${last_arch}" != "${arch}"; then |
---|
29 | echo "${arch}:" |
---|
30 | last_arch=${arch} |
---|
31 | fi |
---|
32 | spaces=$(echo ${bsp} | awk '{ printf("%*s", '${max_bsp_len}' -length(), " "); }') |
---|
33 | echo " ${bsp}${spaces}${path}" |
---|
34 | done |
---|
35 | |
---|
36 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.