From c3af08639505ca826f0d005eedc863d73c95daff Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 17 Nov 2018 18:15:49 +0100 Subject: support/dependencies: treat BSD-tar like the other cases Currently, when we detect that tar is BSD-tar, we fake an unsupported version (major, minor) and rely on the version check to reject BSD-tar. There is no reason to use such shenanigans, when we can simply reject it from the onset. Simplify the logic: - use positive logic in the condition - directly exit in error Also, comment that case like the other cases are commented. Signed-off-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- support/dependencies/check-host-tar.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'support/dependencies') diff --git a/support/dependencies/check-host-tar.sh b/support/dependencies/check-host-tar.sh index 0857307396..934cb61299 100755 --- a/support/dependencies/check-host-tar.sh +++ b/support/dependencies/check-host-tar.sh @@ -20,10 +20,11 @@ major=`echo "$version" | cut -d. -f1` minor=`echo "$version" | cut -d. -f2` bugfix=`echo "$version" | cut -d. -f3` version_bsd=`$tar --version | grep 'bsdtar'` -if [ ! -z "${version_bsd}" ] ; then - # mark as invalid version - not all command line options are available - major=0 - minor=0 + +# BSD tar does not have all the command-line options +if [ -n "${version_bsd}" ] ; then + # echo nothing: no suitable tar found + exit 1 fi # Minimal version = 1.27 (previous versions do not correctly unpack archives -- cgit v1.2.1 From 2218dc85bef9bb1c9d27788e5ac69593144fe268 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 17 Nov 2018 18:15:51 +0100 Subject: support/dependencies: add a check for a suitable gzip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recently, some hash mismatch have been reported, both by users as well as autobuilder failures, about tarballs generated from git repositories. This turned out to be caused by users having the 'gzip' command somehow aliased to 'pigz' (which stand for: parallel implementation of gzip, which takes advantage of multi-processor system to parallelise the compression). Unfortunately, the output of pigz-compressed archives differ from that of gzip (even though they *are* valid gzip-compressed streams). Add a dependency check that ensures that gzip is not pigz. If that is the case, define a conditional dependency to host-gzip, that is used as a download dependency for packages that will generate compressed files, i.e. cvs, git, and svn. Fixes: http://autobuild.buildroot.org/results/330/3308271fc641cadb59dbf1b5ee529a84f79e6d5c/ Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Peter Korsgaard Cc: Arnout Vandecappelle Cc: Marcin Niestrój Cc: Erico Nunes Signed-off-by: Thomas Petazzoni --- support/dependencies/check-host-gzip.mk | 3 +++ support/dependencies/check-host-gzip.sh | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 support/dependencies/check-host-gzip.mk create mode 100755 support/dependencies/check-host-gzip.sh (limited to 'support/dependencies') diff --git a/support/dependencies/check-host-gzip.mk b/support/dependencies/check-host-gzip.mk new file mode 100644 index 0000000000..bf9a369a7d --- /dev/null +++ b/support/dependencies/check-host-gzip.mk @@ -0,0 +1,3 @@ +ifeq (,$(call suitable-host-package,gzip)) +BR2_GZIP_HOST_DEPENDENCY = host-gzip +endif diff --git a/support/dependencies/check-host-gzip.sh b/support/dependencies/check-host-gzip.sh new file mode 100755 index 0000000000..5f344c5f9b --- /dev/null +++ b/support/dependencies/check-host-gzip.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +candidate="$1" # ignored + +gzip="$(which gzip)" +if [ ! -x "${gzip}" ]; then + # echo nothing: no suitable gzip found + exit 1 +fi + +# gzip displays its version string on stdout +# pigz displays its version string on stderr +version="$("${gzip}" --version 2>&1)" +case "${version}" in + (*pigz*) + # echo nothing: no suitable gzip found + exit 1 + ;; +esac + +printf "%s" "${gzip}" -- cgit v1.2.1