summaryrefslogtreecommitdiff
path: root/third-party
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-08-15 15:15:58 -0500
committerRichard Mudgett <rmudgett@digium.com>2017-08-15 15:23:56 -0500
commitc049d1c3b267c6a139807885cbdd126ae2ba1d63 (patch)
tree69d5a7dcf7e8ff4f7cd0e2e8a867731df43cc875 /third-party
parent15fbcc74d8fd1b3655f4c34a280fe76665bd0c5c (diff)
configure: Check cache for valid pjproject tarball before downloading.
On a fresh Asterisk source directory, the bundled pjproject tarball is unconditionally downloaded even if the tarball is already in a specified cache directory. * Made check if the pjproject tarball is valid in the cache directory before downloading the tarball on a fresh source directory. Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
Diffstat (limited to 'third-party')
-rw-r--r--third-party/pjproject/Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index a5b550842..7a42edcde 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -86,6 +86,11 @@ SHELL_ECHO_PREFIX := echo '[pjproject] '
_all: $(TARGETS)
+define tarball_exists
+ (if [ -f $(TARBALL) -a -f $(PJMD5SUM) ] ; then exit 0 ;\
+ else exit 1; fi; )
+endef
+
define verify_tarball
($(SHELL_ECHO_PREFIX) Verifying $(TARBALL) &&\
tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(SED) -n -r -e "s/^([^ ]+)\s+.*/\1/gp") ;\
@@ -111,11 +116,12 @@ TARBALL_URL = $(PJPROJECT_URL)/$(TARBALL_FILE)
PJMD5SUM = $(patsubst %.tar.bz2,%.md5,$(TARBALL))
$(TARBALL): ../versions.mak
- $(CMD_PREFIX) $(download_from_pjproject) || (rm -rf $@ ;\
+ $(CMD_PREFIX) ($(tarball_exists) && $(verify_tarball) && touch $@) || (rm -rf $@ ;\
+ $(download_from_pjproject)) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(download_from_pjproject))
source/.unpacked: $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
- ($(verify_tarball)) || (rm -rf $@ ;\
+ $(CMD_PREFIX) $(verify_tarball) || (rm -rf $@ ;\
$(SHELL_ECHO_PREFIX) Retrying download ; $(download_from_pjproject))
$(ECHO_PREFIX) Unpacking $<
-@rm -rf source pjproject-* >/dev/null 2>&1