source: rtems/rtems-bsps @ 40a24661

4.115
Last change on this file since 40a24661 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
3base="c/src/lib/libbsp"
4base_e=$(echo ${base} | sed -e 's/\//\\\//g')
5
6last_arch=""
7
8cfg_list=$(LANG=C LC_COLLATE=C find ${base} -name \*.cfg | sort)
9
10max_bsp_len=0
11
12for bsp in ${cfg_list};
13do
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
19done
20max_bsp_len=$(expr ${max_bsp_len} + 2)
21
22echo "RTEMS 4.11"
23for bsp_path in ${cfg_list};
24do
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}"
34done
35
36exit 0
Note: See TracBrowser for help on using the repository browser.