Changeset View
Changeset View
Standalone View
Standalone View
Tools/scripts/checklicense.sh
- This file was moved from Tools/scripts/LEGALlint.
Property | Old Value | New Value |
---|---|---|
File Mode | 100755 | 100644 |
#!/bin/sh | #!/bin/sh | ||||
PORTSDIR="${PORTSDIR:-/usr/ports}" | PORTSDIR="${PORTSDIR:-/usr/ports}" | ||||
cd "$PORTSDIR" || exit 1 | cd "$PORTSDIR" || exit 1 | ||||
export IFS="${IFS}:" | export IFS="${IFS}:" | ||||
grep -nv '#' "$PORTSDIR/LEGAL" | while read -r line _ port text | grep -nv '#' "$PORTSDIR/LEGAL" | while read -r line _ port text | ||||
do | do | ||||
if [ ! -d "$port" ] | if [ ! -d "$port" ] | ||||
then | then | ||||
printf "%d (%s): port has been removed\\n" "$line" "$port" | printf "%d (%s): port has been removed\\n" "$line" "$port" | ||||
continue | continue | ||||
fi | fi | ||||
actual_text="$(make -C "$port" -VLEGAL)" | lic=$(make -C "$port" -V LICENSE) | ||||
if [ "$text" != "$actual_text" ] | for l in ${lic} | ||||
do | |||||
terms=$(make -C "$port" -V _LICENSE_PERMS_${l}) | |||||
if echo ${terms} | grep -q dist-mirror | |||||
then | then | ||||
printf "%d (%s): reason mismatch\\n" "$line" "$port" | echo "$port -> $l -> $terms" | ||||
fi | fi | ||||
done | |||||
done | done |