diff options
author | Alexey Neyman <stilor@att.net> | 2018-11-07 11:26:45 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-07 11:26:45 -0800 |
commit | 4270b8e62e7f47bee214ddf1bc526df283f8b5aa (patch) | |
tree | d6d06b385a3f6323530c5aa0388010ecdfb11e6f /scripts/functions | |
parent | 94e79672619ae0e45cf668d83648d00cf0a65096 (diff) | |
parent | aec70d53102fcd5f468dc8439a25010254166c22 (diff) | |
download | crosstool-ng-4270b8e62e7f47bee214ddf1bc526df283f8b5aa.tar.gz crosstool-ng-4270b8e62e7f47bee214ddf1bc526df283f8b5aa.tar.bz2 crosstool-ng-4270b8e62e7f47bee214ddf1bc526df283f8b5aa.zip |
Merge pull request #1084 from antmak/collect_licences
Collect licenses for the distribution
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions index ec0d9a16..491c7595 100644 --- a/scripts/functions +++ b/scripts/functions @@ -2399,3 +2399,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 +} |