All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0 of 5] legal info: split host and package output
@ 2013-10-04 13:12 Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses Thomas De Schampheleire
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot


Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 Makefile                     |  25 +++++++++++++++----------
 docs/manual/legal-notice.txt |   6 +++---
 package/pkg-generic.mk       |  12 ++++++------
 package/pkg-utils.mk         |  32 +++++++++++++++++++-------------
 4 files changed, 43 insertions(+), 32 deletions(-)

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

* [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses
  2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
@ 2013-10-04 13:12 ` Thomas De Schampheleire
  2013-10-04 13:24   ` Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 2 of 5] legal info: split manifest for host and target Thomas De Schampheleire
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot

Due to a missing dollar sign, the licenses for host packages were not saved.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
Note: Aaargh this dollar sign madness!

 package/pkg-generic.mk |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -511,7 +511,7 @@ ifeq ($(call qstrip,$$($(2)_LICENSE_FILE
 	@$(call legal-license-nofiles,$$($(2)_RAWNAME))
 	@$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
 else
-	@$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep))
+	@$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))
 endif
 ifeq ($$($(2)_REDISTRIBUTE),YES)
 # Copy the source tarball (just hardlink if possible)

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

* [Buildroot] [PATCH 2 of 5] legal info: split manifest for host and target
  2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses Thomas De Schampheleire
@ 2013-10-04 13:12 ` Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 3 of 5] legal-info: split license texts " Thomas De Schampheleire
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

---
Note: this is a resend without changes, now accumulated in a legal-info
series

 Makefile                     |  8 +++++---
 docs/manual/legal-notice.txt |  6 +++---
 package/pkg-generic.mk       |  2 +-
 package/pkg-utils.mk         |  2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -110,7 +110,8 @@ HOST_DIR:=$(BASE_DIR)/host
 LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
 REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
 LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses
-LEGAL_MANIFEST_CSV=$(LEGAL_INFO_DIR)/manifest.csv
+LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
+LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv
 LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
 LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
 LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
@@ -588,8 +589,9 @@ legal-info-clean:
 legal-info-prepare: $(LEGAL_INFO_DIR)
 	@$(call MESSAGE,"Collecting legal info")
 	@$(call legal-license-file,buildroot,COPYING,COPYING)
-	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE)
-	@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved)
+	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET)
+	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST)
+	@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST)
 	@$(call legal-warning,the Buildroot source code has not been saved)
 	@$(call legal-warning,the toolchain has not been saved)
 	@cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
diff --git a/docs/manual/legal-notice.txt b/docs/manual/legal-notice.txt
--- a/docs/manual/legal-notice.txt
+++ b/docs/manual/legal-notice.txt
@@ -44,8 +44,8 @@ There you will find:
   saved);
   patches applied to some packages by Buildroot are distributed with the
   Buildroot sources and are not duplicated in the +sources/+ subdirectory.
-* A manifest file listing the configured packages, their version, license and
-  related information.
+* A manifest file (one for host and one for target packages) listing the
+  configured packages, their version, license and related information.
   Some of this information might not be defined in Buildroot; such items are
   marked as "unknown".
 * A +licenses/+ subdirectory, which contains the license text of packages.
@@ -72,7 +72,7 @@ License abbreviations
 ---------------------
 
 Here is a list of the licenses that are most widely used by packages in
-Buildroot, with the name used in the manifest file:
+Buildroot, with the name used in the manifest files:
 
 * `GPLv2`:
   http://www.gnu.org/licenses/old-licenses/gpl-2.0.html[
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -519,7 +519,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 	   cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR)
 endif
 endif
-	@$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL))
+	@$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$(call UPPERCASE,$(5)))
 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
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -96,7 +96,7 @@ legal-warning-pkg=echo "WARNING: $(1): $
 define legal-warning-pkg-savednothing # pkg, {local|override}
 	$(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled))
 endef
-legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV)
+legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
 define legal-license-header
 	echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
 		"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT)

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

* [Buildroot] [PATCH 3 of 5] legal-info: split license texts for host and target
  2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 2 of 5] legal info: split manifest for host and target Thomas De Schampheleire
@ 2013-10-04 13:12 ` Thomas De Schampheleire
  2013-10-04 14:08   ` Thomas De Schampheleire
  2013-10-05 21:28   ` Luca Ceresoli
  2013-10-04 13:12 ` [Buildroot] [PATCH 4 of 5] legal info: split sources " Thomas De Schampheleire
  2013-10-04 13:12 ` [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions Thomas De Schampheleire
  4 siblings, 2 replies; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 Makefile               |   8 +++++---
 package/pkg-generic.mk |   2 +-
 package/pkg-utils.mk   |  16 ++++++++--------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -109,10 +109,12 @@ HOST_DIR:=$(BASE_DIR)/host
 
 LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
 REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
-LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses
+LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses
+LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses
 LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
 LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv
-LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
+LEGAL_LICENSES_TXT_TARGET=$(LEGAL_INFO_DIR)/licenses.txt
+LEGAL_LICENSES_TXT_HOST=$(LEGAL_INFO_DIR)/host-licenses.txt
 LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
 LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
 
@@ -588,7 +590,7 @@ legal-info-clean:
 
 legal-info-prepare: $(LEGAL_INFO_DIR)
 	@$(call MESSAGE,"Collecting legal info")
-	@$(call legal-license-file,buildroot,COPYING,COPYING)
+	@$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
 	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET)
 	@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST)
 	@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST)
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -508,7 +508,7 @@ else
 # Other packages
 # Save license files if defined
 ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
