From patchwork Sun Apr 19 17:55:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 462638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 4CDC9140150 for ; Mon, 20 Apr 2015 03:56:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7F971A388F; Sun, 19 Apr 2015 17:56:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nAYmfriDazjx; Sun, 19 Apr 2015 17:56:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8D519A390A; Sun, 19 Apr 2015 17:56:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3990A1C242D for ; Sun, 19 Apr 2015 17:56:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 336C0958C8 for ; Sun, 19 Apr 2015 17:56:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cFmav1Vu2ir8 for ; Sun, 19 Apr 2015 17:56:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by hemlock.osuosl.org (Postfix) with ESMTPS id 9422795840 for ; Sun, 19 Apr 2015 17:56:03 +0000 (UTC) Received: from [172.16.2.6] (helo=vandecaa-laptop) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1YjtRp-00027q-HL; Sun, 19 Apr 2015 19:56:01 +0200 Received: from arnout by vandecaa-laptop with local (Exim 4.84) (envelope-from ) id 1YjtRo-0007Wg-Js; Sun, 19 Apr 2015 19:56:00 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Sun, 19 Apr 2015 19:55:55 +0200 Message-Id: <1429466158-28878-5-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1429466158-28878-1-git-send-email-arnout@mind.be> References: <1429466158-28878-1-git-send-email-arnout@mind.be> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v6 5/8] support/download: add possibility to not fail on missing hash X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Yann E. MORIN" In very constrained cases, it might be needed to not fail if a hash is missing. This is notably the case for custom external toolchains to be downloaded, because we do have a .hash file for external toolchains, but we obviously can not have hashes for all existing custom toolchains (he, "custom"!). So, add a way to avoid failing in that case. >From the Makefile, we export the list of files for which not to check the hash. Then, from the check-hash script, if no check was done, and the file we were trying to match in in this exclusion list, we just exit without error. Signed-off-by: "Yann E. MORIN" Signed-off-by: Arnout Vandecappelle (Essensium/Mind) [Arnout: fix the pattern in the case statement] Cc: Thomas Petazzoni Cc: Gustavo Zacarias Reviewed-by: Arnout Vandecappelle (Essensium/Mind) Tested-by: Arnout Vandecappelle (Essensium/Mind) --- Changed v5 -> v6: - fix the pattern in the case clause Changes v4 -> v5: - micro-optimisation, use case-esac instead of a for-loop (Arnout) - typoes (Arnout) Changes v3 -> v4: - drop the magic value, use a list of excluded files (Arnout) Changes v1 -> v2: - fix typoes in commit log Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/pkg-download.mk | 3 +++ support/download/check-hash | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index e274712..1fc23c4 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -60,6 +60,9 @@ domainseparator = $(if $(1),$(1),/) # github(user,package,version): returns site of GitHub repository github = https://github.com/$(1)/$(2)/archive/$(3) +# Expressly do not check hashes for those files +export BR_NO_CHECK_HASH_FOR + ################################################################################ # The DOWNLOAD_* helpers are in charge of getting a working copy # of the source repository for their corresponding SCM, diff --git a/support/download/check-hash b/support/download/check-hash index 678a7ef..d378701 100755 --- a/support/download/check-hash +++ b/support/download/check-hash @@ -99,6 +99,12 @@ while read t h f; do done <"${h_file}" if [ ${nb_checks} -eq 0 ]; then + case " ${BR_NO_CHECK_HASH_FOR} " in + *\ ${base}\ *) + # File explicitly has no hash + exit 0 + ;; + esac printf "ERROR: No hash found for %s\n" "${base}" >&2 exit 0 fi