[86017] trunk/base/src/port1.0/portlint.tcl

snc at macports.org snc at macports.org
Tue Oct 18 08:43:55 PDT 2011


Revision: 86017
          http://trac.macports.org/changeset/86017
Author:   snc at macports.org
Date:     2011-10-18 08:43:54 -0700 (Tue, 18 Oct 2011)
Log Message:
-----------
base:
 * avoid some temporary variables in license lint
 * add more comments

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-18 15:31:09 UTC (rev 86016)
+++ trunk/base/src/port1.0/portlint.tcl	2011-10-18 15:43:54 UTC (rev 86017)
@@ -508,9 +508,8 @@
 
         # If maintainer set license, it must follow correct format
 
-        set licenses [split [string map { \{ '' \} ''} $license] '\ ']
         set prev ''
-        foreach test $licenses {
+        foreach test [split [string map { \{ '' \} ''} $license] '\ '] {
             ui_debug "Checking format of license '${test}'"
 
             # space instead of hyphen
@@ -519,10 +518,14 @@
 
             # missing hyphen
             } elseif {![string equal -nocase "X11" $test]} {
-                set subtests [split $test '-']
-                foreach subtest $subtests {
+                foreach subtest [split $test '-']} {
                     ui_debug "testing ${subtest}"
+
+                    # license names start with letters: versions and empty strings need not apply
                     if {[string is alpha -strict [string index $subtest 0]]} {
+
+                        # if the last character of license name is a number or plus sign
+                        # then a hyphen is missing
                         set license_end [string index $subtest end]
                         if {[string equal "+" $license_end] || [string is integer -strict $license_end]} {
                             ui_error "invalid license '${test}': missing hyphen before version"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111018/dbfc5f12/attachment-0001.html>


More information about the macports-changes mailing list