aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-05-27 05:02:06 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-05-27 05:02:06 +0000
commiteac1d5f88c83f0f43f47b4bf3c426f28f473eede (patch)
tree6a0bafd3506ce2239b3d78dd79b39a146ac60c48 /Tools
parent704cde7b11f7815ab6b2a0372a6f9ef2ca3cd367 (diff)
downloadports-eac1d5f88c83f0f43f47b4bf3c426f28f473eede.tar.gz
ports-eac1d5f88c83f0f43f47b4bf3c426f28f473eede.zip
Tools: add LEGALlint
This checks 'LEGAL' for common errors, It is inspired by MOVEDLint.
Notes
Notes: svn path=/head/; revision=470955
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/LEGALlint22
-rw-r--r--Tools/scripts/README1
2 files changed, 23 insertions, 0 deletions
diff --git a/Tools/scripts/LEGALlint b/Tools/scripts/LEGALlint
new file mode 100755
index 000000000000..99ee9b2101d8
--- /dev/null
+++ b/Tools/scripts/LEGALlint
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $FreeBSD$
+
+PORTSDIR="${PORTSDIR:-/usr/ports}"
+
+cd "$PORTSDIR" || exit 1
+
+export IFS="${IFS}:"
+grep -nv '#' "$PORTSDIR/LEGAL" | while read -r line _ port text
+do
+ if [ ! -d "$port" ]
+ then
+ printf "%d (%s): port has been removed\\n" "$line" "$port"
+ continue
+ fi
+
+ actual_text="$(make -C "$port" -VLEGAL)"
+ if [ "$text" != "$actual_text" ]
+ then
+ printf "%d (%s): reason mismatch\\n" "$line" "$port"
+ fi
+done
diff --git a/Tools/scripts/README b/Tools/scripts/README
index a93227f826cd..280aef64eb59 100644
--- a/Tools/scripts/README
+++ b/Tools/scripts/README
@@ -6,6 +6,7 @@ NOTE: These scripts need work and are *NOT* safe to use unless you know
script.
MOVEDlint.awk - checks MOVED for common errors
+LEGALlint - checks LEGAL for common errors
ardiff - compare two archives easily
addport - replacement for easy-import
bad-pkgdescrs.sh - locate identical pkg descriptions