[Asterisk-code-review] configure: Check cache for valid pjproject tarball before do... (asterisk[15.0])
Richard Mudgett
asteriskteam at digium.com
Tue Aug 15 15:24:38 CDT 2017
Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/6236
Change subject: configure: Check cache for valid pjproject tarball before downloading.
......................................................................
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
---
M third-party/pjproject/Makefile
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/36/6236/1
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index a5b5508..7a42edc 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -86,6 +86,11 @@
_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 @@
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 $<
- at rm -rf source pjproject-* >/dev/null 2>&1
--
To view, visit https://gerrit.asterisk.org/6236
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15.0
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
Gerrit-Change-Number: 6236
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170815/e771a42d/attachment.html>
More information about the asterisk-code-review
mailing list