summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorAnton Maklakov <anton@espressif.com>2018-06-28 08:13:52 (GMT)
committerAnton Maklakov <anton@espressif.com>2018-11-05 07:39:47 (GMT)
commitaec70d53102fcd5f468dc8439a25010254166c22 (patch)
tree2840b6a83c31fe0820d3aca0657e970a4770baa7 /scripts/functions
parent2808fdb6a3e0d197331d77aef0e70320507addef (diff)
Collect licenses for the distribution
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index ab235d8..81406c3 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -2396,3 +2396,34 @@ else
CT_Error "Not found: paths.sh"
fi
. "${paths_sh_location}"
+
+CT_InstallCopyingInformation()
+{
+ local pkgname
+ local pkgdir
+ local licfile
+ local dstdir
+
+ CT_DoLog EXTRA "Collect license information from: ${CT_SRC_DIR}"
+ CT_DoLog EXTRA "Put the license information to: ${CT_PREFIX_DIR}/share/licenses"
+
+ shopt -s nullglob
+
+ for pkgdir in ${CT_SRC_DIR}/*; do
+ pkgname=$(basename "${pkgdir}")
+ for licfile in ${pkgdir}/{COPYING*,LICENSE*}; do
+ dstdir="${CT_PREFIX_DIR}/share/licenses/${pkgname}"
+ mkdir -p "${dstdir}"
+ CT_DoExecLog ALL cp -av "${licfile}" "${dstdir}/"
+ done
+ done
+
+ # Also add crosstool's information
+ for licfile in ${CT_TOP_DIR}/{COPYING*,LICENSE*,licenses.d}; do
+ dstdir="${CT_PREFIX_DIR}/share/licenses/crosstool-ng"
+ mkdir -p "${dstdir}"
+ CT_DoExecLog ALL cp -av "${licfile}" "${dstdir}/"
+ done
+
+ shopt -u nullglob
+}