Fix breakage from sed_r change in some auxiliary scripts

... do not overquote the variables from paths.sh.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2017-02-16 12:45:51 -08:00
parent 2d1b469f88
commit 5ea3f2967f
5 changed files with 29 additions and 29 deletions

View File

@ -73,7 +73,7 @@ addToolVersion() {
[ -f "${file}" ] || return 0 [ -f "${file}" ] || return 0
v=$(echo "${version}" |"${sed_r}" -e 's/-/_/g; s/\./_/g;') v=$(echo "${version}" |${sed_r} -e 's/-/_/g; s/\./_/g;')
config_ver_option="${cat}_V_${v}" config_ver_option="${cat}_V_${v}"

View File

@ -59,7 +59,7 @@ for p in "${src}/"*.patch*; do
newname="$(printf "%03d-%s" \ newname="$(printf "%03d-%s" \
"${cpt}" \ "${cpt}" \
"$( basename "${p}" \ "$( basename "${p}" \
|"${sed_r}" -e 's/^[[:digit:]]+[-_]//' \ |${sed_r} -e 's/^[[:digit:]]+[-_]//' \
-e "${sed_re}" \ -e "${sed_re}" \
)" \ )" \
)" )"

View File

@ -15,19 +15,19 @@ awk="@@CT_awk@@"
CT_PREFIX_DIR="$(cd "$(dirname "$0")/.."; pwd)" CT_PREFIX_DIR="$(cd "$(dirname "$0")/.."; pwd)"
CT_GCC="${0%-populate}-gcc" CT_GCC="${0%-populate}-gcc"
CT_READELF="${0%-populate}-readelf" CT_READELF="${0%-populate}-readelf"
CT_CFG_PREFIX_DIR="$("${CT_GCC}" -v 2>&1 \ CT_CFG_PREFIX_DIR="$(${CT_GCC} -v 2>&1 \
|tr ' ' '\n' \ |tr ' ' '\n' \
|"${grep}" -E -- '--prefix=' \ |${grep} -E -- '--prefix=' \
|cut -d = -f 2- |cut -d = -f 2-
)" )"
CT_CFG_SYSROOT_DIR="$("${CT_GCC}" -v 2>&1 \ CT_CFG_SYSROOT_DIR="$(${CT_GCC} -v 2>&1 \
|tr ' ' '\n' \ |tr ' ' '\n' \
|"${grep}" -E -- '--with-sysroot=' \ |${grep} -E -- '--with-sysroot=' \
|cut -d = -f 2- |cut -d = -f 2-
)" )"
CT_SYSROOT_DIR="$(printf "${CT_CFG_SYSROOT_DIR}\n" \ CT_SYSROOT_DIR="$(printf "${CT_CFG_SYSROOT_DIR}\n" \
|"${sed_r}" -e "s:^${CT_CFG_PREFIX_DIR}:${CT_PREFIX_DIR}:;" \ |${sed_r} -e "s:^${CT_CFG_PREFIX_DIR}:${CT_PREFIX_DIR}:;" \
|"${sed_r}" -e 's,/+,/,g;' \ -e 's,/+,/,g;' \
)" )"
myname=$(basename "$0") myname=$(basename "$0")
@ -198,9 +198,9 @@ do_add_lib() {
${CT_PRINTF} ": '%s'\n" "${libfile}" ${CT_PRINTF} ": '%s'\n" "${libfile}"
if [ -e "${libfile}" ]; then if [ -e "${libfile}" ]; then
mkdir -p "${dir}" mkdir -p "${dir}"
true_libname=$("${CT_READELF}" -d "${libfile}" \ true_libname=$("${CT_READELF}" -d "${libfile}" \
|"${grep}" "Library soname:" \ |${grep} "Library soname:" \
|"${sed_r}" -e 's,.+\[(.+)\] *$,\1,;' \ |${sed_r} -e 's,.+\[(.+)\] *$,\1,;' \
) )
case "${libfile}" in case "${libfile}" in
*/ld*) mode=0755;; */ld*) mode=0755;;
@ -225,9 +225,9 @@ do_resolve_deps() {
local file="${1}" local file="${1}"
local libname local libname
for libname in $("${CT_READELF}" -d "${file}" \ for libname in $("${CT_READELF}" -d "${file}" \
|"${grep}" -E '\(NEEDED\)[[:space:]]+Shared library:' \ |${grep} -E '\(NEEDED\)[[:space:]]+Shared library:' \
|"${sed_r}" -e 's,.+\[(.+)\] *$,\1,;' \ |${sed_r} -e 's,.+\[(.+)\] *$,\1,;' \
); do ); do
[ -n "${libname}" ] || continue [ -n "${libname}" ] || continue
${CT_PRINTF} "Searching for '%s' needed by '%s'\n" "${libname}" "${file}" ${CT_PRINTF} "Searching for '%s' needed by '%s'\n" "${libname}" "${file}"
@ -244,15 +244,15 @@ cd "${CT_ROOT_DST_DIR}"
# First of, copy the forced libraries into the working copy # First of, copy the forced libraries into the working copy
lib_list= lib_list=
if [ -n "${CT_LIB_FILE}" ]; then if [ -n "${CT_LIB_FILE}" ]; then
lib_list=$("${sed_r}" -e ':loop; s/#.*//;' \ lib_list=$(${sed_r} -e ':loop; s/#.*//;' \
-e 's/[[:space:]]+//g;' \ -e 's/[[:space:]]+//g;' \
-e 's/([^:])$/\1:/;' \ -e 's/([^:])$/\1:/;' \
-e '/$/N; s/\n//; tloop;' \ -e '/$/N; s/\n//; tloop;' \
"${CT_LIB_FILE}" "${CT_LIB_FILE}"
) )
fi fi
CT_LIB_LIST=$(printf "${CT_LIB_LIST}:${lib_list}\n" \ CT_LIB_LIST=$(printf "${CT_LIB_LIST}:${lib_list}\n" \
|"${sed_r}" -e 's/^:+//; s/:+$//; s/:+/ /g;' \ |${sed_r} -e 's/^:+//; s/:+$//; s/:+/ /g;' \
) )
if [ -n "${CT_LIB_LIST}" ]; then if [ -n "${CT_LIB_LIST}" ]; then
for name in ${CT_LIB_LIST}; do for name in ${CT_LIB_LIST}; do
@ -283,7 +283,7 @@ trap "rm -rf ${CT_TMP_DIR}" EXIT
# List all ELF (executables|shared objects)... # List all ELF (executables|shared objects)...
find . -type f -exec file {} \; \ find . -type f -exec file {} \; \
|"${grep}" -E ': ELF [[:digit:]]+-bit (L|M)SB +(executable|shared object),' \ |${grep} -E ': ELF [[:digit:]]+-bit (L|M)SB +(executable|shared object),' \
|cut -d ":" -f 1 \ |cut -d ":" -f 1 \
>"${CT_TMP_DIR}/files.list" >"${CT_TMP_DIR}/files.list"

View File

@ -75,7 +75,7 @@ fi
if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
# We save the file, and then point the saved sample to this file # We save the file, and then point the saved sample to this file
CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config" CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${samp_dir}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
"${sed_r}" -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \ ${sed_r} -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE)=.+$|\1="'"${samp_top_dir}"'/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
.defconfig .defconfig
else else
# remove any dangling files # remove any dangling files

