diff options
| -rwxr-xr-x | minimunin | 1 | ||||
| -rwxr-xr-x | test/conftest | 54 |
2 files changed, 26 insertions, 29 deletions
| @@ -330,7 +330,6 @@ cat <<-EOF | |||
| 330 | graph_args --base 1024 --lower-limit 0 | 330 | graph_args --base 1024 --lower-limit 0 |
| 331 | graph_vlabel bytes | 331 | graph_vlabel bytes |
| 332 | graph_category disk | 332 | graph_category disk |
| 333 | graph_total Total | ||
| 334 | EOF | 333 | EOF |
| 335 | /bin/df -P -t noprocfs,devfs,fdescfs,linprocfs,linsysfs,nfs,nullfs | /usr/bin/tail -n +2 | | 334 | /bin/df -P -t noprocfs,devfs,fdescfs,linprocfs,linsysfs,nfs,nullfs | /usr/bin/tail -n +2 | |
| 336 | while read fs blocks used avail cap mount; do | 335 | while read fs blocks used avail cap mount; do |
diff --git a/test/conftest b/test/conftest index e202e87..5b5a45c 100755 --- a/test/conftest +++ b/test/conftest | |||
| @@ -3,35 +3,33 @@ | |||
| 3 | CONFIG_DIR=./configs | 3 | CONFIG_DIR=./configs |
| 4 | CONFIGS=`/usr/bin/find ${CONFIG_DIR} -type f -exec /usr/bin/grep -v -e ^\# -e ^$ {} \; -exec /bin/echo [] \; 2> /dev/null` | 4 | CONFIGS=`/usr/bin/find ${CONFIG_DIR} -type f -exec /usr/bin/grep -v -e ^\# -e ^$ {} \; -exec /bin/echo [] \; 2> /dev/null` |
| 5 | 5 | ||
| 6 | parse_lines() { | ||
| 7 | unset in_sect | ||
| 8 | while read line; do | ||
| 9 | case ${line## } in | ||
| 10 | \[*\]) v="${line#*[}"; v="${v%%]*}" | ||
| 11 | case $select in | ||
| 12 | ${v}) echo Starting our section "${select}" >&2 | ||
| 13 | in_sect=true | ||
| 14 | ;; | ||
| 15 | *) [ "${in_sect}" ] && echo Ending our section "${select}" >&2 | ||
| 16 | echo Start other section "${v}" >&2 | ||
| 17 | unset in_sect | ||
| 18 | ;; | ||
| 19 | esac | ||
| 20 | ;; | ||
| 21 | env.*) echo "### ${line} ### ${in_sect} ###" >&2 | ||
| 22 | [ "${in_sect}" ] || continue | ||
| 23 | echo Setting environment: ${line#*env.} >&2 | ||
| 24 | _pref=${line#*env.}; _suf=${_pref#* } | ||
| 25 | printf "%s " ${_pref%% *}=\'${_suf}\' | ||
| 26 | ;; | ||
| 27 | *) echo Ignoring ${line} >&2 | ||
| 28 | ;; | ||
| 29 | esac | ||
| 30 | done | ||
| 31 | } | ||
| 32 | |||
| 33 | select=blubber | 6 | select=blubber |
| 34 | _env=$( printf "%s\n" "${CONFIGS}" | parse_lines ) | 7 | |
| 8 | unset in_sect | ||
| 9 | while read line; do | ||
| 10 | case ${line## } in | ||
| 11 | \[*\]) case [$select in | ||
| 12 | ${line%%]*}) echo Starting our section "${select}" >&2 | ||
| 13 | in_sect=true | ||
| 14 | ;; | ||
| 15 | *) [ "${in_sect}" ] && echo Ending our section "${select}" >&2 | ||
| 16 | echo Start other section "${line%%]*}" >&2 | ||
| 17 | unset in_sect | ||
| 18 | ;; | ||
| 19 | esac | ||
| 20 | ;; | ||
| 21 | env.*) echo "### ${line} ### ${in_sect} ###" >&2 | ||
| 22 | [ "${in_sect}" ] || continue | ||
| 23 | echo Setting environment: ${line#*env.} >&2 | ||
| 24 | _pref=${line#*env.}; _suf=${_pref#* } | ||
| 25 | _env="${_env} ${_pref%% *}='${_suf}'" | ||
| 26 | ;; | ||
| 27 | *) echo Ignoring ${line} >&2 | ||
| 28 | ;; | ||
| 29 | esac | ||
| 30 | done <<EOF | ||
| 31 | ${CONFIGS} | ||
| 32 | EOF | ||
| 35 | 33 | ||
| 36 | printf "%s\n" "${_env}" | 34 | printf "%s\n" "${_env}" |
| 37 | eval env ${_env} printenv | 35 | eval env ${_env} printenv |
