Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 720b03d

Browse filesBrowse files
rvaggMyles Borins
authored andcommitted
tools: add license-builder.sh to construct LICENSE
PR-URL: #4194 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent 667f7a7 commit 720b03d
Copy full SHA for 720b03d

File tree

Expand file treeCollapse file tree

1 file changed

+63
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+63
-0
lines changed
Open diff view settings
Collapse file

‎tools/license-builder.sh‎

Copy file name to clipboard
+63Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
rootdir="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6+
licensefile="${rootdir}/LICENSE"
7+
licensehead="$(sed '/^- /,$d' ${licensefile})"
8+
tmplicense="${rootdir}/~LICENSE.$$"
9+
echo -e "$licensehead" > $tmplicense
10+
11+
12+
# addlicense <library> <location> <license text>
13+
function addlicense {
14+
15+
echo "
16+
- ${1}, located at ${2}, is licensed as follows:
17+
\"\"\"
18+
$(echo -e "$3" | sed -e 's/^/ /' -e 's/^ $//' -e 's/ *$//' | sed -e '/./,$!d' | sed -e '/^$/N;/^\n$/D')
19+
\"\"\"\
20+
" >> $tmplicense
21+
22+
}
23+
24+
25+
if ! [ -f "${rootdir}/deps/icu/license.html" ]; then
26+
echo "ICU not installed, run configure to download it, e.g. ./configure --with-intl=small-icu --download=icu"
27+
exit 1
28+
fi
29+
30+
31+
# Dependencies bundled in distributions
32+
addlicense "c-ares" "deps/cares" \
33+
"$(sed -e '/^ \*\/$/,$d' -e '/^$/d' -e 's/^[/ ]\* *//' ${rootdir}/deps/cares/src/ares_init.c)"
34+
addlicense "HTTP Parser" "deps/http_parser" "$(cat deps/http_parser/LICENSE-MIT)"
35+
addlicense "ICU" "deps/icu" \
36+
"$(sed -e '1,/COPYRIGHT AND PERMISSION NOTICE/d' -e '/^<hr/,$d' -e 's/^<\/*p>$//' ${rootdir}/deps/icu/license.html)"
37+
addlicense "libuv" "deps/uv" "$(cat ${rootdir}/deps/uv/LICENSE)"
38+
addlicense "OpenSSL" "deps/openssl" \
39+
"$(sed -e '/^ \*\/$/,$d' -e '/^ [^*].*$/d' -e '/\/\*.*$/d' -e '/^$/d' -e 's/^[/ ]\* *//' ${rootdir}/deps/openssl/openssl/LICENSE)"
40+
addlicense "Punycode.js" "lib/punycode.js" \
41+
"$(curl -sL https://raw.githubusercontent.com/bestiejs/punycode.js/master/LICENSE-MIT.txt)"
42+
addlicense "V8" "deps/v8" "$(cat ${rootdir}/deps/v8/LICENSE)"
43+
addlicense "zlib" "deps/zlib" \
44+
"$(sed -e '/The data format used by the zlib library/,$d' -e 's/^\/\* *//' -e 's/^ *//' ${rootdir}/deps/zlib/zlib.h)"
45+
46+
# npm
47+
addlicense "npm" "deps/npm" "$(cat ${rootdir}/deps/npm/LICENSE)"
48+
49+
# Build tools
50+
addlicense "GYP" "tools/gyp" "$(cat ${rootdir}/tools/gyp/LICENSE)"
51+
addlicense "marked" "tools/doc/node_modules/marked" \
52+
"$(cat ${rootdir}/tools/doc/node_modules/marked/LICENSE)"
53+
54+
# Testing tools
55+
addlicense "cpplint.py" "tools/cpplint.py" \
56+
"$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' ${rootdir}/tools/cpplint.py | tail +3)"
57+
addlicense "ESLint" "tools/eslint" "$(cat ${rootdir}/tools/eslint/LICENSE)"
58+
addlicense "gtest" "deps/gtest" "$(cat ${rootdir}/deps/gtest/LICENSE)"
59+
addlicense "node-weak" "test/gc/node_modules/weak" \
60+
"$(cat ${rootdir}/test/gc/node_modules/weak/LICENSE)"
61+
62+
63+
mv $tmplicense $licensefile

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.