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

Steve Lhomme git at videolan.org
Thu Jun 18 13:10:13 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul 20 09:05:24 2018 +0200| [79026f77fbef5b3bec64335ce4dde3d29b4a8832] | 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

(cherry picked from commit 9dc35249e7b87ab1b468f7ba7ba919d54d75ba47) (rebased)

rebased:
- 03200ebb49b2ff71ac815177ab09e588760fd9a9 was already merged

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=79026f77fbef5b3bec64335ce4dde3d29b4a8832
---

 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 caba80c19d..929f83f4aa 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 xvzfo $(f)) \



More information about the vlc-commits mailing list