[Asterisk-code-review] configure: Check cache for valid pjproject tarball before do... (asterisk[13])

Jenkins2 asteriskteam at digium.com
Wed Aug 16 07:06:56 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6232 )

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(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



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/6232
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
Gerrit-Change-Number: 6232
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170816/610d8804/attachment.html>


More information about the asterisk-code-review mailing list