Skip to content

Commit 792d095

Browse files
committed
tools: add multiple locations support in license builder
1 parent 4de6f20 commit 792d095

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ The externally maintained libraries used by Node.js are:
12511251
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12521252
"""
12531253

1254-
- gtest, located at src/gtest and test/cctest/gtest, is licensed as follows:
1254+
- gtest, located at src/gtest, test/cctest/gtest, is licensed as follows:
12551255
"""
12561256
Copyright 2008, Google Inc.
12571257
All rights reserved.

tools/license-builder.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,21 @@ licensehead="$(sed '/^- /,$d' "${licensefile}")"
88
tmplicense="${rootdir}/~LICENSE.$$"
99
echo "$licensehead" > "$tmplicense"
1010

11-
1211
# addlicense <library> <location> <license text>
1312
addlicense() {
13+
library="$1"
14+
locations="$2"
15+
shift 2
16+
while [ $# -gt 1 ]; do
17+
locations="$locations, $1"
18+
shift
19+
done
20+
license="$1"
1421

1522
echo "
16-
- ${1}, located at ${2}, is licensed as follows:
23+
- ${library}, located at ${locations}, is licensed as follows:
1724
\"\"\"
18-
$(echo "$3" | sed -e 's/^/ /' -e 's/^ $//' -e 's/ *$//' | sed -e '/./,$!d' | sed -e '/^$/N;/^\n$/D')
25+
$(echo "$license" | sed -e 's/^/ /' -e 's/^ $//' -e 's/ *$//' | sed -e '/./,$!d' | sed -e '/^$/N;/^\n$/D')
1926
\"\"\"\
2027
" >> "$tmplicense"
2128

@@ -83,7 +90,7 @@ addlicense "cpplint.py" "tools/cpplint.py" \
8390
"$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' "${rootdir}"/tools/cpplint.py | tail -n +3)"
8491
addlicense "ESLint" "tools/node_modules/eslint" "$(cat "${rootdir}"/tools/node_modules/eslint/LICENSE)"
8592
addlicense "Babel" "tools/node_modules/@babel" "$(cat "${rootdir}"/tools/node_modules/@babel/core/LICENSE)"
86-
addlicense "gtest" "test/cctest/gtest" "$(cat "${rootdir}"/test/cctest/gtest/LICENSE)"
93+
addlicense "gtest" "src/gtest" "test/cctest/gtest" "$(cat "${rootdir}"/test/cctest/gtest/LICENSE)"
8794

8895
# nghttp2
8996
addlicense "nghttp2" "deps/nghttp2" "$(cat "${rootdir}"/deps/nghttp2/COPYING)"

0 commit comments

Comments
 (0)