Contrib: new --no-checksums parameter

The new --no-checksums parameter allows for skipping checksums
verifications. This can be used to replace tarballs and still use the
contrib system.

This is useful for atleast the two following cases:

 - Distro developper needs contrib to patch the source, but has the
   original source in the distribution.

 - Distro developper repacks the source, breaking the checksum.

Change-Id: I015ce3d0f6f4fb2f5fd5ec2f95528bfb4b045298
Tuleap: #879
This commit is contained in:
aviau
2016-07-27 14:42:09 -04:00
parent 63462a0c59
commit 7fa53d79df
2 changed files with 10 additions and 1 deletions

View File

@ -24,6 +24,7 @@ usage()
echo " --build=BUILD configure for building on BUILD"
echo " --host=HOST cross-compile to build to run on HOST"
echo " --prefix=PREFIX install files in PREFIX"
echo " --no-checksums don't verify checksums (allows to replace tarballs)"
echo " --disable-downloads don't download packages from the internet"
echo " --disable-FOO configure to not build package FOO"
echo " --enable-FOO configure to build package FOO"
@ -51,6 +52,9 @@ do
usage
exit 0
;;
--no-checksums)
DISABLE_CONTRIB_CHECKSUMS="TRUE"
;;
--disable-downloads)
DISABLE_CONTRIB_DOWNLOADS="TRUE"
;;
@ -113,6 +117,7 @@ CROSS_COMPILE ?= $HOST-
PKGS_DISABLE := $PKGS_DISABLE
PKGS_ENABLE := $PKGS_ENABLE
DISABLE_CONTRIB_DOWNLOADS := $DISABLE_CONTRIB_DOWNLOADS
DISABLE_CONTRIB_CHECKSUMS := $DISABLE_CONTRIB_CHECKSUMS
EOF
add_make()

View File

@ -337,7 +337,11 @@ checksum = \
"$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS" &&) \
(cd $(TARBALLS) && $(1) /dev/stdin) < \
"$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS"
CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512)
ifeq ($(DISABLE_CONTRIB_CHECKSUMS),TRUE)
CHECK_SHA512 = @echo "Skipping checksum verification..."
else
CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512)
endif
UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \