tools: fix license builder to work with icu-small

Currently the license builder is expecting the ICU package to be
found at `deps/icu`. ICU is now included by default and found at
`deps/icu-small`. This commit adds logic to find the license at the new
location.

This could likely be done in a more elegant way, but it works!

PR-URL: https://github.com/nodejs/node/pull/7119
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
This commit is contained in:
Myles Borins 2016-06-02 17:14:37 -07:00
parent 6626919205
commit 5fd6d75c44

View File

@ -22,7 +22,7 @@ $(echo -e "$3" | sed -e 's/^/ /' -e 's/^ $//' -e 's/ *$//' | sed -e '/./,$
}
if ! [ -d "${rootdir}/deps/icu/" ]; then
if ! [ -d "${rootdir}/deps/icu/" ] && ! [ -d "${rootdir}/deps/icu-small/" ]; then
echo "ICU not installed, run configure to download it, e.g. ./configure --with-intl=small-icu --download=icu"
exit 1
fi
@ -42,6 +42,16 @@ elif [ -f "${rootdir}/deps/icu/license.html" ]; then
addlicense "ICU" "deps/icu" \
"$(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)"
elif [ -f "${rootdir}/deps/icu-small/LICENSE" ]; then
# ICU 57 and following. Drop the BOM
addlicense "ICU" "deps/icu-small" \
"$(sed -e '1s/^[^a-zA-Z ]*ICU/ICU/' -e :a \
-e 's/<[^>]*>//g;s/ / /g;s/ +$//;/</N;//ba' ${rootdir}/deps/icu-small/LICENSE)"
elif [ -f "${rootdir}/deps/icu-small/license.html" ]; then
# ICU 56 and prior
addlicense "ICU" "deps/icu-small" \
"$(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)"
else
echo "Could not find an ICU license file."
exit 1