-	@$(call legal-license-nofiles,$$($(2)_RAWNAME))
+	@$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(5)))
 	@$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
 else
 	@$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -99,15 +99,15 @@ endef
 legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
 define legal-license-header
 	echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
-		"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT)
+		"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
 endef
 define legal-license-nofiles
-	$(call legal-license-header,$(1),unknown license file(s))
+	$(call legal-license-header,$(1),unknown license file(s),$(2))
 endef
-define legal-license-file # pkg, filename, file-fullpath
-	$(call legal-license-header,$(1),$(2) file) && \
-	cat $(3) >>$(LEGAL_LICENSES_TXT) && \
-	echo >>$(LEGAL_LICENSES_TXT) && \
-	mkdir -p $(LICENSE_FILES_DIR)/$(1)/$(dir $(2)) && \
-	cp $(3) $(LICENSE_FILES_DIR)/$(1)/$(2)
+define legal-license-file # pkg, filename, file-fullpath, type
+	$(call legal-license-header,$(1),$(2) file,$(4)) && \
+	cat $(3) >>$(LEGAL_LICENSES_TXT_$(4)) && \
+	echo >>$(LEGAL_LICENSES_TXT_$(4)) && \
+	mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \
+	cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2)
 endef

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

* [Buildroot] [PATCH 4 of 5] legal info: split sources for host and target
  2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
                   ` (2 preceding siblings ...)
  2013-10-04 13:12 ` [Buildroot] [PATCH 3 of 5] legal-info: split license texts " Thomas De Schampheleire
