legal-info: fail trying to copy a non-existent license file
authorLuca Ceresoli <luca@lucaceresoli.net>
Tue, 14 May 2013 02:46:03 +0000 (02:46 +0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 14 May 2013 15:17:09 +0000 (17:17 +0200)
If a package's _LICENSE_FILES contains the name of a non-existent file,
the make process would continue and return true, unless the
non-existent file is the last listed.

Fix this wrong beaviour by failing with an error when any of the listed
files is missing.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/pkg-generic.mk

index b55b5f0b48bd3b1318634c05a7032a10aa5cee4d..56fca6be85e6ef8ffdc821d04ca2b749249b3199 100644 (file)
@@ -508,9 +508,7 @@ ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),)
        @$(call legal-license-nofiles,$$($(2)_RAWNAME))
        @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined))
 else
-       @for F in $$($(2)_LICENSE_FILES); do \
-               $(call legal-license-file,$$($(2)_RAWNAME),$$$${F},$$($(2)_DIR)/$$$${F}); \
-               done
+       @$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep))
 endif
 ifeq ($$($(2)_REDISTRIBUTE),YES)
 # Copy the source tarball (just hardlink if possible)