Tools: add LEGALlint

This checks 'LEGAL' for common errors, It is inspired by MOVEDLint.
This commit is contained in:
Eitan Adler 2018-05-27 05:02:06 +00:00
parent 704cde7b11
commit eac1d5f88c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=470955
2 changed files with 23 additions and 0 deletions

22
Tools/scripts/LEGALlint Executable file
View file

@ -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

View file

@ -6,6 +6,7 @@ NOTE: These scripts need work and are *NOT* safe to use unless you know
script. script.
MOVEDlint.awk - checks MOVED for common errors MOVEDlint.awk - checks MOVED for common errors
LEGALlint - checks LEGAL for common errors
ardiff - compare two archives easily ardiff - compare two archives easily
addport - replacement for easy-import addport - replacement for easy-import
bad-pkgdescrs.sh - locate identical pkg descriptions bad-pkgdescrs.sh - locate identical pkg descriptions