From: Yann E. MORIN Date: Sun, 25 Jun 2017 22:03:40 +0000 (+0200) Subject: core/pkg-utils: check hashes of license files X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=518b797b2b6627a5dfa178ca60e5420becf64e96;p=buildroot.git core/pkg-utils: check hashes of license files This will help catch a change of license even if the filename does not change. For now, a missing hash for the license files is not a fatal error, to let people catch up and add them. When we switch to make it mandatory, we can simplify the code by just removing the case statement. Signed-off-by: "Yann E. MORIN" Cc: Luca Ceresoli Cc: Peter Korsgaard Cc: Rahul Bedarkar Signed-off-by: Peter Korsgaard --- diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index e9ac56276f..accf48c464 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -85,5 +85,10 @@ endef define legal-license-file # pkgname, pkgname-pkgver, pkgdir, filename, file-fullpath, {HOST|TARGET} mkdir -p $(LICENSE_FILES_DIR_$(6))/$(2)/$(dir $(4)) && \ + { \ + support/download/check-hash $(3)/$(1).hash $(5) $(4); \ + ret=$${?}; \ + case $${ret} in (0|3) ;; (*) exit 1;; esac; \ + } && \ cp $(5) $(LICENSE_FILES_DIR_$(6))/$(2)/$(4) endef