From patchwork Sun Jul 16 17:22:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 789097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x9YCc4NjZz9s0Z for ; Mon, 17 Jul 2017 03:22:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RHYbuuX6"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 51C63869BA; Sun, 16 Jul 2017 17:22:50 +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 pQbfGf0n0Du7; Sun, 16 Jul 2017 17:22:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 13027869A5; Sun, 16 Jul 2017 17:22:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 825FD1C059B for ; Sun, 16 Jul 2017 17:22:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7DA8422F65 for ; Sun, 16 Jul 2017 17:22:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5TJ2xE1oCBRi for ; Sun, 16 Jul 2017 17:22:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by silver.osuosl.org (Postfix) with ESMTPS id 8A9C122E06 for ; Sun, 16 Jul 2017 17:22:45 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id u23so19271638wma.2 for ; Sun, 16 Jul 2017 10:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=vRENs07RYjmpmSURb5L6c4JX5kJKOWaX3O0zF9fhcNw=; b=RHYbuuX6owXwHZBD/ZLYWZOo6vrWImHiIGQtMDxSXv8LMpFiwDeBPywuX/H94xnhW/ 7c/rgGEJPs2aQs4EB/mNKPlot/avHlkHM2U+mG9e81pUkmfS1MIEf8J7zaEBfYeOcnO1 QOPHCHoyAW2PI5S3+qbmBH9/C6XySH8NDc1SX85rPSrhMcUsL7NxcNMP3qpkrC3sqaG9 mqf7C2hh69jZPq9FqICDbeeRn37hMGyAJKCU6Q4cI4MaS6Qrr3rLw7DMFwBM9xWtDT9E GTaSh0UAX0BQ1zm2DVjQnc3hS/YMtj8UXokoUg1XEkRuFj3QabL0k6KiqFdKfsSpB9Z1 L+cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=vRENs07RYjmpmSURb5L6c4JX5kJKOWaX3O0zF9fhcNw=; b=I3tLn2cOMDgj+gfgB79u/mQtX+XUCtcfjlz/B49eGQpttH7KHGR5eoL/Jd94l68c9v oKJXB/Ftf55fGT//bONJgmBrwtBe6xNyqs6wUB2f3ukcPamJhverfz3si3dXofcD93jX lVvZJBYtOh+LKl6jaw1UbUASVkRr36lyU8vwkLep/GpHlFXaek1sG5lHrKi6h6S14Avm YVity0G+1ZVATchi+DsfN/+ZIt9TEVhivWcFAm71CQdi2jfV39/rG7asP9dcRbP6lADe D0s5i5rvMCdaX59BVdQ5In9AcoyAnaou5KoQ43tFNXxeN0Fahz1E6H5mfB0U2V7qzZhf BC2Q== X-Gm-Message-State: AIVw112jEJRwSsSPaargc2cYbhruj1QL+NliUE6+d+CLzayoFEL3FIKz u3Jb0naUCxoFd/N8 X-Received: by 10.28.7.19 with SMTP id 19mr1793410wmh.23.1500225763832; Sun, 16 Jul 2017 10:22:43 -0700 (PDT) Received: from localhost.localdomain (2a01cb08861073007d2e439f54691a84.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:7d2e:439f:5469:1a84]) by smtp.gmail.com with ESMTPSA id i32sm28391535wra.5.2017.07.16.10.22.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Jul 2017 10:22:42 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 16 Jul 2017 19:22:39 +0200 Message-Id: <868f6cd4d02b61525edf78c8a11afd2655be3425.1500225742.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Cc: Thomas Petazzoni , Luca Ceresoli , Joshua Henderson , "Yann E. MORIN" Subject: [Buildroot] [PATCH 2/2 v2] core/legal-info: use hash file from version sub-dir 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" When we have multiple versions for a package, and the licensing terms depend on the version actually selected (e.g. like Qt5), storing the hashes for those license files in the .hash file is broken: the infra will ensure that all hashes for a file do match, which would not be the case here. We fix that by first looking for a hash file in the version sub-dir first, and if that does not exist, then we use the main hash file. Drop the useless intermediate variable 'ret'. Update the documentation accordingly. Reported-by: Joshua Henderson Signed-off-by: "Yann E. MORIN" Cc: Joshua Henderson Cc: Thomas Petazzoni Cc: Luca Ceresoli --- Changes v1 -> v2: - fallback to the main hash file iof the version-specific one does not exist (Thomas, Peter, Joshua, Luca) --- docs/manual/adding-packages-directory.txt | 4 +++- package/pkg-utils.mk | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/manual/adding-packages-directory.txt b/docs/manual/adding-packages-directory.txt index 804946c504..809cc97389 100644 --- a/docs/manual/adding-packages-directory.txt +++ b/docs/manual/adding-packages-directory.txt @@ -482,7 +482,9 @@ this in a comment line above the hashes. .Note The hashes for license files are used to detect a license change when a -package version is bumped. +package version is bumped. For a package with multiple versions (like Qt5), +create the hash file in a subdirectory ++ of that package +(see also xref:patch-apply-order[]). .Note The number of spaces does not matter, so one can use spaces (or tabs) to diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index accf48c464..c3acc22b17 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -86,9 +86,12 @@ endef define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET} mkdir -p $(LICENSE_FILES_DIR_$(6))/$(2)/$(dir $(4)) && \ { \ - support/download/check-hash $(3)/$(1).hash $(5) $(4); \ - ret=$${?}; \ - case $${ret} in (0|3) ;; (*) exit 1;; esac; \ + if [ -f $(3)/$($(PKG)_VERSION)/$(1).hash ]; then \ + support/download/check-hash $(3)/$($(PKG)_VERSION)/$(1).hash $(5) $(4); \ + else \ + support/download/check-hash $(3)/$(1).hash $(5) $(4); \ + fi; \ + case $${?} in (0|3) ;; (*) exit 1;; esac; \ } && \ cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4) endef