[Asterisk-code-review] BuildSystem: When no download utility is available, display ... (asterisk[13])

Alexander Traud asteriskteam at digium.com
Sat Mar 17 08:03:57 CDT 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/8562


Change subject: BuildSystem: When no download utility is available, display the explanation.
......................................................................

BuildSystem: When no download utility is available, display the explanation.

./configure --with-pjproject-bundled
did not display an explanation, when no download utility like wget, curl, or
fetch was installed beforehand, although an explanation existed in code. This
happened because the code expected the variable DOWNLOAD_TO_STDOUT to be empty.
However, the script ./configure set that variable always.

Change-Id: I64c99b76a03525c69471e5055bf124b36a51bbd4
---
M configure
M configure.ac
M sounds/Makefile
M third-party/pjproject/configure.m4
4 files changed, 21 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/8562/1

diff --git a/configure b/configure
index eeb7467..d9f3e8c 100755
--- a/configure
+++ b/configure
@@ -7773,6 +7773,9 @@
 
 
 
+DOWNLOAD=":"
+DOWNLOAD_TO_STDOUT=
+DOWNLOAD_TIMEOUT=
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
   DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
@@ -7823,12 +7826,13 @@
 fi
 
 
-  DOWNLOAD=${FETCH}
-  DOWNLOAD_TO_STDOUT="${FETCH} -o-"
-  DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+  if test "${FETCH}" != ":" ; then
+    DOWNLOAD=${FETCH}
+    DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+    DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+  fi
 fi
 fi
-
 
 
 
@@ -9161,7 +9165,7 @@
 $as_echo "configuring" >&6; }
 
 	if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
-		as_fn_error $? "A download utility (wget, curl or fetch) is required to download bundled pjproject" "$LINENO" 5
+		as_fn_error $? "A download utility (wget, curl, or fetch) is required to download bundled pjproject" "$LINENO" 5
 	fi
 	if test "${BZIP2}" = ":" ; then
 		as_fn_error $? "bzip2 is required to extract the pjproject tar file" "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index c920bae..903f3fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -287,6 +287,9 @@
 AC_PATH_PROG([SED], [sed], :)
 AC_PATH_PROG([NM], [nm], :)
 
+DOWNLOAD=":"
+DOWNLOAD_TO_STDOUT=
+DOWNLOAD_TIMEOUT=
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
   DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
@@ -297,12 +300,13 @@
   DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
 else
   AC_PATH_PROG([FETCH], [fetch], [:])
-  DOWNLOAD=${FETCH}
-  DOWNLOAD_TO_STDOUT="${FETCH} -o-"
-  DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+  if test "${FETCH}" != ":" ; then
+    DOWNLOAD=${FETCH}
+    DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+    DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
+  fi
 fi
 fi
-
 AC_SUBST(DOWNLOAD)
 AC_SUBST(DOWNLOAD_TO_STDOUT)
 AC_SUBST(DOWNLOAD_TIMEOUT)
diff --git a/sounds/Makefile b/sounds/Makefile
index 779d52a..606bbdc 100644
--- a/sounds/Makefile
+++ b/sounds/Makefile
@@ -127,9 +127,9 @@
 	@if test "$(DOWNLOAD)" = ":" ; then \
 		echo "**************************************************"; \
 		echo "***                                            ***"; \
-		echo "*** You must have either wget or fetch to be   ***"; \
-		echo "*** able to automatically download and install ***"; \
-		echo "*** the requested sound packages.              ***"; \
+		echo "*** You must have either wget, curl, or fetch  ***"; \
+		echo "*** to be able to automatically download and   ***"; \
+		echo "*** install the requested sound packages.      ***"; \
 		echo "***                                            ***"; \
 		echo "*** Please install one of these, or remove any ***"; \
 		echo "*** extra sound package selections in          ***"; \
diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4
index c1edaf9..42482b2 100644
--- a/third-party/pjproject/configure.m4
+++ b/third-party/pjproject/configure.m4
@@ -16,7 +16,7 @@
 	AC_MSG_RESULT(configuring)
 
 	if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
-		AC_MSG_ERROR(A download utility (wget, curl or fetch) is required to download bundled pjproject)
+		AC_MSG_ERROR(A download utility (wget, curl, or fetch) is required to download bundled pjproject)
 	fi
 	if test "${BZIP2}" = ":" ; then
 		AC_MSG_ERROR(bzip2 is required to extract the pjproject tar file)

-- 
To view, visit https://gerrit.asterisk.org/8562
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I64c99b76a03525c69471e5055bf124b36a51bbd4
Gerrit-Change-Number: 8562
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180317/adb1ad7e/attachment.html>


More information about the asterisk-code-review mailing list