View File

@ -258,9 +258,9 @@ do_process_file() {
do_trace "Parsing file '%s'\n" "${file}" do_trace "Parsing file '%s'\n" "${file}"
save_search_rpath=( "${search_rpath[@]}" ) save_search_rpath=( "${search_rpath[@]}" )
for n in $( "${readelf}" -d "${file}" \ for n in $( ${readelf} -d "${file}" \
|"${grep}" -E '\((RPATH|RUNPATH)\)' \ |${grep} -E '\((RPATH|RUNPATH)\)' \
|"${sed_r}" -e 's/^.*Library r(|un)path:[[:space:]]+\[(.*)\]$/\2/;'\ |${sed_r} -e 's/^.*Library r(|un)path:[[:space:]]+\[(.*)\]$/\2/;'\
); do ); do
do_trace "-> adding rpath '%s'\n" "${n}" do_trace "-> adding rpath '%s'\n" "${n}"
search_rpath+=( "${n}" ) search_rpath+=( "${n}" )
@ -271,9 +271,9 @@ do_process_file() {
done done
do_trace ": end search path\n" do_trace ": end search path\n"
for n in $( "${readelf}" -d "${file}" \ for n in $( ${readelf} -d "${file}" \
|"${grep}" -E '\(NEEDED\)' \ |${grep} -E '\(NEEDED\)' \
|"${sed_r}" -e 's/^.*Shared library:[[:space:]]+\[([^]]+)\].*/\1/;' \ |${sed_r} -e 's/^.*Shared library:[[:space:]]+\[([^]]+)\].*/\1/;' \
); do ); do
found=0 found=0
for m in "${needed_list[@]}"; do for m in "${needed_list[@]}"; do