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

jmr at macports.org jmr at macports.org
Sat Apr 30 09:17:42 PDT 2011


Revision: 78249
          http://trac.macports.org/changeset/78249
Author:   jmr at macports.org
Date:     2011-04-30 09:17:42 -0700 (Sat, 30 Apr 2011)
Log Message:
-----------
portlint: only warn about apparent hardcoded use of version in --nitpick mode

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-04-30 16:14:20 UTC (rev 78248)
+++ trunk/base/src/port1.0/portlint.tcl	2011-04-30 16:17:42 UTC (rev 78249)
@@ -255,25 +255,28 @@
         }
 
         # Check for hardcoded version numbers
-        # Support for skipping checksums lines
-        if {[regexp {^checksums} $line]} {
-            # We enter a serie one or more lines containing checksums
-            set hashline true}
-
-        if {!$hashline
-                && ![regexp {^PortSystem|^PortGroup|^version} $line]
-                && ![regexp {^[a-z0-9]+\.setup} $line]
-                && [string first [option version] $line] != -1} {
-            ui_warn "Line $lineno seems to hardcode the version number, consider using \${version} instead"
-            incr warnings
+        if {$nitpick} {
+            # Support for skipping checksums lines
+            if {[regexp {^checksums} $line]} {
+                # We enter a series of one or more lines containing checksums
+                set hashline true
+            }
+    
+            if {!$hashline
+                    && ![regexp {^PortSystem|^PortGroup|^version} $line]
+                    && ![regexp {^[a-z0-9]+\.setup} $line]
+                    && [string first [option version] $line] != -1} {
+                ui_warn "Line $lineno seems to hardcode the version number, consider using \${version} instead"
+                incr warnings
+            }
+    
+            if {$hashline &&
+                ![string match \\\\ [string index $line end]]} {
+                    # if the last character is not a backslash we're done with
+                    # line skipping
+                    set hashline false
+            }
         }
-
-        if {$hashline &&
-            ![string match \\\\ [string index $line end]]} {
-                # if the last character is not a backslash we're done with
-                # line skipping
-                set hashline false
-            }
             
         ### TODO: more checks to Portfile syntax
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110430/b83da552/attachment.html>


More information about the macports-changes mailing list