@ 2013-10-04 13:12 ` Thomas De Schampheleire
  2013-10-05 21:29   ` Luca Ceresoli
  2013-10-04 13:12 ` [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions Thomas De Schampheleire
  4 siblings, 1 reply; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
This patch concludes the splitting of legal info for host and target.

 Makefile               |  9 +++++----
 package/pkg-generic.mk |  6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -108,7 +108,8 @@ TARGET_DIR:=$(BASE_DIR)/target
 HOST_DIR:=$(BASE_DIR)/host
 
 LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
-REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
+REDIST_SOURCES_DIR_TARGET=$(LEGAL_INFO_DIR)/sources
+REDIST_SOURCES_DIR_HOST=$(LEGAL_INFO_DIR)/host-sources
 LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses
 LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses
 LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
@@ -419,7 +420,7 @@ world: toolchain $(TARGETS_ALL)
 # dependencies anywhere else
 #
 ################################################################################
-$(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR):
+$(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(STAMP_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
 	@mkdir -p $@
 
 # We make a symlink lib32->lib or lib64->lib as appropriate
@@ -598,8 +599,8 @@ legal-info-prepare: $(LEGAL_INFO_DIR)
 	@$(call legal-warning,the toolchain has not been saved)
 	@cp $(BUILDROOT_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
 
-legal-info: dirs legal-info-clean legal-info-prepare $(REDIST_SOURCES_DIR) \
-		$(TARGETS_LEGAL_INFO)
+legal-info: dirs legal-info-clean legal-info-prepare $(TARGETS_LEGAL_INFO) \
+		$(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
 	@cat support/legal-info/README.header >>$(LEGAL_REPORT)
 	@if [ -r $(LEGAL_WARNINGS) ]; then \
 		cat support/legal-info/README.warnings-header \
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -488,7 +488,7 @@ ifeq ($$($(2)_REDISTRIBUTE),YES)
 ifneq ($$($(2)_SITE_METHOD),local)
 ifneq ($$($(2)_SITE_METHOD),override)
 # Packages that have a tarball need it downloaded and extracted beforehand
-$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR)
+$(1)-legal-info: $(1)-extract $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
 $(2)_MANIFEST_TARBALL = $$($(2)_SOURCE)
 endif
 endif
@@ -515,8 +515,8 @@ else
 endif
 ifeq ($$($(2)_REDISTRIBUTE),YES)
 # Copy the source tarball (just hardlink if possible)
-	@cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) 2>/dev/null || \
-	   cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR)
+	@cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5))) 2>/dev/null || \
+	   cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR_$(call UPPERCASE,$(5)))
 endif
 endif
 	@$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$(call UPPERCASE,$(5)))

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

* [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions
  2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
                   ` (3 preceding siblings ...)
  2013-10-04 13:12 ` [Buildroot] [PATCH 4 of 5] legal info: split sources " Thomas De Schampheleire
@ 2013-10-04 13:12 ` Thomas De Schampheleire
  2013-10-05 21:19   ` Luca Ceresoli
  4 siblings, 1 reply; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:12 UTC (permalink / raw)
  To: buildroot

The legal-info utility functions where defined using two ways
util-foo = command-foo
and
define util-bar # parameter description
	command-bar
endef

This commit changes these functions to use the second form for clarity and
additionally adds parameter descriptions on all functions.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
 package/pkg-utils.mk |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -91,17 +91,23 @@ endef
 # legal-info helper functions
 #
 LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
-legal-warning=echo "WARNING: $(1)" >>$(LEGAL_WARNINGS)
-legal-warning-pkg=echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS)
+define legal-warning # text
+	echo "WARNING: $(1)" >>$(LEGAL_WARNINGS)
+endef
+define legal-warning-pkg # pkg, text
+	echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS)
+endef
 define legal-warning-pkg-savednothing # pkg, {local|override}
 	$(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled))
 endef
-legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
-define legal-license-header
+define legal-manifest # pkg, version, license, license-files, source, type
+	echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
+endef
+define legal-license-header # pkg, license-file, type
 	echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
 		"$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
 endef
-define legal-license-nofiles
+define legal-license-nofiles # pkg, type
 	$(call legal-license-header,$(1),unknown license file(s),$(2))
 endef
 define legal-license-file # pkg, filename, file-fullpath, type

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

* [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses
  2013-10-04 13:12 ` [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses Thomas De Schampheleire
@ 2013-10-04 13:24   ` Thomas De Schampheleire
  2013-10-04 15:29     ` Thomas De Schampheleire
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 13:24 UTC (permalink / raw)
  To: buildroot

On Fri, Oct 4, 2013 at 3:12 PM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> Due to a missing dollar sign, the licenses for host packages were not saved.
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> Note: Aaargh this dollar sign madness!
>
>  package/pkg-generic.mk |  2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -511,7 +511,7 @@ ifeq ($(call qstrip,$$($(2)_LICENSE_FILE
>         @$(call legal-license-nofiles,$$($(2)_RAWNAME))
>         @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
>  else
> -       @$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep))
> +       @$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))
>  endif
>  ifeq ($$($(2)_REDISTRIBUTE),YES)
>  # Copy the source tarball (just hardlink if possible)

Hold this one: it seems to break packages that define multiple license
files, like libfuse. Looking into it...

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

