core/pkg-util: pass package directory and name when saving license files
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 25 Jun 2017 22:03:39 +0000 (00:03 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 3 Jul 2017 16:03:20 +0000 (18:03 +0200)
This will be useful when checking the hashes of the license files.

[Peter: use '.' as buildroot directory so /buildroot.hash isn't checked]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Makefile
package/pkg-generic.mk
package/pkg-utils.mk

index bfe6fa3e0763923a92f1ecd7bcbb2660e3c12718..b37171fcf23d53455734719eb1d4bb3c4c01c8c4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -740,7 +740,7 @@ legal-info-clean:
 .PHONY: legal-info-prepare
 legal-info-prepare: $(LEGAL_INFO_DIR)
        @$(call MESSAGE,"Collecting legal info")
-       @$(call legal-license-file,buildroot,COPYING,COPYING,HOST)
+       @$(call legal-license-file,buildroot,buildroot,.,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)
index 22330edc5b9f215261149a4b5bc256355bc14492..2916a7bbadd7d8503e4530da234483594be13c8b 100644 (file)
@@ -851,7 +851,7 @@ ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
 ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),)
        @$$(call legal-warning-pkg,$$($(2)_RAW_BASE_NAME),cannot save license ($(2)_LICENSE_FILES not defined))
 else
-       @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAW_BASE_NAME),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
+       @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_NAME),$$($(2)_RAW_BASE_NAME),$$($(2)_PKGDIR),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
 endif # license files
 
 ifeq ($$($(2)_SITE_METHOD),local)
index c95e77953b05edeeb872eb242d0ac9542b0375e3..e9ac56276fa922cb41c8738e5e7f9d987b0c0ac3 100644 (file)
@@ -83,7 +83,7 @@ define legal-manifest # pkg, version, license, license-files, source, url, {HOST
        echo '"$(1)","$(2)","$(3)","$(4)","$(5)","$(6)"' >>$(LEGAL_MANIFEST_CSV_$(7))
 endef
 
-define legal-license-file # pkg, filename, file-fullpath, {HOST|TARGET}
-       mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \
-       cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2)
+define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET}
+       mkdir -p $(LICENSE_FILES_DIR_$(6))/$(2)/$(dir $(4)) && \
+       cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4)
 endef