<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[46778] trunk/base/src/port1.0/portlint.tcl</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.macports.org/changeset/46778">46778</a></dd>
<dt>Author</dt> <dd>ryandesign@macports.org</dd>
<dt>Date</dt> <dd>2009-02-12 14:36:18 -0800 (Thu, 12 Feb 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>portlint.tcl: expand tabs to spaces, and make spaces consistent at 4 spaces per indentation</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasesrcport10portlinttcl">trunk/base/src/port1.0/portlint.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbasesrcport10portlinttcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port1.0/portlint.tcl (46777 => 46778)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port1.0/portlint.tcl        2009-02-12 22:26:33 UTC (rev 46777)
+++ trunk/base/src/port1.0/portlint.tcl        2009-02-12 22:36:18 UTC (rev 46778)
</span><span class="lines">@@ -15,96 +15,96 @@
</span><span class="cx"> set_ui_prefix
</span><span class="cx"> 
</span><span class="cx"> set lint_portsystem \
</span><del>-        &quot;1.0&quot;
</del><ins>+    &quot;1.0&quot;
</ins><span class="cx"> 
</span><span class="cx"> set lint_platforms [list \
</span><del>-        &quot;macosx&quot; \
-        &quot;darwin&quot; \
-        &quot;freebsd&quot; \
-        &quot;openbsd&quot; \
-        &quot;netbsd&quot; \
-        &quot;linux&quot; \
-        &quot;sunos&quot; \
-        ]
</del><ins>+    &quot;macosx&quot; \
+    &quot;darwin&quot; \
+    &quot;freebsd&quot; \
+    &quot;openbsd&quot; \
+    &quot;netbsd&quot; \
+    &quot;linux&quot; \
+    &quot;sunos&quot; \
+    ]
</ins><span class="cx"> 
</span><span class="cx"> set lint_categories [list \
</span><del>-        &quot;aqua&quot; \
-        &quot;archivers&quot; \
-        &quot;audio&quot; \
-        &quot;benchmarks&quot; \
-        &quot;cad&quot; \
-        &quot;comms&quot; \
-        &quot;cross&quot; \
-        &quot;databases&quot; \
-        &quot;devel&quot; \
-        &quot;editors&quot; \
-        &quot;emulators&quot; \
-        &quot;erlang&quot; \
-        &quot;finance&quot; \
-        &quot;fuse&quot; \
-        &quot;games&quot; \
-        &quot;genealogy&quot; \
-        &quot;gis&quot; \
-        &quot;gnome&quot; \
-        &quot;gnustep&quot; \
-        &quot;graphics&quot; \
-        &quot;iphone&quot; \
-        &quot;irc&quot; \
-        &quot;java&quot; \
-        &quot;kde&quot; \
-        &quot;lang&quot; \
-        &quot;mail&quot; \
-        &quot;math&quot; \
-        &quot;multimedia&quot; \
-        &quot;net&quot; \
-        &quot;news&quot; \
-        &quot;office&quot; \
-        &quot;palm&quot; \
-        &quot;perl&quot; \
-        &quot;print&quot; \
-        &quot;python&quot; \
-        &quot;ruby&quot; \
-        &quot;science&quot; \
-        &quot;security&quot; \
-        &quot;shells&quot; \
-        &quot;sysutils&quot; \
-        &quot;tex&quot; \
-        &quot;textproc&quot; \
-        &quot;www&quot; \
-        &quot;x11&quot; \
-        &quot;xfce&quot; \
-        &quot;zope&quot; \
-        ]
</del><ins>+    &quot;aqua&quot; \
+    &quot;archivers&quot; \
+    &quot;audio&quot; \
+    &quot;benchmarks&quot; \
+    &quot;cad&quot; \
+    &quot;comms&quot; \
+    &quot;cross&quot; \
+    &quot;databases&quot; \
+    &quot;devel&quot; \
+    &quot;editors&quot; \
+    &quot;emulators&quot; \
+    &quot;erlang&quot; \
+    &quot;finance&quot; \
+    &quot;fuse&quot; \
+    &quot;games&quot; \
+    &quot;genealogy&quot; \
+    &quot;gis&quot; \
+    &quot;gnome&quot; \
+    &quot;gnustep&quot; \
+    &quot;graphics&quot; \
+    &quot;iphone&quot; \
+    &quot;irc&quot; \
+    &quot;java&quot; \
+    &quot;kde&quot; \
+    &quot;lang&quot; \
+    &quot;mail&quot; \
+    &quot;math&quot; \
+    &quot;multimedia&quot; \
+    &quot;net&quot; \
+    &quot;news&quot; \
+    &quot;office&quot; \
+    &quot;palm&quot; \
+    &quot;perl&quot; \
+    &quot;print&quot; \
+    &quot;python&quot; \
+    &quot;ruby&quot; \
+    &quot;science&quot; \
+    &quot;security&quot; \
+    &quot;shells&quot; \
+    &quot;sysutils&quot; \
+    &quot;tex&quot; \
+    &quot;textproc&quot; \
+    &quot;www&quot; \
+    &quot;x11&quot; \
+    &quot;xfce&quot; \
+    &quot;zope&quot; \
+    ]
</ins><span class="cx"> 
</span><span class="cx"> set lint_required [list \
</span><del>-        &quot;name&quot; \
-        &quot;version&quot; \
-        &quot;description&quot; \
-        &quot;long_description&quot; \
-        &quot;categories&quot; \
-        &quot;maintainers&quot; \
-        &quot;platforms&quot; \
-        &quot;homepage&quot; \
-        &quot;master_sites&quot; \
-        &quot;checksums&quot; \
-        ]
</del><ins>+    &quot;name&quot; \
+    &quot;version&quot; \
+    &quot;description&quot; \
+    &quot;long_description&quot; \
+    &quot;categories&quot; \
+    &quot;maintainers&quot; \
+    &quot;platforms&quot; \
+    &quot;homepage&quot; \
+    &quot;master_sites&quot; \
+    &quot;checksums&quot; \
+    ]
</ins><span class="cx"> 
</span><span class="cx"> set lint_optional [list \
</span><del>-        &quot;epoch&quot; \
-        &quot;revision&quot; \
-        &quot;worksrcdir&quot; \
-        &quot;distname&quot; \
-        &quot;use_automake&quot; \
-        &quot;use_autoconf&quot; \
-        &quot;use_configure&quot; \
-        ]
</del><ins>+    &quot;epoch&quot; \
+    &quot;revision&quot; \
+    &quot;worksrcdir&quot; \
+    &quot;distname&quot; \
+    &quot;use_automake&quot; \
+    &quot;use_autoconf&quot; \
+    &quot;use_configure&quot; \
+    ]
</ins><span class="cx"> 
</span><span class="cx"> set lint_variants [list \
</span><del>-        &quot;universal&quot; \
-        &quot;docs&quot; \
-        &quot;aqua&quot; \
-        &quot;x11&quot; \
-        ]
</del><ins>+    &quot;universal&quot; \
+    &quot;docs&quot; \
+    &quot;aqua&quot; \
+    &quot;x11&quot; \
+    ]
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> proc seems_utf8 {str} {
</span><span class="lines">@@ -146,17 +146,17 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc lint_main {args} {
</span><del>-        global UI_PREFIX portname portpath porturl ports_lint_nitpick
-        set portfile ${portpath}/Portfile
-        set portdirs [split ${portpath} /]
-        set last [llength $portdirs]
-        incr last -1
-        set portdir [lindex $portdirs $last]
-        incr last -1
-        set portcatdir [lindex $portdirs $last]
</del><ins>+    global UI_PREFIX portname portpath porturl ports_lint_nitpick
+    set portfile ${portpath}/Portfile
+    set portdirs [split ${portpath} /]
+    set last [llength $portdirs]
+    incr last -1
+    set portdir [lindex $portdirs $last]
+    incr last -1
+    set portcatdir [lindex $portdirs $last]
</ins><span class="cx"> 
</span><del>-        set warnings 0
-        set errors 0
</del><ins>+    set warnings 0
+    set errors 0
</ins><span class="cx"> 
</span><span class="cx">     ###################################################################
</span><span class="cx">     ui_debug &quot;$portfile&quot;
</span><span class="lines">@@ -233,13 +233,13 @@
</span><span class="cx"> 
</span><span class="cx">         if {[string match &quot;PortSystem*&quot; $line]} {
</span><span class="cx">             if {$seen_portsystem} {
</span><del>-                 ui_error &quot;Line $lineno repeats PortSystem information&quot;
-                 incr errors
</del><ins>+                ui_error &quot;Line $lineno repeats PortSystem information&quot;
+                incr errors
</ins><span class="cx">             }
</span><span class="cx">             regexp {PortSystem\s+([0-9.]+)} $line -&gt; portsystem
</span><span class="cx">             if {![info exists portsystem]} {
</span><del>-                 ui_error &quot;Line $lineno has unrecognized PortSystem&quot;
-                 incr errors
</del><ins>+                ui_error &quot;Line $lineno has unrecognized PortSystem&quot;
+                incr errors
</ins><span class="cx">             }
</span><span class="cx">             set seen_portsystem true
</span><span class="cx">             set require_blank true
</span><span class="lines">@@ -247,13 +247,13 @@
</span><span class="cx">         }
</span><span class="cx">         if {[string match &quot;PortGroup*&quot; $line]} {
</span><span class="cx">             if {$seen_portgroup} {
</span><del>-                 ui_error &quot;Line $lineno repeats PortGroup information&quot;
-                 incr errors
</del><ins>+                ui_error &quot;Line $lineno repeats PortGroup information&quot;
+                incr errors
</ins><span class="cx">             }
</span><span class="cx">             regexp {PortGroup\s+([a-z0-9]+)\s+([0-9.]+)} $line -&gt; portgroup portgroupversion
</span><span class="cx">             if {![info exists portgroup]} {
</span><del>-                 ui_error &quot;Line $lineno has unrecognized PortGroup&quot;
-                 incr errors
</del><ins>+                ui_error &quot;Line $lineno has unrecognized PortGroup&quot;
+                incr errors
</ins><span class="cx">             }
</span><span class="cx">             set seen_portgroup true
</span><span class="cx">             set require_blank true
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">         if {[string match &quot;variant*&quot; $line]} {
</span><span class="cx">             regexp {variant\s+(\w+)} $line -&gt; variantname
</span><span class="cx">             if {[info exists variantname]} {
</span><del>-                 lappend local_variants $variantname
</del><ins>+                lappend local_variants $variantname
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -332,12 +332,12 @@
</span><span class="cx">             set var $req_var
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-       if {$var == &quot;master_sites&quot; &amp;&amp; ${fetch.type} != &quot;standard&quot;} {
-             ui_info &quot;OK: $var not required for fetch.type ${fetch.type}&quot;
-             continue
-       }
-       
-       if {![info exists $var]} {
</del><ins>+        if {$var == &quot;master_sites&quot; &amp;&amp; ${fetch.type} != &quot;standard&quot;} {
+            ui_info &quot;OK: $var not required for fetch.type ${fetch.type}&quot;
+            continue
+        }
+
+        if {![info exists $var]} {
</ins><span class="cx">             ui_error &quot;Missing required variable: $req_var&quot;
</span><span class="cx">             incr errors
</span><span class="cx">         } else {
</span><span class="lines">@@ -346,22 +346,22 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     foreach opt_var $lint_optional {
</span><del>-       if {$opt_var == &quot;epoch&quot;} {
</del><ins>+        if {$opt_var == &quot;epoch&quot;} {
</ins><span class="cx">             set var &quot;portepoch&quot;
</span><span class="cx">         } elseif {$opt_var == &quot;revision&quot;} {
</span><span class="cx">             set var &quot;portrevision&quot;
</span><span class="cx">         } else {
</span><span class="cx">             set var $opt_var
</span><del>-       }
-       if {[info exists $var]} {
</del><ins>+        }
+        if {[info exists $var]} {
</ins><span class="cx">             # TODO: check whether it was seen (or default)
</span><span class="cx">             ui_info &quot;OK: Found optional variable: $opt_var&quot;
</span><del>-       }
</del><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if {[info exists platforms]} {
</span><span class="cx">         foreach platform $platforms {
</span><del>-           if {[lsearch -exact $lint_platforms $platform] == -1} {
</del><ins>+            if {[lsearch -exact $lint_platforms $platform] == -1} {
</ins><span class="cx">                 ui_error &quot;Unknown platform: $platform&quot;
</span><span class="cx">                 incr errors
</span><span class="cx">             } else {
</span><span class="lines">@@ -513,7 +513,7 @@
</span><span class="cx">     ui_debug &quot;Arch: $portarch&quot;
</span><span class="cx">     ###################################################################
</span><span class="cx"> 
</span><del>-        ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;%d errors and %d warnings found.&quot;] $errors $warnings]&quot;
</del><ins>+    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;%d errors and %d warnings found.&quot;] $errors $warnings]&quot;
</ins><span class="cx"> 
</span><del>-        return {$errors &gt; 0}
</del><ins>+    return {$errors &gt; 0}
</ins><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>