about summary refs log tree commit diff
path: root/xlint
diff options
context:
space:
mode:
authorPiotr Wójcik <chocimier@tlen.pl>2019-07-26 21:36:41 +0200
committerLeah Neukirchen <leah@vuxu.org>2019-07-27 14:55:33 +0200
commit187c8afb95120b01bafa15a137aa09f4c10f572a (patch)
tree35916162974bd2a4370c8720bb94a5c101264d42 /xlint
parent1fccf045702c24df83164ad4917a8ad5275623e0 (diff)
downloadxtools-187c8afb95120b01bafa15a137aa09f4c10f572a.tar.gz
xtools-187c8afb95120b01bafa15a137aa09f4c10f572a.tar.xz
xtools-187c8afb95120b01bafa15a137aa09f4c10f572a.zip
xlint: read license list from LICENSE_LIST variable
Closes: #139 [via git-merge-pr]
Diffstat (limited to 'xlint')
-rwxr-xr-xxlint5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlint b/xlint
index 7ad0658..8d4775f 100755
--- a/xlint
+++ b/xlint
@@ -243,13 +243,14 @@ for template; do
 		done
 	fi
 
-	if [ -f /usr/share/spdx/license.lst ]; then
+	: ${LICENSE_LIST:=/usr/share/spdx/license.lst}
+	if [ -f "${LICENSE_LIST}" ]; then
 		sed -n 's/license="\(.*\)"/\1/p' "$template" | tr , "\n" | while read -r l; do
 			if echo "$l" | grep -q 'custom:'; then
 				continue
 			fi
 
-			if ! grep -q "^${l}$" /usr/share/spdx/license.lst; then
+			if ! grep -q "^${l}$" "${LICENSE_LIST}"; then
 				scan "license=.*$l" "license '$l' is not SPDX"
 			fi
 		done