Kaydet (Commit) faef35d8 authored tarafından Bryan Quigley's avatar Bryan Quigley Kaydeden (comit) Norbert Thiebaud

Move file download verification from md5sum to sha256sum

This leaves all the md5sum parts in place for now, but switches
to using sha256sum. Tries both shasum -a 256 and sha256sum.

Change-Id: I393d0dde56521f6e9e76f3d5a8d15c6c830fd683
Reviewed-on: https://gerrit.libreoffice.org/34633Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst bb2a3df2
......@@ -21,9 +21,9 @@ endef
endif
ifneq (,$(MD5SUM))
ifneq (,$(SHA256SUM))
define fetch_Download__checksum_command
&& SUM=`$(MD5SUM) $1 | sed "s/ .*//"` \
&& SUM=`$(SHA256SUM) $1 | sed "s/ .*//"` \
&& if test "$$SUM" != "$2"; then \
echo ERROR: expected checksum for $1 is $2 2>&1 | tee -a $(fetch_LOGFILE); \
false; \
......@@ -35,7 +35,7 @@ fetch_Download__checksum_command :=
endif
# fetch__Download_item url tarball-name md5sum
# fetch__Download_item url tarball-name sha256sum
define fetch__Download_item
$(if $(wildcard $(TARFILE_LOCATION)/$2),, \
cd $(TARFILE_LOCATION)/tmp \
......@@ -52,7 +52,7 @@ $(filter 32,$(words $(shell echo $(1) | sed -e 's/./& /g')))
endef
define fetch_Download__subst_var
$(subst _DLL,_MD5SUM,$(subst _TARBALL,_MD5SUM,$(subst _PACK,_MD5SUM,$(subst _JAR,_MD5SUM,$(1)))))
$(subst _DLL,_SHA256SUM,$(subst _TARBALL,_SHA256SUM,$(subst _PACK,_SHA256SUM,$(subst _JAR,_SHA256SUM,$(1)))))
endef
# fetch_Download_item url variable-name
......
......@@ -476,6 +476,7 @@ export SDKDIRNAME=@SDKDIRNAME@
export SDKDIRNAME_FOR_BUILD=@SDKDIRNAME_FOR_BUILD@
export SERF_CFLAGS=$(gb_SPACE)@SERF_CFLAGS@
export SERF_LIBS=$(gb_SPACE)@SERF_LIBS@
export SHA256SUM=@SHA256SUM@
export SHOWINCLUDES_PREFIX=@SHOWINCLUDES_PREFIX@
export SOLARINC=@SOLARINC@
export SORT=@SORT@
......
......@@ -11853,6 +11853,37 @@ fi
AC_SUBST(MD5SUM)
#
# check for sha256sum
#
SHA256SUM=
for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
eval "$i -a 256 --version" > /dev/null 2>&1
ret=$?
if test $ret -eq 0; then
SHA256SUM="$i -a 256"
break
fi
done
if test -z "$SHA256SUM"; then
for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
eval "$i --version" > /dev/null 2>&1
ret=$?
if test $ret -eq 0; then
SHA256SUM=$i
break
fi
done
fi
if test -z "$SHA256SUM"; then
AC_MSG_ERROR([no sha256sum found!])
fi
AC_SUBST(SHA256SUM)
dnl ===================================================================
dnl Dealing with l10n options
dnl ===================================================================
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment