All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters
@ 2018-08-22 12:40 Michal Sojka
  2018-08-22 12:40 ` [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest Michal Sojka
  2018-10-21 10:27 ` [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Luca Ceresoli
  0 siblings, 2 replies; 6+ messages in thread
From: Michal Sojka @ 2018-08-22 12:40 UTC (permalink / raw)
  To: buildroot

From: Michal Sojka <sojka@merica.cz>

The last parameter {HOST|TARGET} is now first. With this change,
adding new columns to the legal manifest file (as in the next commit)
will be slightly easier to review.

Signed-off-by: Michal Sojka <sojka@merica.cz>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 Makefile               | 6 +++---
 package/pkg-generic.mk | 2 +-
 package/pkg-utils.mk   | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

No changes between v3 and v4.

diff --git a/Makefile b/Makefile
index f79d39fd26..3d8106e201 100644
--- a/Makefile
+++ b/Makefile
@@ -781,9 +781,9 @@ legal-info-clean:
 legal-info-prepare: $(LEGAL_INFO_DIR)
 	@$(call MESSAGE,"Buildroot $(BR2_VERSION_FULL) Collecting legal info")
 	@$(call legal-license-file,buildroot,buildroot,support/legal-info,COPYING,COPYING,HOST)
-	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,TARGET)
-	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,HOST)
-	@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved,HOST)
+	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
+	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
+	@$(call legal-manifest,HOST,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved)
 	@$(call legal-warning,the Buildroot source code has not been saved)
 	@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
 
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 91b61c6de0..6c9592123d 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -936,7 +936,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 endif # redistribute
 
 endif # other packages
-	@$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call UPPERCASE,$(4)))
+	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE))
 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
 
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index c3acc22b17..8d5ea234e4 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -79,8 +79,8 @@ define legal-warning-nosource # pkg, {local|override}
 	$(call legal-warning-pkg,$(1),sources not saved ($(2) packages not handled))
 endef
 
