From patchwork Sun Dec 13 18:35:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 556218 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]) by ozlabs.org (Postfix) with ESMTP id 1F8BC14031C for ; Mon, 14 Dec 2015 05:35:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=l8Pe6fFa; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B69AEA5DF3; Sun, 13 Dec 2015 18:35:56 +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 BFtYQt3rCbBZ; Sun, 13 Dec 2015 18:35:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 20471A5DE5; Sun, 13 Dec 2015 18:35:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B426D1BFBFD for ; Sun, 13 Dec 2015 18:35:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B16FA94AA6 for ; Sun, 13 Dec 2015 18:35:45 +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 33cPtM10g9Je for ; Sun, 13 Dec 2015 18:35:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by hemlock.osuosl.org (Postfix) with ESMTPS id 9A20694AA0 for ; Sun, 13 Dec 2015 18:35:43 +0000 (UTC) Received: by wmpp66 with SMTP id p66so34365571wmp.1 for ; Sun, 13 Dec 2015 10:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7FV7yW61rEh4uaPQvHnQvclF/eUHdz44K3sQAC1IWo0=; b=l8Pe6fFaRUvE00AYxan8AaUxqfnBUR51H3DaA+qNDEeqTF8/ANy4tEEMWL/AuiUADh sRFqMBKFZ/rqpJ4PJSiB5pSwgTRoz11dEhlvPozJl0pLrikmYoqS6042CZ9TbSFoSl6H l/wIuqRJMyjL9TDc3/xYxKGt2jhfd3v6G63IEoXMe5AFSFXMz/MiaahHQeCkam/sKpP8 wQTwIDd3btohw40h6SzyecXRb4pDoaug6OyiMWsCPmh0BYKAees8bGfPV6U+AOfKwbrQ fSP/I7bqKQFRlkVPk2vYL5J6vEwcLmypbtYR4JjLmr82o4xLNhHfL4ykSc3GGBumwqxn 7fhA== X-Received: by 10.28.47.8 with SMTP id v8mr19728340wmv.30.1450031742307; Sun, 13 Dec 2015 10:35:42 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id an7sm26302823wjc.44.2015.12.13.10.35.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 Dec 2015 10:35:41 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 13 Dec 2015 19:35:18 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Luca Ceresoli , "Yann E. MORIN" Subject: [Buildroot] [PATCH 09/13 v2] core/legal-info: also save patches 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" Currently, the legal-info infra only saves the source archive of a package. However, that's not enough as we may apply some patches on packages sources. We do suggest users to also redistribute the Buildroot sources as part of their compliance distribution, so the patches bundled in Buildroot would indeed be included in the compliance distribution. However, that's still not enough, since we may download some patches, or the user may use a global patch directory. Patches in there might not end up in the compliance distribution, and there are risks of non-conformity. So, always include patches alongside the source archive. To ensure reproducibility, we also generate a series file, so patches can be re-applied in the correct order. We get the list of patches to include from the list of patches that were applied by the package infrastructure (via the apply-patches support script). So, we need to get packages properly extracted and patched before we can save their legal-info, not just in the case they define _LICENSE_FILES. Update the legal-info header accordingly. Note: this means that, when a package is not patched and defines no LICENSE_FILES, we will extract and patch it for nothing. There is no easy way to know whether we have to patch a package or not. We can only either duplicate the logic to detect patches (bad) or rely on the infra actually patching the package. Also, a vast majority of packages are either patched, or define _LICENSE_FILES, so it is best and easiest to always extract and patch them prior to legal-info. Signed-off-by: "Yann E. MORIN" Cc: Luca Ceresoli Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli --- Changes v1 -> v2; - don't recompute rawname-version needlessly (Luca) --- package/pkg-generic.mk | 12 +++++++----- support/legal-info/README.header | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 9b9a27f..f873e9c 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -760,12 +760,10 @@ $(2)_MANIFEST_LICENSE_FILES = $$($(2)_LICENSE_FILES) endif $(2)_MANIFEST_LICENSE_FILES ?= not saved -# If the package declares _LICENSE_FILES, we need to extract it, -# for overriden, local or normal remote packages alike, whether -# we want to redistribute it or not. -ifneq ($$($(2)_LICENSE_FILES),) +# We need to extract and patch a package to be able to retrieve its +# license files (if any) and the list of patches applied to it (if +# any). $(1)-legal-info: $(1)-patch -endif # We only save the sources of packages we want to redistribute, that are # non-local, and non-overriden. So only store, in the manifest, the tarball @@ -827,6 +825,10 @@ ifeq ($$($(2)_REDISTRIBUTE),YES) $$(Q)$$(call hardlink-copy,\ $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL),\ $$($(2)_REDIST_SOURCES_DIR)) + $$(Q)while read f; do \ + $$(call hardlink-copy,$$$${f},$$($(2)_REDIST_SOURCES_DIR)) || exit 1; \ + printf "%s\n" "$$$${f##*/}" >>$$($(2)_REDIST_SOURCES_DIR)/series || exit 1; \ + done <$$($(2)_DIR)/.applied_patches_list endif # redistribute endif # other packages diff --git a/support/legal-info/README.header b/support/legal-info/README.header index d07c45d..4d7fd7c 100644 --- a/support/legal-info/README.header +++ b/support/legal-info/README.header @@ -16,8 +16,7 @@ This material is composed of the following items. need to collect it manually. * The source code for all packages; this has been saved in the sources/ subdirectory (except for the non-redistributable packages, which have not - been saved); patches applied to some packages by Buildroot are included in - the Buildroot sources and were not duplicated in the sources/ subdirectory. + been saved). * A manifest file listing the configured packages and related information. * The license text of the packages; they have been saved in the licenses/ subdirectory.