From 44f23dcae093db63f69ad12eb288fe072e06da4e Mon Sep 17 00:00:00 2001 From: George Joseph Date: Wed, 16 Aug 2017 14:43:10 -0600 Subject: 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 --- build_tools/download_externals | 27 ++++++++++++++++++--------- build_tools/list_valid_installed_externals | 24 +++++++++++++++++------- 2 files changed, 35 insertions(+), 16 deletions(-) (limited to 'build_tools') diff --git a/build_tools/download_externals b/build_tools/download_externals index f6cc52390..efeb6c53c 100755 --- a/build_tools/download_externals +++ b/build_tools/download_externals @@ -5,7 +5,24 @@ if [[ ( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} > 1 ) || ${BASH_VERSINFO 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- <${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 fi -cache_dir="${EXTERNALS_CACHE_DIR}" if [[ -z ${cache_dir} ]] ; then cache_dir=${tmpdir} fi @@ -191,7 +200,7 @@ if [[ -f ${cache_dir}/${full_name}.manifest.xml ]] ; then fi if [[ ${need_download} = 1 ]] ; then - echo "${full_name}: Downloading ${remote_url}/${tarball}" + echo "${full_name}: Downloading ${remote_url}/${tarball} to ${cache_dir}/${tarball}" ${DOWNLOAD_TO_STDOUT} ${remote_url}/${tarball} > ${cache_dir}/${tarball} || { echo "${full_name}: Unable to fetch ${remote_url}/${tarball}" exit 1 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- <${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 -- cgit v1.2.3