Changeset View
Changeset View
Standalone View
Standalone View
Tools/scripts/checklicense.sh
- This file was added.
| Property | Old Value | New Value |
|---|---|---|
| File Mode | null | 100755 |
| #!/bin/sh | |||||
| if [ $# -ne 1 ] | |||||
| then | |||||
| echo "Usage: $0 /path/to/LEGAL" | |||||
| exit 1 | |||||
| fi | |||||
| PORTSDIR="${PORTSDIR:-/usr/ports}" | |||||
| cd "$PORTSDIR" || exit 1 | |||||
| export IFS="${IFS}:" | |||||
| grep -nv '#' "$1" | while read -r line _ port _ | |||||
| do | |||||
| if [ ! -d "$port" ] | |||||
| then | |||||
| printf "%d (%s): port has been removed\\n" "$line" "$port" | |||||
| continue | |||||
| fi | |||||
| lic=$(make -C "$port" debug-license) | |||||
| if echo "$lic" | grep -q "License allows mirroring distribution files" | |||||
| then | |||||
| licdist=$(make -C "$port" -V RESTRICTED_FILES) | |||||
| legal=$(awk -v p=$port '$2==p {print $1}' $1) | |||||
| echo "$port -> RESTRICTED_FILES=$licdist /LEGAL -> $legal" | |||||
| fi | |||||
| done | |||||