diff options
author | George Joseph <gjoseph@digium.com> | 2017-08-16 14:43:10 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-08-16 16:11:58 -0500 |
commit | 0e777258be34b3454ac252d4b9e917465efeb741 (patch) | |
tree | 7a2ffd763ae057d5035c1936269a74f774a7339e /build_tools/list_valid_installed_externals | |
parent | abed04aebc64e54081b1309b0841655ecaba5836 (diff) |
Fix downloader not working with curl
The codec/dpma downloader wasn't handling curl correctly. The logic
that transforms makeopts into a bash-sourceable file wasn't
handling the make 'or' command in DOWNLOAD_TIMEOUT so bash was
looking for an 'or' command.
That logic has been eliminated. Instead of trying to transform
and source makeopts, the downloader now calls a make scriptlet
to print the value of a specific variable. This way, make handles
the ors (or any other make construct that happens to creep into
that file).
ASTERISK-27202
Reported by: Sean McCord
Change-Id: Iadfb6693528e4d4da7b8bb201fa66da2c71c7f99
Diffstat (limited to 'build_tools/list_valid_installed_externals')
-rwxr-xr-x | build_tools/list_valid_installed_externals | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/build_tools/list_valid_installed_externals b/build_tools/list_valid_installed_externals index 194801c94..ed362743c 100755 --- a/build_tools/list_valid_installed_externals +++ b/build_tools/list_valid_installed_externals @@ -6,6 +6,23 @@ fi set -e ASTTOPDIR=${ASTTOPDIR:-.} +export make=`sed -n -r -e "s/^MAKE\s*=\s*//gp" ${ASTTOPDIR}/makeopts` + +getvar() { + $make --quiet --no-print-directory -f- <<EOF +include ${ASTTOPDIR}/makeopts +all: + @echo "\$($1)" +EOF +} + + +XMLSTARLET=`getvar XMLSTARLET` +ASTMODDIR=`getvar ASTMODDIR` +cache_dir=`getvar EXTERNALS_CACHE_DIR` +DOWNLOAD_TO_STDOUT=`getvar DOWNLOAD_TO_STDOUT` +HOST_CPU=`getvar HOST_CPU` +INSTALL=`getvar INSTALL` tmpdir=$(mktemp -d) if [[ -z "${tmpdir}" ]] ; then @@ -14,18 +31,11 @@ if [[ -z "${tmpdir}" ]] ; then fi trap "rm -rf ${tmpdir}" EXIT -# We have to pre-process the makeopts file so it will be parsable by bash -# Surround values with double quotes -# Convert make $(or) functions to bash ${name:-value} -sed -r -e "s/^([^ =]+)\s*=\s*(.*)$/\1=\"\2\"/g" \ - -e 's/^([^ =]+)="\$\(or ([^,]*),([^)]+)\)"/_tmp="\2"\n\1="${_tmp:-\3}"/g' ${ASTTOPDIR}/makeopts >${tmpdir}/makeopts -source ${tmpdir}/makeopts if [[ -z "${ASTMODDIR}" ]] ; then echo "${module_name}: Unable to parse ${ASTTOPDIR}/makeopts." exit 1 fi -XMLSTARLET=${XMLSTARLET:-xmlstarlet} if [[ "${XMLSTARLET}" = ":" ]] ; then echo "${module_name}: The externals downloader requires xmlstarlet to be installed." exit 1 |