* [Buildroot] [PATCH 3 of 5] legal-info: split license texts for host and target
  2013-10-04 13:12 ` [Buildroot] [PATCH 3 of 5] legal-info: split license texts " Thomas De Schampheleire
@ 2013-10-04 14:08   ` Thomas De Schampheleire
  2013-10-05 21:28   ` Luca Ceresoli
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 14:08 UTC (permalink / raw)
  To: buildroot

On Fri, Oct 4, 2013 at 3:12 PM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
>  Makefile               |   8 +++++---
>  package/pkg-generic.mk |   2 +-
>  package/pkg-utils.mk   |  16 ++++++++--------
>  3 files changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -109,10 +109,12 @@ HOST_DIR:=$(BASE_DIR)/host
>
>  LEGAL_INFO_DIR=$(BASE_DIR)/legal-info
>  REDIST_SOURCES_DIR=$(LEGAL_INFO_DIR)/sources
> -LICENSE_FILES_DIR=$(LEGAL_INFO_DIR)/licenses
> +LICENSE_FILES_DIR_TARGET=$(LEGAL_INFO_DIR)/licenses
> +LICENSE_FILES_DIR_HOST=$(LEGAL_INFO_DIR)/host-licenses
>  LEGAL_MANIFEST_CSV_TARGET=$(LEGAL_INFO_DIR)/manifest.csv
>  LEGAL_MANIFEST_CSV_HOST=$(LEGAL_INFO_DIR)/host-manifest.csv
> -LEGAL_LICENSES_TXT=$(LEGAL_INFO_DIR)/licenses.txt
> +LEGAL_LICENSES_TXT_TARGET=$(LEGAL_INFO_DIR)/licenses.txt
> +LEGAL_LICENSES_TXT_HOST=$(LEGAL_INFO_DIR)/host-licenses.txt
>  LEGAL_WARNINGS=$(LEGAL_INFO_DIR)/.warnings
>  LEGAL_REPORT=$(LEGAL_INFO_DIR)/README
>
> @@ -588,7 +590,7 @@ legal-info-clean:
>
>  legal-info-prepare: $(LEGAL_INFO_DIR)
>         @$(call MESSAGE,"Collecting legal info")
> -       @$(call legal-license-file,buildroot,COPYING,COPYING)
> +       @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
>         @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,TARGET)
>         @$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,HOST)
>         @$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPLv2+,COPYING,not saved,HOST)
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -508,7 +508,7 @@ else
>  # Other packages
>  # Save license files if defined
>  ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
> -       @$(call legal-license-nofiles,$$($(2)_RAWNAME))
> +       @$(call legal-license-nofiles,$$($(2)_RAWNAME),$(call UPPERCASE,$(5)))
>         @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
>  else
>         @$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))

This $(call UPPERCASE,$(5)) extra parameter accidentally ended up in
the first patch of this series.
I will fix that, when I investigated the problem with that patch
(double dollar sign). (or if someone else knows what the problem is,
please let me know).

Best regards,
Thomas

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

* [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses
  2013-10-04 13:24   ` Thomas De Schampheleire
@ 2013-10-04 15:29     ` Thomas De Schampheleire
  2013-10-07 15:01       ` Thomas De Schampheleire
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-04 15:29 UTC (permalink / raw)
  To: buildroot

Hi,

On Fri, Oct 4, 2013 at 3:24 PM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> On Fri, Oct 4, 2013 at 3:12 PM, Thomas De Schampheleire
> <patrickdepinguin@gmail.com> wrote:
>> Due to a missing dollar sign, the licenses for host packages were not saved.
>>
>> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>>
>> ---
>> Note: Aaargh this dollar sign madness!
>>
>>  package/pkg-generic.mk |  2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>> --- a/package/pkg-generic.mk
>> +++ b/package/pkg-generic.mk
>> @@ -511,7 +511,7 @@ ifeq ($(call qstrip,$$($(2)_LICENSE_FILE
>>         @$(call legal-license-nofiles,$$($(2)_RAWNAME))
>>         @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
>>  else
>> -       @$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep))
>> +       @$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))
>>  endif
>>  ifeq ($$($(2)_REDISTRIBUTE),YES)
>>  # Copy the source tarball (just hardlink if possible)
>
> Hold this one: it seems to break packages that define multiple license
> files, like libfuse. Looking into it...

This is a tricky problem, and I don't know how to solve it. The
foreach line does not work correctly with variables that are defined
inside an evaluated macro, as our inner-generic-package is.
Here is an example Makefile that shows the problem:

