svn commit: r470955 - head/Tools/scripts

Eitan Adler eadler at FreeBSD.org
Sun May 27 05:02:07 UTC 2018


Author: eadler
Date: Sun May 27 05:02:06 2018
New Revision: 470955
URL: https://svnweb.freebsd.org/changeset/ports/470955

Log:
  Tools: add LEGALlint
  
  This checks 'LEGAL' for common errors, It is inspired by MOVEDLint.

Added:
  head/Tools/scripts/LEGALlint   (contents, props changed)
Modified:
  head/Tools/scripts/README

Added: head/Tools/scripts/LEGALlint
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/Tools/scripts/LEGALlint	Sun May 27 05:02:06 2018	(r470955)
@@ -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

Modified: head/Tools/scripts/README
==============================================================================
--- head/Tools/scripts/README	Sun May 27 04:43:37 2018	(r470954)
+++ head/Tools/scripts/README	Sun May 27 05:02:06 2018	(r470955)
@@ -6,6 +6,7 @@ NOTE: These scripts need work and are *NOT* safe to us
       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


More information about the svn-ports-all mailing list