pkg-utils.mk: legal-license-file: handle multiple license files with same name
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 5 Jun 2013 08:52:18 +0000 (10:52 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 5 Jun 2013 08:58:40 +0000 (10:58 +0200)
Some packages (kmod, e2fsprogs, ..) contain multiple (different) license
files with the same file name, but in different directories.

These are currently all copied to the same filename in
output/legal-info/licenses/<pkg>, overwriting everything but the last file.

Fix it by recreating the same directory structure under legal-info.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/pkg-utils.mk

index 835c588af02cb00e7ac9193ed694696eb052e69b..86d687fb997f33cc08c3100706c19e2d638247a1 100644 (file)
@@ -106,6 +106,6 @@ 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)/ && \
-       cp $(3) $(LICENSE_FILES_DIR)/$(1)/
+       mkdir -p $(LICENSE_FILES_DIR)/$(1)/$(dir $(2)) && \
+       cp $(3) $(LICENSE_FILES_DIR)/$(1)/$(2)
 endef