-define legal-manifest # pkg, version, license, license-files, source, url, {HOST|TARGET}
-	echo '"$(1)","$(2)","$(3)","$(4)","$(5)","$(6)"' >>$(LEGAL_MANIFEST_CSV_$(7))
+define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url
+	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)"' >>$(LEGAL_MANIFEST_CSV_$(1))
 endef
 
 define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET}
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest
  2018-08-22 12:40 [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Michal Sojka
@ 2018-08-22 12:40 ` Michal Sojka
  2018-08-22 17:24   ` Yann E. MORIN
  2018-10-21 10:30   ` Luca Ceresoli
  2018-10-21 10:27 ` [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Luca Ceresoli
  1 sibling, 2 replies; 6+ messages in thread
From: Michal Sojka @ 2018-08-22 12:40 UTC (permalink / raw)
  To: buildroot

From: Michal Sojka <sojka@merica.cz>

This adds one column to the legal-info manifest table. It contains the
dependencies of the given package and their licenses. This information
is useful when assessing license compatibility of the packages and
their libraries.

An example of the content of the new column for the MPD package is
shown below:

    "alsa-lib [LGPL-2.1+ (library), GPL-2.0+ (aserver)] boost
    [BSL-1.0] libid3tag [GPL-2.0+] libmad [GPL-2.0+] libogg
    [BSD-3-Clause] libvorbis [BSD-3-Clause] libzlib [Zlib]
    skeleton-init-common [unknown] skeleton-init-sysv [unknown] sqlite
    [Public domain] toolchain-external-linaro-arm [unknown]"

[Credits to Yann E. MORIN <yann.morin.1998@free.fr> for suggesting a
few simplifications.]

Signed-off-by: Michal Sojka <sojka@merica.cz>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 Makefile               |  4 ++--
 package/pkg-generic.mk | 10 +++++++++-
 package/pkg-utils.mk   | 15 +++++++++++++--
 3 files changed, 24 insertions(+), 5 deletions(-)

Changes between v3 and v4:
* Added comment to legal-deps macro as suggested by Yann E. MORIN.

diff --git a/Makefile b/Makefile
index 3d8106e201..d6809642bd 100644
--- a/Makefile
+++ b/Makefile
@@ -781,8 +781,8 @@ legal-info-clean:
 legal-info-prepare: $(LEGAL_INFO_DIR)
 	@$(call MESSAGE,"Buildroot $(BR2_VERSION_FULL) Collecting legal info")
 	@$(call legal-license-file,buildroot,buildroot,support/legal-info,COPYING,COPYING,HOST)
-	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
-	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
+	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
+	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
 	@$(call legal-manifest,HOST,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved)
 	@$(call legal-warning,the Buildroot source code has not been saved)
 	@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 6c9592123d..a3bedb660f 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -609,6 +609,14 @@ $(2)_FINAL_ALL_DEPENDENCIES = \
 		$$($(2)_FINAL_DEPENDENCIES) \
 		$$($(2)_FINAL_EXTRACT_DEPENDENCIES) \
 		$$($(2)_FINAL_PATCH_DEPENDENCIES))
+$(2)_FINAL_RECURSIVE_DEPENDENCIES = \
+	$$(sort \
+		$$(foreach p,\
+			$$($(2)_FINAL_ALL_DEPENDENCIES),\
+			$$(p)\
+			$$($$(call UPPERCASE,$$(p))_FINAL_RECURSIVE_DEPENDENCIES)\
+		)\
+	)
 
 $(2)_INSTALL_STAGING		?= NO
 $(2)_INSTALL_IMAGES		?= NO
@@ -936,7 +944,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 endif # redistribute
 
 endif # other packages
-	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE))
+	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1)))
 endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
 
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 8d5ea234e4..e9666e2da7 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -79,8 +79,8 @@ define legal-warning-nosource # pkg, {local|override}
 	$(call legal-warning-pkg,$(1),sources not saved ($(2) packages not handled))
 endef
 
-define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url
-	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)"' >>$(LEGAL_MANIFEST_CSV_$(1))
+define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url, dependencies
+	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)","$(8)"' >>$(LEGAL_MANIFEST_CSV_$(1))
 endef
 
 define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET}
@@ -95,3 +95,14 @@ define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-full
 	} && \
 	cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4)
 endef
