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

and.damore at macports.org and.damore at macports.org
Thu Nov 25 12:16:15 PST 2010


Revision: 73802
          http://trac.macports.org/changeset/73802
Author:   and.damore at macports.org
Date:     2010-11-25 12:16:11 -0800 (Thu, 25 Nov 2010)
Log Message:
-----------
adding lint command support for skipping version number check in checksum lines

Modified Paths:
--------------
    trunk/base/src/port1.0/portlint.tcl

Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl	2010-11-25 19:38:45 UTC (rev 73801)
+++ trunk/base/src/port1.0/portlint.tcl	2010-11-25 20:16:11 UTC (rev 73802)
@@ -130,6 +130,7 @@
     # read binary (to check UTF-8)
     fconfigure $f -encoding binary
     set lineno 1
+    set hashline false
     while {1} {
         set line [gets $f]
         if {[eof $f]} {
@@ -254,13 +255,26 @@
         }
 
         # Check for hardcoded version numbers
-        if {![regexp {^PortSystem|^PortGroup|^version} $line]
+        # 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 {$hashline &&
+            ![string match \\\\ [string index $line [string length $line]-1]]} {
+                # if the last character is not a backslash we're done with
+                # line skipping
+                set hashline false
+            }
+            
         ### TODO: more checks to Portfile syntax
 
         incr lineno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101125/af46f3f8/attachment.html>


More information about the macports-changes mailing list