summaryrefslogtreecommitdiff
path: root/maint
diff options
context:
space:
mode:
Diffstat (limited to 'maint')
-rwxr-xr-xmaint/check_licenses11
1 files changed, 9 insertions, 2 deletions
diff --git a/maint/check_licenses b/maint/check_licenses
index f74d0698d..ef90affe1 100755
--- a/maint/check_licenses
+++ b/maint/check_licenses
@@ -2,6 +2,8 @@
set -euo pipefail
+: "${CARGO:=cargo}"
+
# A list of the licenses that we currently allow in our code.
#
# If a package supports multiple licenses (using OR), then we are okay
@@ -19,6 +21,7 @@ RECOGNIZED_LICENSES=(
MIT
Unicode-DFS-2016
Unlicense
+ Zlib
"(MIT OR Apache-2.0) AND Unicode-DFS-2016"
)
@@ -44,7 +47,7 @@ containsElement () {
return 1
}
-if ! cargo license --help >/dev/null 2>/dev/null; then
+if ! $CARGO license --help >/dev/null; then
echo "cargo-license is not installed!"
echo
echo "For reasonable results, run:"
@@ -54,9 +57,13 @@ fi
cd "$(dirname "$0")/.."
+# The caller might reasonably have set CARGO to something containing spaces.
+# So collect the output before we set IFS.
+output=$($CARGO license --all-features -t)
+
problems=0
IFS=$'\n'
-for line in $(cargo license --all-features -t); do
+for line in $output; do
package=$(echo "$line" | cut -f1)
licenses=$(echo "$line" | cut -f5)