+
+non-virtual-deps = $(foreach p,$(1),$(if $($(call UPPERCASE,$(p))_IS_VIRTUAL),,$(p)))
+
+# Returns the list of recursive dependencies and their licensing terms
+# for the package specified in parameter (in lowercase). If that
+# package is a target package, remove host packages from the list.
+legal-deps = \
+    $(foreach p,\
+        $(filter-out $(if $(1:host-%=),host-%),\
+            $(call non-virtual-deps,\
+                $($(call UPPERCASE,$(1))_FINAL_RECURSIVE_DEPENDENCIES))),$(p) [$($(call UPPERCASE,$(p))_LICENSE)])
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest
  2018-08-22 12:40 ` [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest Michal Sojka
@ 2018-08-22 17:24   ` Yann E. MORIN
  2018-10-21 10:30   ` Luca Ceresoli
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2018-08-22 17:24 UTC (permalink / raw)
  To: buildroot

Michal, All,

On 2018-08-22 14:40 +0200, Michal Sojka spake thusly:
> From: Michal Sojka <sojka@merica.cz>
> 
> This adds one column to the legal-info manifest table. It contains the
> dependencies of the given package and their licenses. This information
> is useful when assessing license compatibility of the packages and
> their libraries.
> 
> An example of the content of the new column for the MPD package is
> shown below:
> 
>     "alsa-lib [LGPL-2.1+ (library), GPL-2.0+ (aserver)] boost
>     [BSL-1.0] libid3tag [GPL-2.0+] libmad [GPL-2.0+] libogg
>     [BSD-3-Clause] libvorbis [BSD-3-Clause] libzlib [Zlib]
>     skeleton-init-common [unknown] skeleton-init-sysv [unknown] sqlite
>     [Public domain] toolchain-external-linaro-arm [unknown]"
> 
> [Credits to Yann E. MORIN <yann.morin.1998@free.fr> for suggesting a
> few simplifications.]
> 
> Signed-off-by: Michal Sojka <sojka@merica.cz>
> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

With the comment for the legal-deps macro nw added, this reviewed-by can
be turned into an ACK when applying:

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  Makefile               |  4 ++--
>  package/pkg-generic.mk | 10 +++++++++-
>  package/pkg-utils.mk   | 15 +++++++++++++--
>  3 files changed, 24 insertions(+), 5 deletions(-)
> 
> Changes between v3 and v4:
> * Added comment to legal-deps macro as suggested by Yann E. MORIN.
> 
> diff --git a/Makefile b/Makefile
> index 3d8106e201..d6809642bd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -781,8 +781,8 @@ legal-info-clean:
>  legal-info-prepare: $(LEGAL_INFO_DIR)
>  	@$(call MESSAGE,"Buildroot $(BR2_VERSION_FULL) Collecting legal info")
>  	@$(call legal-license-file,buildroot,buildroot,support/legal-info,COPYING,COPYING,HOST)
> -	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
> -	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
> +	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
> +	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
>  	@$(call legal-manifest,HOST,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved)
>  	@$(call legal-warning,the Buildroot source code has not been saved)
>  	@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 6c9592123d..a3bedb660f 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -609,6 +609,14 @@ $(2)_FINAL_ALL_DEPENDENCIES = \
>  		$$($(2)_FINAL_DEPENDENCIES) \
>  		$$($(2)_FINAL_EXTRACT_DEPENDENCIES) \
>  		$$($(2)_FINAL_PATCH_DEPENDENCIES))
> +$(2)_FINAL_RECURSIVE_DEPENDENCIES = \
> +	$$(sort \
> +		$$(foreach p,\
> +			$$($(2)_FINAL_ALL_DEPENDENCIES),\
> +			$$(p)\
> +			$$($$(call UPPERCASE,$$(p))_FINAL_RECURSIVE_DEPENDENCIES)\
> +		)\
> +	)
>  
>  $(2)_INSTALL_STAGING		?= NO
>  $(2)_INSTALL_IMAGES		?= NO
> @@ -936,7 +944,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
>  endif # redistribute
>  
>  endif # other packages
> -	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE))
> +	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1)))
>  endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
>  	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
>  
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> index 8d5ea234e4..e9666e2da7 100644
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -79,8 +79,8 @@ define legal-warning-nosource # pkg, {local|override}
>  	$(call legal-warning-pkg,$(1),sources not saved ($(2) packages not handled))
>  endef
>  
> -define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url
> -	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)"' >>$(LEGAL_MANIFEST_CSV_$(1))
> +define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url, dependencies
> +	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)","$(8)"' >>$(LEGAL_MANIFEST_CSV_$(1))
>  endef
>  
>  define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET}
> @@ -95,3 +95,14 @@ define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-full
>  	} && \
>  	cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4)
>  endef
> +
> +non-virtual-deps = $(foreach p,$(1),$(if $($(call UPPERCASE,$(p))_IS_VIRTUAL),,$(p)))
> +
> +# Returns the list of recursive dependencies and their licensing terms
> +# for the package specified in parameter (in lowercase). If that
> +# package is a target package, remove host packages from the list.
> +legal-deps = \
> +    $(foreach p,\
> +        $(filter-out $(if $(1:host-%=),host-%),\
> +            $(call non-virtual-deps,\
> +                $($(call UPPERCASE,$(1))_FINAL_RECURSIVE_DEPENDENCIES))),$(p) [$($(call UPPERCASE,$(p))_LICENSE)])
> -- 
> 2.18.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters
  2018-08-22 12:40 [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Michal Sojka
  2018-08-22 12:40 ` [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest Michal Sojka
@ 2018-10-21 10:27 ` Luca Ceresoli
  2018-10-21 11:53   ` Luca Ceresoli
  1 sibling, 1 reply; 6+ messages in thread
From: Luca Ceresoli @ 2018-10-21 10:27 UTC (permalink / raw)
  To: buildroot

Hi,

On 22/08/18 14:40, Michal Sojka wrote:
> From: Michal Sojka <sojka@merica.cz>
> 
> The last parameter {HOST|TARGET} is now first. With this change,
> adding new columns to the legal manifest file (as in the next commit)
> will be slightly easier to review.
> 
> Signed-off-by: Michal Sojka <sojka@merica.cz>
> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest
  2018-08-22 12:40 ` [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest Michal Sojka
  2018-08-22 17:24   ` Yann E. MORIN
@ 2018-10-21 10:30   ` Luca Ceresoli
  1 sibling, 0 replies; 6+ messages in thread
From: Luca Ceresoli @ 2018-10-21 10:30 UTC (permalink / raw)
  To: buildroot

Hi,

On 22/08/18 14:40, Michal Sojka wrote:
> From: Michal Sojka <sojka@merica.cz>
> 
> This adds one column to the legal-info manifest table. It contains the
> dependencies of the given package and their licenses. This information
> is useful when assessing license compatibility of the packages and
> their libraries.
> 
> An example of the content of the new column for the MPD package is
> shown below:
> 
>     "alsa-lib [LGPL-2.1+ (library), GPL-2.0+ (aserver)] boost
>     [BSL-1.0] libid3tag [GPL-2.0+] libmad [GPL-2.0+] libogg
>     [BSD-3-Clause] libvorbis [BSD-3-Clause] libzlib [Zlib]
>     skeleton-init-common [unknown] skeleton-init-sysv [unknown] sqlite
>     [Public domain] toolchain-external-linaro-arm [unknown]"
> 
> [Credits to Yann E. MORIN <yann.morin.1998@free.fr> for suggesting a
> few simplifications.]
> 
> Signed-off-by: Michal Sojka <sojka@merica.cz>
> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
>  Makefile               |  4 ++--
>  package/pkg-generic.mk | 10 +++++++++-
>  package/pkg-utils.mk   | 15 +++++++++++++--
>  3 files changed, 24 insertions(+), 5 deletions(-)
> 
> Changes between v3 and v4:
> * Added comment to legal-deps macro as suggested by Yann E. MORIN.
> 
> diff --git a/Makefile b/Makefile
> index 3d8106e201..d6809642bd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -781,8 +781,8 @@ legal-info-clean:
>  legal-info-prepare: $(LEGAL_INFO_DIR)
>  	@$(call MESSAGE,"Buildroot $(BR2_VERSION_FULL) Collecting legal info")
>  	@$(call legal-license-file,buildroot,buildroot,support/legal-info,COPYING,COPYING,HOST)
> -	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
> -	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE)
> +	@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
> +	@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
>  	@$(call legal-manifest,HOST,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved)
>  	@$(call legal-warning,the Buildroot source code has not been saved)
>  	@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 6c9592123d..a3bedb660f 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -609,6 +609,14 @@ $(2)_FINAL_ALL_DEPENDENCIES = \
>  		$$($(2)_FINAL_DEPENDENCIES) \
>  		$$($(2)_FINAL_EXTRACT_DEPENDENCIES) \
>  		$$($(2)_FINAL_PATCH_DEPENDENCIES))
> +$(2)_FINAL_RECURSIVE_DEPENDENCIES = \
> +	$$(sort \
> +		$$(foreach p,\
> +			$$($(2)_FINAL_ALL_DEPENDENCIES),\
> +			$$(p)\
> +			$$($$(call UPPERCASE,$$(p))_FINAL_RECURSIVE_DEPENDENCIES)\
> +		)\
> +	)
>  
>  $(2)_INSTALL_STAGING		?= NO
>  $(2)_INSTALL_IMAGES		?= NO
> @@ -936,7 +944,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
>  endif # redistribute
>  
>  endif # other packages
> -	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE))
> +	@$$(call legal-manifest,$$(call UPPERCASE,$(4)),$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call legal-deps,$(1)))
>  endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
>  	$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
>  
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> index 8d5ea234e4..e9666e2da7 100644
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -79,8 +79,8 @@ define legal-warning-nosource # pkg, {local|override}
>  	$(call legal-warning-pkg,$(1),sources not saved ($(2) packages not handled))
>  endef
>  
> -define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url
> -	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)"' >>$(LEGAL_MANIFEST_CSV_$(1))
> +define legal-manifest # {HOST|TARGET}, pkg, version, license, license-files, source, url, dependencies
> +	echo '"$(2)","$(3)","$(4)","$(5)","$(6)","$(7)","$(8)"' >>$(LEGAL_MANIFEST_CSV_$(1))
>  endef
>  
>  define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET}
> @@ -95,3 +95,14 @@ define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-full
>  	} && \
>  	cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4)
>  endef
> +
> +non-virtual-deps = $(foreach p,$(1),$(if $($(call UPPERCASE,$(p))_IS_VIRTUAL),,$(p)))
> +
> +# Returns the list of recursive dependencies and their licensing terms
> +# for the package specified in parameter (in lowercase). If that
> +# package is a target package, remove host packages from the list.
> +legal-deps = \
> +    $(foreach p,\
> +        $(filter-out $(if $(1:host-%=),host-%),\
> +            $(call non-virtual-deps,\
> +                $($(call UPPERCASE,$(1))_FINAL_RECURSIVE_DEPENDENCIES))),$(p) [$($(call UPPERCASE,$(p))_LICENSE)])
> 

It took a while to me to understand the "host-" related magic. I would
have loved seeing an explanatory comment like:

# $(if $(1:host-%=),host-%) returns:
# - "host-%" if $1 begins with "host-"
# - "" otherwise

But maybe it's just me getting rusty on the Make syntax :) so, with or
without a comment added:

Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters
  2018-10-21 10:27 ` [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Luca Ceresoli
@ 2018-10-21 11:53   ` Luca Ceresoli
  0 siblings, 0 replies; 6+ messages in thread
From: Luca Ceresoli @ 2018-10-21 11:53 UTC (permalink / raw)
  To: buildroot

Hi Michal,

On 21/10/18 12:27, Luca Ceresoli wrote:
> Hi,
> 
> On 22/08/18 14:40, Michal Sojka wrote:
>> From: Michal Sojka <sojka@merica.cz>
>>
>> The last parameter {HOST|TARGET} is now first. With this change,
>> adding new columns to the legal manifest file (as in the next commit)
>> will be slightly easier to review.
>>
>> Signed-off-by: Michal Sojka <sojka@merica.cz>
>> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
> Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

...except the patch does not apply on current master. Since the conflict
is trivial and unrelated, and I already fixed it for my testing, I'm
sending the fixed pathces as v5.

-- 
Luca

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-21 11:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 12:40 [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Michal Sojka
2018-08-22 12:40 ` [Buildroot] [PATCH v4 2/2] core/legal-info: Add package dependencies with licenses to the manifest Michal Sojka
2018-08-22 17:24   ` Yann E. MORIN
2018-10-21 10:30   ` Luca Ceresoli
2018-10-21 10:27 ` [Buildroot] [PATCH v4 1/2] core/legal-info: Change order of legal-manifest parameters Luca Ceresoli
2018-10-21 11:53   ` Luca Ceresoli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.