about summary refs log tree commit diff
path: root/xlint
diff options
context:
space:
mode:
authormaxice8 <thinkabit.ukim@gmail.com>2019-04-09 06:28:57 -0300
committerLeah Neukirchen <chneukirchen@gmail.com>2019-04-17 13:11:58 +0200
commit56bd7bdadf7a59655f0fd8978322e4c7e0abcea1 (patch)
tree105d9c516179a1ab63dd67ae9b8e855c9ff3014a /xlint
parent041041511d32f113b9c1d879a83063bd21c997fe (diff)
downloadxtools-56bd7bdadf7a59655f0fd8978322e4c7e0abcea1.tar.gz
xtools-56bd7bdadf7a59655f0fd8978322e4c7e0abcea1.tar.xz
xtools-56bd7bdadf7a59655f0fd8978322e4c7e0abcea1.zip
xlint: deal with SPDX licenses.
Diffstat (limited to 'xlint')
-rwxr-xr-xxlint13
1 files changed, 13 insertions, 0 deletions
diff --git a/xlint b/xlint
index b7d9d79..8b26944 100755
--- a/xlint
+++ b/xlint
@@ -243,6 +243,19 @@ for template; do
 			scan "license=.*$l" "license '$l', but no use of vlicense"
 		done
 	fi
+
+	if [ -f /usr/share/spdx/license.lst ]; 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
+				scan "license=.*$l" "license '$l' is not SPDX"
+			fi
+		done
+	fi
+	
 	if ! sed -n '/^version=/{n;/revision=/b;q1}' "$template"; then
 		scan 'revision=' "revision does not appear immediately after version"
 	fi