[85929] trunk/base/src/port1.0/portlint.tcl
snc at macports.org
snc at macports.org
Mon Oct 17 11:19:31 PDT 2011
Revision: 85929
http://trac.macports.org/changeset/85929
Author: snc at macports.org
Date: 2011-10-17 11:19:31 -0700 (Mon, 17 Oct 2011)
Log Message:
-----------
base: if set, check license formatting
Modified Paths:
--------------
trunk/base/src/port1.0/portlint.tcl
Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl 2011-10-17 17:53:36 UTC (rev 85928)
+++ trunk/base/src/port1.0/portlint.tcl 2011-10-17 18:19:31 UTC (rev 85929)
@@ -504,6 +504,30 @@
if {$license == "unknown"} {
ui_warn "no license set"
incr warnings
+ } else {
+
+ # If maintainer set license, it must follow correct format
+
+ # Apache 2 is illegal, use Apache-2
+ if {[regexp {[A-Za-z] [0-9]} $license]} {
+ ui_error "Invalid license format: use a hyphen between name and version"
+ }
+
+ # GPL3 is illegal, use GPL-3
+ # but beware X11
+ regsub -all -nocase {\mX11\M} $license '' tmp_license
+ if {[regexp {[A-Za-z][0-9]} $tmp_license]} {
+ ui_error "Invalid license format: must be name\[-version\[.revision\]\]"
+ }
+
+ # BSD-2 is illegal, use BSD
+ # BSD-3 is illegal, use BSD
+ # BSD-4 is illegal, use BSD-old
+ if {[regexp -nocase {BSD-[0-9]} $license]} {
+ ui_error "Invalid BSD license:"
+ ui_error " * BSD (for 2/3 clause)"
+ ui_error " * BSD-old (for 4 clause)"
+ }
}
# these checks are only valid for ports stored in the regular tree directories
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111017/52ff8898/attachment-0001.html>
More information about the macports-changes
mailing list