all:

VARA = foo bar

define inner
VARB = foo bar
VARC = $(1)
some-$(1):
        @echo $(1) != $(VARC)
        @echo $(1) = $$(VARC)
        @echo
        @echo $(foreach F,foo bar,echo $(F))
        @echo $(foreach F,$(VARA),echo $(F))
        @echo $(foreach F,$$(VARB),echo $(F))
        @echo $(foreach F,$$(VARC),echo $(F))
endef

outer = $(call inner,foo bar)
$(eval $(outer))


The first set of echoes shows that $(VARC) cannot be used like that,
it is empty. Using double-dollar signs does work.
However, when passing this to foreach you get problems. The first two
foreach'es show the expected output, while the second two show the
problem.

Here is the output:

$ make -f ~/tmp/wrap some-foo
foo bar !=
foo bar = foo bar

echo foo echo bar
echo foo echo bar
echo foo bar
echo foo bar

As you can see, the fact that we pass $$(VARC) to foreach renders the
foreach useless: it only iterates once instead of for each word. But
we cannot pass simply $(VARC) as that is empty when foreach is
evaluated.

Does anyone know how to solve this?

Thanks,
Thomas

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

* [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions
  2013-10-04 13:12 ` [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions Thomas De Schampheleire
@ 2013-10-05 21:19   ` Luca Ceresoli
  0 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2013-10-05 21:19 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Thomas De Schampheleire wrote:
> The legal-info utility functions where defined using two ways
> util-foo = command-foo
> and
> define util-bar # parameter description
> 	command-bar
> endef
>
> This commit changes these functions to use the second form for clarity and
> additionally adds parameter descriptions on all functions.

Yeah, never liked what I wrote here...

But, in order to make the code een more readable, I suggest you to add
an empty line between definitions, just like the "define KCONFIG_*" above
in the same file.

Apart from this, and from a little note below,
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
>   package/pkg-utils.mk |  16 +++++++++++-----
>   1 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -91,17 +91,23 @@ endef
>   # legal-info helper functions
>   #
>   LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
> -legal-warning=echo "WARNING: $(1)" >>$(LEGAL_WARNINGS)
> -legal-warning-pkg=echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS)
> +define legal-warning # text
> +	echo "WARNING: $(1)" >>$(LEGAL_WARNINGS)
> +endef
> +define legal-warning-pkg # pkg, text
> +	echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS)
> +endef
>   define legal-warning-pkg-savednothing # pkg, {local|override}
>   	$(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled))
>   endef
> -legal-manifest=echo '"$(1)","$(2)","$(3)","$(4)","$(5)"' >>$(LEGAL_MANIFEST_CSV_$(6))
> -define legal-license-header
> +define legal-manifest # pkg, version, license, license-files, source, type

"type" is too generic to convey a meaning here. How about "{host|target}"?

-- 
Luca

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

* [Buildroot] [PATCH 3 of 5] legal-info: split license texts for host and target
  2013-10-04 13:12 ` [Buildroot] [PATCH 3 of 5] legal-info: split license texts " Thomas De Schampheleire
  2013-10-04 14:08   ` Thomas De Schampheleire
@ 2013-10-05 21:28   ` Luca Ceresoli
  1 sibling, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2013-10-05 21:28 UTC (permalink / raw)
  To: buildroot

Thomas De Schampheleire wrote:
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

With the UPPERCASE issue fixed,
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

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

* [Buildroot] [PATCH 4 of 5] legal info: split sources for host and target
  2013-10-04 13:12 ` [Buildroot] [PATCH 4 of 5] legal info: split sources " Thomas De Schampheleire
@ 2013-10-05 21:29   ` Luca Ceresoli
  0 siblings, 0 replies; 13+ messages in thread
From: Luca Ceresoli @ 2013-10-05 21:29 UTC (permalink / raw)
  To: buildroot

Thomas De Schampheleire wrote:
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

With the UPPERCASE issue fixed,
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

-- 
Luca

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

* [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses
  2013-10-04 15:29     ` Thomas De Schampheleire
