[vlc-commits] tools: pick the right/available tool to do the sha512sum check

Steve Lhomme git at videolan.org
Tue Aug 7 08:54:27 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul 20 09:05:24 2018 +0200| [9dc35249e7b87ab1b468f7ba7ba919d54d75ba47] | committer: Steve Lhomme

tools: pick the right/available tool to do the sha512sum check

shasum is not available on the latest msys2
these are the same tools in the same order as the contribs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9dc35249e7b87ab1b468f7ba7ba919d54d75ba47
---

 extras/tools/tools.mak | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 8a86c32de4..240fc6eb80 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -24,9 +24,19 @@ else
 download = $(error Neither curl nor wget found!)
 endif
 
+ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = sha512sum --check
+else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = shasum -a 512 --check
+else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = openssl dgst -sha512
+else
+SHA512SUM = $(error SHA-512 checksumming not found!)
+endif
+
 download_pkg = $(call download,$(VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) || \
 	( $(call download,$(1)) && echo "Please upload package $(lastword $(subst /, ,$(@))) to our FTP" )  \
-	&& grep $(@) SHA512SUMS| shasum -a 512 -c
+	&& grep $(@) SHA512SUMS| $(SHA512SUM)
 
 UNPACK = $(RM) -R $@ \
     $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \



More information about the vlc-commits mailing list