@@ -11,11 +11,12 @@ echo "$licensehead" > "$tmplicense"
11
11
12
12
# addlicense <library> <location> <license text>
13
13
addlicense () {
14
+ licenseTextTrimmed=$( echo " $3 " | sed -e ' s/^/ /' -e ' s/^ $//' -e ' s/ *$//' | sed -e ' /./,$!d' | sed -e ' /^$/N;/^\n$/D' )
14
15
15
16
echo "
16
17
- ${1} , located at ${2} , is licensed as follows:
17
18
\"\"\"
18
- $( echo " $3 " | sed -e ' s/^/ / ' -e ' s/^ $// ' -e ' s/ *$// ' | sed -e ' /./,$!d ' | sed -e ' /^$/N;/^\n$/D ' )
19
+ ${licenseTextTrimmed}
19
20
\"\"\"\
20
21
" >> " $tmplicense "
21
22
29
30
30
31
31
32
# Dependencies bundled in distributions
32
- addlicense " Acorn" " deps/acorn" " $( cat " ${rootdir} " /deps/acorn/acorn/LICENSE) "
33
- addlicense " c-ares" " deps/cares" " $( tail -n +3 " ${rootdir} " /deps/cares/LICENSE.md) "
34
- addlicense " cjs-module-lexer" " deps/cjs-module-lexer" " $( cat " ${rootdir} " /deps/cjs-module-lexer/LICENSE) "
33
+ licenseText=" $( cat " ${rootdir} " /deps/acorn/acorn/LICENSE) "
34
+ addlicense " Acorn" " deps/acorn" " $licenseText "
35
+ licenseText=" $( tail -n +3 " ${rootdir} " /deps/cares/LICENSE.md) "
36
+ addlicense " c-ares" " deps/cares" " $licenseText "
37
+ licenseText=" $( cat " ${rootdir} " /deps/cjs-module-lexer/LICENSE) "
38
+ addlicense " cjs-module-lexer" " deps/cjs-module-lexer" " $licenseText "
35
39
if [ -f " ${rootdir} /deps/icu/LICENSE" ]; then
36
40
# ICU 57 and following. Drop the BOM
37
- addlicense " ICU" " deps/icu" \
38
- " $( sed -e ' 1s/^[^a-zA-Z ]*ICU/ICU/' -e :a \
39
- -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu/LICENSE) "
41
+ licenseText=" $( sed -e ' 1s/^[^a-zA-Z ]*ICU/ICU/' -e :a -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu/LICENSE) "
42
+ addlicense " ICU" " deps/icu" " $licenseText "
40
43
elif [ -f " ${rootdir} /deps/icu/license.html" ]; then
41
44
# ICU 56 and prior
42
- addlicense " ICU" " deps/icu" \
43
- " $( sed -e ' 1,/ICU License - ICU 1\.8\.1 and later/d' -e :a \
44
- -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu/license.html) "
45
+ licenseText=" $( sed -e ' 1,/ICU License - ICU 1\.8\.1 and later/d' -e :a -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu/license.html) "
46
+ addlicense " ICU" " deps/icu" " $licenseText "
45
47
elif [ -f " ${rootdir} /deps/icu-small/LICENSE" ]; then
46
48
# ICU 57 and following. Drop the BOM
47
- addlicense " ICU" " deps/icu-small" \
48
- " $( sed -e ' 1s/^[^a-zA-Z ]*ICU/ICU/' -e :a \
49
- -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu-small/LICENSE) "
49
+ licenseText=" $( sed -e ' 1s/^[^a-zA-Z ]*ICU/ICU/' -e :a -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu-small/LICENSE) "
50
+ addlicense " ICU" " deps/icu-small" " $licenseText "
50
51
elif [ -f " ${rootdir} /deps/icu-small/license.html" ]; then
51
52
# ICU 56 and prior
52
- addlicense " ICU" " deps/icu-small" \
53
- " $( sed -e ' 1,/ICU License - ICU 1\.8\.1 and later/d' -e :a \
54
- -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu-small/license.html) "
53
+ licenseText=" $( sed -e ' 1,/ICU License - ICU 1\.8\.1 and later/d' -e :a -e ' s/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' " ${rootdir} " /deps/icu-small/license.html) "
54
+ addlicense " ICU" " deps/icu-small" " $licenseText "
55
55
else
56
56
echo " Could not find an ICU license file."
57
57
exit 1
58
58
fi
59
59
60
- addlicense " libuv" " deps/uv" " $( cat " ${rootdir} " /deps/uv/LICENSE) "
61
- addlicense " llhttp" " deps/llhttp" " $( cat deps/llhttp/LICENSE-MIT) "
62
- addlicense " corepack" " deps/corepack" " $( cat " ${rootdir} " /deps/corepack/LICENSE.md) "
63
- addlicense " OpenSSL" " deps/openssl" " $( cat " ${rootdir} " /deps/openssl/openssl/LICENSE.txt) "
64
- addlicense " Punycode.js" " lib/punycode.js" \
65
- " $( curl -sL https://raw.githubusercontent.com/bestiejs/punycode.js/HEAD/LICENSE-MIT.txt) "
66
- addlicense " V8" " deps/v8" " $( cat " ${rootdir} " /deps/v8/LICENSE) "
67
- addlicense " SipHash" " deps/v8/src/third_party/siphash" \
68
- " $( sed -e ' /You should have received a copy of the CC0/,$d' -e ' s/^\/\* *//' -e ' s/^ \* *//' deps/v8/src/third_party/siphash/halfsiphash.cc) "
69
- addlicense " zlib" " deps/zlib" \
70
- " $( sed -e ' /The data format used by the zlib library/,$d' -e ' s/^\/\* *//' -e ' s/^ *//' " ${rootdir} " /deps/zlib/zlib.h) "
60
+ licenseText=" $( cat " ${rootdir} " /deps/uv/LICENSE) "
61
+ addlicense " libuv" " deps/uv" " $licenseText "
62
+ licenseText=" $( cat deps/llhttp/LICENSE-MIT) "
63
+ addlicense " llhttp" " deps/llhttp" " $licenseText "
64
+ licenseText=" $( cat " ${rootdir} " /deps/corepack/LICENSE.md) "
65
+ addlicense " corepack" " deps/corepack" " $licenseText "
66
+ licenseText=" $( cat " ${rootdir} " /deps/openssl/openssl/LICENSE.txt) "
67
+ addlicense " OpenSSL" " deps/openssl" " $licenseText "
68
+ licenseText=" $( curl -sL https://raw.githubusercontent.com/bestiejs/punycode.js/HEAD/LICENSE-MIT.txt) "
69
+ addlicense " Punycode.js" " lib/punycode.js" " $licenseText "
70
+ licenseText=" $( cat " ${rootdir} " /deps/v8/LICENSE) "
71
+ addlicense " V8" " deps/v8" " $licenseText "
72
+ licenseText=" $( sed -e ' /You should have received a copy of the CC0/,$d' -e ' s/^\/\* *//' -e ' s/^ \* *//' deps/v8/src/third_party/siphash/halfsiphash.cc) "
73
+ addlicense " SipHash" " deps/v8/src/third_party/siphash" " $licenseText "
74
+ licenseText=" $( sed -e ' /The data format used by the zlib library/,$d' -e ' s/^\/\* *//' -e ' s/^ *//' " ${rootdir} " /deps/zlib/zlib.h) "
75
+ addlicense " zlib" " deps/zlib" " $licenseText "
71
76
72
77
# npm
73
- addlicense " npm" " deps/npm" " $( cat " ${rootdir} " /deps/npm/LICENSE) "
78
+ licenseText=" $( cat " ${rootdir} " /deps/npm/LICENSE) "
79
+ addlicense " npm" " deps/npm" " $licenseText "
74
80
75
81
# Build tools
76
- addlicense " GYP" " tools/gyp" " $( cat " ${rootdir} " /tools/gyp/LICENSE) "
77
- addlicense " inspector_protocol" " tools/inspector_protocol" " $( cat " ${rootdir} " /tools/inspector_protocol/LICENSE) "
78
- addlicense " jinja2" " tools/inspector_protocol/jinja2" " $( cat " ${rootdir} " /tools/inspector_protocol/jinja2/LICENSE) "
79
- addlicense " markupsafe" " tools/inspector_protocol/markupsafe" " $( cat " ${rootdir} " /tools/inspector_protocol/markupsafe/LICENSE) "
82
+ licenseText=" $( cat " ${rootdir} " /tools/gyp/LICENSE) "
83
+ addlicense " GYP" " tools/gyp" " $licenseText "
84
+ licenseText=" $( cat " ${rootdir} " /tools/inspector_protocol/LICENSE) "
85
+ addlicense " inspector_protocol" " tools/inspector_protocol" " $licenseText "
86
+ licenseText=" $( cat " ${rootdir} " /tools/inspector_protocol/jinja2/LICENSE) "
87
+ addlicense " jinja2" " tools/inspector_protocol/jinja2" " $licenseText "
88
+ licenseText=" $( cat " ${rootdir} " /tools/inspector_protocol/markupsafe/LICENSE) "
89
+ addlicense " markupsafe" " tools/inspector_protocol/markupsafe" " $licenseText "
80
90
81
91
# Testing tools
82
- addlicense " cpplint.py" " tools/cpplint.py" \
83
- " $( sed -e ' /^$/,$d' -e ' s/^#$//' -e ' s/^# //' " ${rootdir} " /tools/cpplint.py | tail -n +3) "
84
- addlicense " ESLint" " tools/node_modules/eslint" " $( cat " ${rootdir} " /tools/node_modules/eslint/LICENSE) "
85
- addlicense " gtest" " deps/googletest" " $( cat " ${rootdir} " /deps/googletest/LICENSE) "
92
+ licenseText=" $( sed -e ' /^$/,$d' -e ' s/^#$//' -e ' s/^# //' " ${rootdir} " /tools/cpplint.py | tail -n +3) "
93
+ addlicense " cpplint.py" " tools/cpplint.py" " $licenseText "
94
+ licenseText=" $( cat " ${rootdir} " /tools/node_modules/eslint/LICENSE) "
95
+ addlicense " ESLint" " tools/node_modules/eslint" " $licenseText "
96
+ licenseText=" $( cat " ${rootdir} " /deps/googletest/LICENSE) "
97
+ addlicense " gtest" " deps/googletest" " $licenseText "
86
98
87
99
# nghttp2
88
- addlicense " nghttp2" " deps/nghttp2" " $( cat " ${rootdir} " /deps/nghttp2/COPYING) "
100
+ licenseText=" $( cat " ${rootdir} " /deps/nghttp2/COPYING) "
101
+ addlicense " nghttp2" " deps/nghttp2" " $licenseText "
89
102
90
103
# large_pages
91
- addlicense " large_pages" " src/large_pages" " $( sed -e ' /SPDX-License-Identifier/,$d' -e ' s/^\/\///' " ${rootdir} " /src/large_pages/node_large_page.h) "
104
+ licenseText=" $( sed -e ' /SPDX-License-Identifier/,$d' -e ' s/^\/\///' " ${rootdir} " /src/large_pages/node_large_page.h) "
105
+ addlicense " large_pages" " src/large_pages" " $licenseText "
92
106
93
107
# deep_freeze
94
- addlicense " caja" " lib/internal/freeze_intrinsics.js" " $( sed -e ' /SPDX-License-Identifier/,$d' -e ' s/^\/\///' " ${rootdir} " /lib/internal/freeze_intrinsics.js) "
108
+ licenseText=" $( sed -e ' /SPDX-License-Identifier/,$d' -e ' s/^\/\///' " ${rootdir} " /lib/internal/freeze_intrinsics.js) "
109
+ addlicense " caja" " lib/internal/freeze_intrinsics.js" " $licenseText "
95
110
96
111
# brotli
97
- addlicense " brotli" " deps/brotli" " $( cat " ${rootdir} " /deps/brotli/LICENSE) "
112
+ licenseText=" $( cat " ${rootdir} " /deps/brotli/LICENSE) "
113
+ addlicense " brotli" " deps/brotli" " $licenseText "
98
114
99
- addlicense " HdrHistogram" " deps/histogram" " $( cat " ${rootdir} " /deps/histogram/LICENSE.txt) "
115
+ licenseText=" $( cat " ${rootdir} " /deps/histogram/LICENSE.txt) "
116
+ addlicense " HdrHistogram" " deps/histogram" " $licenseText "
100
117
101
- addlicense " highlight.js " " doc/api_assets/highlight.pack.js " \
102
- " $( curl -sL https://raw.githubusercontent.com/highlightjs/ highlight.js/63f367c46f2eeb6f9b7a3545e325eeeb917f9942/LICENSE ) "
118
+ licenseText= " $( curl -sL https://raw.githubusercontent.com/highlightjs/highlight.js/63f367c46f2eeb6f9b7a3545e325eeeb917f9942/LICENSE ) "
119
+ addlicense " highlight.js " " doc/api_assets/ highlight.pack.js " " $licenseText "
103
120
104
- addlicense " node-heapdump " " src/heap_utils.cc " \
105
- " $( curl -sL https://raw.githubusercontent.com/bnoordhuis/ node-heapdump/0ca52441e46241ffbea56a389e2856ec01c48c97/LICENSE ) "
121
+ licenseText= " $( curl -sL https://raw.githubusercontent.com/bnoordhuis/node-heapdump/0ca52441e46241ffbea56a389e2856ec01c48c97/LICENSE ) "
122
+ addlicense " node-heapdump" " src/heap_utils.cc " " $licenseText "
106
123
107
- addlicense " rimraf " " lib/internal/fs/ rimraf.js " \
108
- " $( curl -sL https://raw.githubusercontent.com/isaacs/ rimraf/0e365ac4e4d64a25aa2a3cc026348f13410210e1/LICENSE ) "
124
+ licenseText= " $( curl -sL https://raw.githubusercontent.com/isaacs/ rimraf/0e365ac4e4d64a25aa2a3cc026348f13410210e1/LICENSE ) "
125
+ addlicense " rimraf " " lib/internal/fs/ rimraf.js " " $licenseText "
109
126
110
- addlicense " uvwasi" " deps/uvwasi" " $( cat " ${rootdir} " /deps/uvwasi/LICENSE) "
111
- addlicense " ngtcp2" " deps/ngtcp2/ngtcp2/" " $( cat " ${rootdir} " /deps/ngtcp2/LICENSE_ngtcp2) "
112
- addlicense " nghttp3" " deps/ngtcp2/nghttp3/" " $( cat " ${rootdir} " /deps/ngtcp2/LICENSE_nghttp3) "
127
+ licenseText=" $( cat " ${rootdir} " /deps/uvwasi/LICENSE) "
128
+ addlicense " uvwasi" " deps/uvwasi" " $licenseText "
129
+ licenseText=" $( cat " ${rootdir} " /deps/ngtcp2/LICENSE_ngtcp2) "
130
+ addlicense " ngtcp2" " deps/ngtcp2/ngtcp2/" " $licenseText "
131
+ licenseText=" $( cat " ${rootdir} " /deps/ngtcp2/LICENSE_nghttp3) "
132
+ addlicense " nghttp3" " deps/ngtcp2/nghttp3/" " $licenseText "
113
133
114
- addlicense " node-fs-extra" " lib/internal/fs/cp " \
115
- " $( curl -sL https://raw.githubusercontent.com/jprichardson/ node-fs-extra/b34da2762a4865b025cac06d02d6a2f1f1027b65/LICENSE ) "
134
+ licenseText= " $( curl -sL https://raw.githubusercontent.com/jprichardson/ node-fs-extra/b34da2762a4865b025cac06d02d6a2f1f1027b65/LICENSE ) "
135
+ addlicense " node-fs-extra" " lib/internal/fs/cp " " $licenseText "
116
136
117
137
mv " $tmplicense " " $licensefile "
0 commit comments