scripts/build/libc/glibc-eglibc.sh-common
changeset 2274 2f0e9d2cfce5
parent 2273 c6d2311442ad
child 2276 ac021d186cd6
     1.1 --- a/scripts/build/libc/glibc-eglibc.sh-common	Sat Jan 22 22:35:02 2011 +0100
     1.2 +++ b/scripts/build/libc/glibc-eglibc.sh-common	Sat Jan 22 22:35:18 2011 +0100
     1.3 @@ -243,14 +243,16 @@
     1.4  # Build up the addons list, separated with $1
     1.5  do_libc_add_ons_list() {
     1.6      local sep="$1"
     1.7 -    local addons_list=$(echo "${CT_LIBC_ADDONS_LIST//,/${sep}}" |tr -s ,)
     1.8 +    local addons_list="$( echo "${CT_LIBC_ADDONS_LIST}"         \
     1.9 +                          |sed -r -e "s/[[:space:],]/${sep}/g;" \
    1.10 +                        )"
    1.11      case "${CT_THREADS}" in
    1.12          none)   ;;
    1.13          *)      addons_list="${addons_list}${sep}${CT_THREADS}";;
    1.14      esac
    1.15      [ "${CT_LIBC_GLIBC_USE_PORTS}" = "y" ] && addons_list="${addons_list}${sep}ports"
    1.16 -    addons_list="${addons_list%%${sep}}"
    1.17 -    echo "${addons_list##${sep}}"
    1.18 +    # Remove duplicate, leading and trailing separators
    1.19 +    echo "${addons_list}" |sed -r -e "s/${sep}+/${sep}/g; s/^${sep}//; s/${sep}\$//;"
    1.20  }
    1.21  
    1.22  # Compute up the minimum supported Linux kernel version