1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00
freebsd-ports/Tools/scripts/LEGALlint
Eitan Adler eac1d5f88c Tools: add LEGALlint
This checks 'LEGAL' for common errors, It is inspired by MOVEDLint.
2018-05-27 05:02:06 +00:00

23 lines
436 B
Bash
Executable File

#!/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