@ 2013-10-07 15:01       ` Thomas De Schampheleire
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas De Schampheleire @ 2013-10-07 15:01 UTC (permalink / raw)
  To: buildroot

On Fri, Oct 4, 2013 at 5:29 PM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> Hi,
>
> On Fri, Oct 4, 2013 at 3:24 PM, Thomas De Schampheleire
> <patrickdepinguin@gmail.com> wrote:
>> On Fri, Oct 4, 2013 at 3:12 PM, Thomas De Schampheleire
>> <patrickdepinguin@gmail.com> wrote:
>>> Due to a missing dollar sign, the licenses for host packages were not saved.
>>>
>>> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>>>
>>> ---
>>> Note: Aaargh this dollar sign madness!
>>>
>>>  package/pkg-generic.mk |  2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
>>> --- a/package/pkg-generic.mk
>>> +++ b/package/pkg-generic.mk
>>> @@ -511,7 +511,7 @@ ifeq ($(call qstrip,$$($(2)_LICENSE_FILE
>>>         @$(call legal-license-nofiles,$$($(2)_RAWNAME))
>>>         @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
>>>  else
>>> -       @$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep))
>>> +       @$(foreach F,$$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F),$(call UPPERCASE,$(5)))$$(sep))
>>>  endif
>>>  ifeq ($$($(2)_REDISTRIBUTE),YES)
>>>  # Copy the source tarball (just hardlink if possible)
>>
>> Hold this one: it seems to break packages that define multiple license
>> files, like libfuse. Looking into it...
>
> This is a tricky problem, and I don't know how to solve it. The
> foreach line does not work correctly with variables that are defined
> inside an evaluated macro, as our inner-generic-package is.
> Here is an example Makefile that shows the problem:
>
> all:
>
> VARA = foo bar
>
> define inner
> VARB = foo bar
> VARC = $(1)
> some-$(1):
>         @echo $(1) != $(VARC)
>         @echo $(1) = $$(VARC)
>         @echo
>         @echo $(foreach F,foo bar,echo $(F))
>         @echo $(foreach F,$(VARA),echo $(F))
>         @echo $(foreach F,$$(VARB),echo $(F))
>         @echo $(foreach F,$$(VARC),echo $(F))
> endef
>
> outer = $(call inner,foo bar)
> $(eval $(outer))
>
>
> The first set of echoes shows that $(VARC) cannot be used like that,
> it is empty. Using double-dollar signs does work.
> However, when passing this to foreach you get problems. The first two
> foreach'es show the expected output, while the second two show the
> problem.
>
> Here is the output:
>
> $ make -f ~/tmp/wrap some-foo
> foo bar !=
> foo bar = foo bar
>
> echo foo echo bar
> echo foo echo bar
> echo foo bar
> echo foo bar
>
> As you can see, the fact that we pass $$(VARC) to foreach renders the
> foreach useless: it only iterates once instead of for each word. But
> we cannot pass simply $(VARC) as that is empty when foreach is
> evaluated.
>
> Does anyone know how to solve this?

Note: I found a solution and submitted a second version of this series...

Best regards,
Thomas

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

end of thread, other threads:[~2013-10-07 15:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-04 13:12 [Buildroot] [PATCH 0 of 5] legal info: split host and package output Thomas De Schampheleire
2013-10-04 13:12 ` [Buildroot] [PATCH 1 of 5] legal info: fix saving of host package licenses Thomas De Schampheleire
2013-10-04 13:24   ` Thomas De Schampheleire
2013-10-04 15:29     ` Thomas De Schampheleire
2013-10-07 15:01       ` Thomas De Schampheleire
2013-10-04 13:12 ` [Buildroot] [PATCH 2 of 5] legal info: split manifest for host and target Thomas De Schampheleire
2013-10-04 13:12 ` [Buildroot] [PATCH 3 of 5] legal-info: split license texts " Thomas De Schampheleire
2013-10-04 14:08   ` Thomas De Schampheleire
2013-10-05 21:28   ` Luca Ceresoli
2013-10-04 13:12 ` [Buildroot] [PATCH 4 of 5] legal info: split sources " Thomas De Schampheleire
2013-10-05 21:29   ` Luca Ceresoli
2013-10-04 13:12 ` [Buildroot] [PATCH 5 of 5] legal info: cleanup utility functions Thomas De Schampheleire
2013-10-05 21:19   ` 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.