<!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>[116518] trunk/base/portmgr/packaging</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="https://trac.macports.org/changeset/116518">116518</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2014-01-27 07:39:11 -0800 (Mon, 27 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>portmgr/packaging: whitespace only, unify whitespace, reindent</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbaseportmgrpackagingdpkgalltcl">trunk/base/portmgr/packaging/dpkgall.tcl</a></li>
<li><a href="#trunkbaseportmgrpackagingmpkgalltcl">trunk/base/portmgr/packaging/mpkgall.tcl</a></li>
<li><a href="#trunkbaseportmgrpackagingpackagealltcl">trunk/base/portmgr/packaging/packageall.tcl</a></li>
<li><a href="#trunkbaseportmgrpackagingrpmalltcl">trunk/base/portmgr/packaging/rpmall.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbaseportmgrpackagingdpkgalltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/dpkgall.tcl (116517 => 116518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/dpkgall.tcl        2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/dpkgall.tcl        2014-01-27 15:39:11 UTC (rev 116518)
</span><span class="lines">@@ -12,14 +12,14 @@
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="cx"> # are met:
</span><span class="cx"> # 1. Redistributions of source code must retain the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer.
</del><ins>+#         notice, this list of conditions and the following disclaimer.
</ins><span class="cx"> # 2. Redistributions in binary form must reproduce the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
</del><ins>+#         notice, this list of conditions and the following disclaimer in the
+#         documentation and/or other materials provided with the distribution.
</ins><span class="cx"> # 3. Neither the name of Apple Inc. nor the names of its contributors
</span><del>-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
</del><ins>+#         may be used to endorse or promote products derived from this software
+#         without specific prior written permission.
+#
</ins><span class="cx"> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
</span><span class="cx"> # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
</span><span class="cx"> # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
</span><span class="lines">@@ -88,20 +88,20 @@
</span><span class="cx"> 
</span><span class="cx"> # MacPorts UI Event Callbacks
</span><span class="cx"> proc ui_prefix {priority} {
</span><del>-    switch $priority {
-        debug {
-                return &quot;Debug: &quot;
-        }
-        error {
-                return &quot;Error: &quot;
-        }
-        warn {
-                return &quot;Warning: &quot;
-        }
-        default {
-                return &quot;&quot;
-        }
-    }
</del><ins>+        switch $priority {
+                debug {
+                        return &quot;Debug: &quot;
+                }
+                error {
+                        return &quot;Error: &quot;
+                }
+                warn {
+                        return &quot;Warning: &quot;
+                }
+                default {
+                        return &quot;&quot;
+                }
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc ui_channels {priority} {
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">                 exit 0
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        # We must have dpkg by now 
</del><ins>+        # We must have dpkg by now
</ins><span class="cx">         if {[catch {set_architecture} result]} {
</span><span class="cx">                 puts &quot;$result.&quot;
</span><span class="cx">                 puts &quot;Have you initialized the build system? Use the -i flag:&quot;
</span><span class="lines">@@ -432,16 +432,16 @@
</span><span class="cx">                 array set portinfo [lindex $res 1]
</span><span class="cx"> 
</span><span class="cx">                 if {![info exists portinfo(name)] ||
</span><del>-                        ![info exists portinfo(version)] || 
-                        ![info exists portinfo(revision)] || 
</del><ins>+                        ![info exists portinfo(version)] ||
+                        ![info exists portinfo(revision)] ||
</ins><span class="cx">                         ![info exists portinfo(categories)]} {
</span><span class="cx">                         ui_noisy_error &quot;Internal error: $name missing some portinfo keys&quot;
</span><span class="cx">                         close $logfd
</span><span class="cx">                         continue
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-        # open correct subport
-        set options(subport) $portinfo(name)
</del><ins>+                # open correct subport
+                set options(subport) $portinfo(name)
</ins><span class="cx"> 
</span><span class="cx">                 # Skip un-supported ports
</span><span class="cx">                 if {[info exists portinfo(platforms)] &amp;&amp; ${anyplatform_flag} != &quot;true&quot;} {
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 ui_silent &quot;Package build for $portinfo(name) succeeded&quot;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 # Into the apt repository you go!
</span><span class="cx">                 copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
</span><span class="cx"> 
</span><span class="lines">@@ -597,7 +597,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if {[info exists newpkglist]} {                
</del><ins>+                if {[info exists newpkglist]} {
</ins><span class="cx">                         set pkglist [lsort -unique [concat $newpkglist $pkglist]]
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -694,7 +694,7 @@
</span><span class="cx">         set variations &quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         foreach port [get_required_ports] {
</span><del>-            set options(subport) $port
</del><ins>+                set options(subport) $port
</ins><span class="cx">                 if {[catch {do_portexec $port [array get options] [array get variants] activate} result]} {
</span><span class="cx">                         global errorInfo
</span><span class="cx">                         ui_debug &quot;$errorInfo&quot;
</span><span class="lines">@@ -718,8 +718,8 @@
</span><span class="cx">                 }
</span><span class="cx">                 ui_msg &quot;Done.&quot;
</span><span class="cx">         }
</span><del>-                        
</del><span class="cx"> 
</span><ins>+
</ins><span class="cx">         if {[catch {set_architecture} result]} {
</span><span class="cx">                 puts &quot;Fatal error: $result.&quot;
</span><span class="cx">                 exit 1
</span><span class="lines">@@ -858,14 +858,14 @@
</span><span class="cx"> 
</span><span class="cx"> proc get_dependencies_recurse {portname includeBuildDeps} {
</span><span class="cx">         set result {}
</span><del>-        
</del><ins>+
</ins><span class="cx">         set res [get_portinfo $portname]
</span><span class="cx"> 
</span><span class="cx">         foreach {name array} $res {
</span><span class="cx">                 array set portinfo $array
</span><span class="cx">                 if {![info exists portinfo(name)] ||
</span><del>-                        ![info exists portinfo(version)] || 
-                        ![info exists portinfo(revision)] || 
</del><ins>+                        ![info exists portinfo(version)] ||
+                        ![info exists portinfo(revision)] ||
</ins><span class="cx">                         ![info exists portinfo(categories)]} {
</span><span class="cx">                         ui_error &quot;Internal error: $name missing some portinfo keys&quot;
</span><span class="cx">                         continue
</span><span class="lines">@@ -877,13 +877,13 @@
</span><span class="cx">                 set depends {}
</span><span class="cx">                 if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
</span><del>-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_build)]} { 
</del><ins>+                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_build)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} { 
</del><ins>+                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_fetch)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_extract)]} { 
</del><ins>+                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_extract)&quot;
</span><span class="cx">                 }
</span><span class="cx">                 foreach depspec $depends {
</span><span class="lines">@@ -913,7 +913,7 @@
</span><span class="cx">         } else {
</span><span class="cx">                 set verstring ${portversion}
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
</span><span class="cx">         set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingmpkgalltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/mpkgall.tcl (116517 => 116518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/mpkgall.tcl        2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/mpkgall.tcl        2014-01-27 15:39:11 UTC (rev 116518)
</span><span class="lines">@@ -10,14 +10,14 @@
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="cx"> # are met:
</span><span class="cx"> # 1. Redistributions of source code must retain the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer.
</del><ins>+#         notice, this list of conditions and the following disclaimer.
</ins><span class="cx"> # 2. Redistributions in binary form must reproduce the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
</del><ins>+#         notice, this list of conditions and the following disclaimer in the
+#         documentation and/or other materials provided with the distribution.
</ins><span class="cx"> # 3. Neither the name of Apple Inc. nor the names of its contributors
</span><del>-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
</del><ins>+#         may be used to endorse or promote products derived from this software
+#         without specific prior written permission.
+#
</ins><span class="cx"> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
</span><span class="cx"> # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
</span><span class="cx"> # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">         # XXX: don't overwrite Apple X11
</span><span class="cx">         # XXX: probably should exclude KDE here too
</span><span class="cx">         if {$portname == &quot;XFree86&quot;} { return {} }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[catch {set res [mportsearch &quot;^$portname\$&quot;]} error]} {
</span><span class="cx">                 puts stderr &quot;Internal error: port search failed: $error&quot;
</span><span class="cx">                 return
</span><span class="lines">@@ -63,11 +63,11 @@
</span><span class="cx">                 if {![info exists portinfo(name)]} { return -1 }
</span><span class="cx">                 if {![info exists portinfo(version)]} { return -1 }
</span><span class="cx">                 if {![info exists portinfo(categories)]} { return -1 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set portname $portinfo(name)
</span><span class="cx">                 set portversion $portinfo(version)
</span><span class="cx">                 set category [lindex $portinfo(categories) 0]
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set depends {}
</span><span class="cx">                 if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
</span><span class="lines">@@ -75,13 +75,13 @@
</span><span class="cx">                 foreach depspec $depends {
</span><span class="cx">                         set dep [lindex [split $depspec :] end]
</span><span class="cx">                         set result [copy_package_if_available $dep $basepath $destpath]
</span><del>-                        if {$result == -1} { 
</del><ins>+                        if {$result == -1} {
</ins><span class="cx">                                 return -1
</span><span class="cx">                         } else {
</span><span class="cx">                                 eval &quot;lappend dependencies $result&quot;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set pkgname &quot;${portname}-${portversion}.pkg&quot;
</span><span class="cx">                 lappend dependencies $pkgname
</span><span class="cx">                 set pkgpath &quot;${basepath}/${category}/${pkgname}&quot;
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">                         return -1
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         return $dependencies
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -120,10 +120,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc write_welcome_html {filename portname portversion long_description description homepage} {
</span><del>-    set fd [open ${filename} w+]
-    if {$long_description eq &quot;&quot;} {
-        set long_description $description
-    }
</del><ins>+        set fd [open ${filename} w+]
+        if {$long_description eq &quot;&quot;} {
+                set long_description $description
+        }
</ins><span class="cx"> 
</span><span class="cx"> puts $fd &quot;
</span><span class="cx"> &lt;html lang=\&quot;en\&quot;&gt;
</span><span class="lines">@@ -137,15 +137,15 @@
</span><span class="cx"> &lt;font face=\&quot;Helvetica\&quot;&gt;${long_description}&lt;/font&gt;
</span><span class="cx"> &lt;p&gt;&quot;
</span><span class="cx"> 
</span><del>-    if {$homepage ne &quot;&quot;} {
-        puts $fd &quot;&lt;font face=\&quot;Helvetica\&quot;&gt;${homepage}&lt;/font&gt;&lt;p&gt;&quot;
-    }
</del><ins>+        if {$homepage ne &quot;&quot;} {
+                puts $fd &quot;&lt;font face=\&quot;Helvetica\&quot;&gt;${homepage}&lt;/font&gt;&lt;p&gt;&quot;
+        }
</ins><span class="cx"> 
</span><del>-    puts $fd &quot;&lt;font face=\&quot;Helvetica\&quot;&gt;This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.&lt;/font&gt;
</del><ins>+        puts $fd &quot;&lt;font face=\&quot;Helvetica\&quot;&gt;This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.&lt;/font&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;&quot;
</span><span class="cx"> 
</span><del>-    close $fd
</del><ins>+        close $fd
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc write_PkgInfo {infofile} {
</span><span class="lines">@@ -156,11 +156,11 @@
</span><span class="cx"> 
</span><span class="cx"> proc mpkg_write_info_plist {infofile portname portversion portrevision destination dependencies} {
</span><span class="cx">         set vers [split $portversion &quot;.&quot;]
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[string index $destination end] ne &quot;/&quot;} {
</span><span class="cx">                 append destination /
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         set depxml &quot;&quot;
</span><span class="cx">         foreach dep $dependencies {
</span><span class="cx">                 append depxml &quot;&lt;dict&gt;
</span><span class="lines">@@ -206,9 +206,9 @@
</span><span class="cx"> # Standard procedures
</span><span class="cx"> 
</span><span class="cx"> proc fatal args {
</span><del>-    global argv0
-    puts stderr &quot;$argv0: $args&quot;
-    exit
</del><ins>+        global argv0
+        puts stderr &quot;$argv0: $args&quot;
+        exit
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Main
</span><span class="lines">@@ -217,120 +217,118 @@
</span><span class="cx"> #        set ui_options(ports_verbose) yes
</span><span class="cx"> 
</span><span class="cx"> if {[catch {mportinit ui_options options variations} result]} {
</span><del>-    puts &quot;Failed to initialize ports system, $result&quot;
-    exit 1
</del><ins>+        puts &quot;Failed to initialize ports system, $result&quot;
+        exit 1
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> package require Pextlib
</span><span class="cx"> 
</span><span class="cx"> # If no arguments were given, default to all ports.
</span><span class="cx"> if {[llength $argv] == 0} {
</span><del>-        lappend argv &quot;.*&quot;
</del><ins>+        lappend argv &quot;.*&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> foreach pname $argv {
</span><ins>+        if {[catch {set res [mportsearch &quot;^${pname}\$&quot;]} result]} {
+                puts &quot;port search failed: $result&quot;
+                exit 1
+        }
</ins><span class="cx"> 
</span><del>-if {[catch {set res [mportsearch &quot;^${pname}\$&quot;]} result]} {
-        puts &quot;port search failed: $result&quot;
-        exit 1
-}
</del><ins>+        foreach {name array} $res {
+                global prefix
+                array unset portinfo
+                array set portinfo $array
</ins><span class="cx"> 
</span><del>-foreach {name array} $res {
-        global prefix
-        array unset portinfo
-        array set portinfo $array
</del><ins>+                if {![info exists portinfo(porturl)]} {
+                        puts stderr &quot;Internal error: no porturl for $name&quot;
+                        continue
+                }
</ins><span class="cx"> 
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr &quot;Internal error: no porturl for $name&quot;
-                continue
-        }
-        
-        set pkgbase &quot;/darwinports/pkgs/&quot;
-        set mpkgbase &quot;/darwinports/mpkgs/&quot;
-        set porturl $portinfo(porturl)
-        set prefix &quot;/opt/local&quot;
</del><ins>+                set pkgbase &quot;/darwinports/pkgs/&quot;
+                set mpkgbase &quot;/darwinports/mpkgs/&quot;
+                set porturl $portinfo(porturl)
+                set prefix &quot;/opt/local&quot;
</ins><span class="cx"> 
</span><del>-        # Skip up-to-date packages
-        if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                if {[info exists portinfo(name)] &amp;&amp;
-                        [info exists portinfo(version)] &amp;&amp;
-                        [info exists portinfo(categories)]} {
-                        set portname $portinfo(name)
-                        set portversion $portinfo(version)
-                        set category [lindex $portinfo(categories) 0]
-                        set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
-                        if {[file readable $mpkgfile] &amp;&amp; ([file mtime ${mpkgfile}] &gt; [file mtime ${portpath}/Portfile])} {
-                                puts stderr &quot;Skipping ${portname}-${portversion}; meta-package is up to date.&quot;
-                                continue
</del><ins>+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
+                        if {[info exists portinfo(name)] &amp;&amp;
+                                [info exists portinfo(version)] &amp;&amp;
+                                [info exists portinfo(categories)]} {
+                                set portname $portinfo(name)
+                                set portversion $portinfo(version)
+                                set category [lindex $portinfo(categories) 0]
+                                set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
+                                if {[file readable $mpkgfile] &amp;&amp; ([file mtime ${mpkgfile}] &gt; [file mtime ${portpath}/Portfile])} {
+                                        puts stderr &quot;Skipping ${portname}-${portversion}; meta-package is up to date.&quot;
+                                        continue
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        }
-        
-        # Skipt packages which previously failed
-                
-        # Building the mpkg:
-        # - create an mpkg skeleton
-        # - copy dependent pkgs into Contents/Resources directory
</del><span class="cx"> 
</span><del>-        set portname &quot;&quot;
-        set portversion &quot;&quot;
-        set description &quot;&quot;
-        set long_description &quot;&quot;
-        set homepage &quot;&quot;
-        set category &quot;&quot;
</del><ins>+                # Skipt packages which previously failed
</ins><span class="cx"> 
</span><del>-        if {[info exists portinfo(name)]} {        set portname $portinfo(name) }
-        if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
-        if {[info exists portinfo(description)]} { set description $portinfo(description) }
-        if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
-        if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
-        if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
-        if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
-        
-        puts &quot;meta-packaging ${category}/${portname}-${portversion}&quot;
</del><ins>+                # Building the mpkg:
+                # - create an mpkg skeleton
+                # - copy dependent pkgs into Contents/Resources directory
</ins><span class="cx"> 
</span><del>-        set mpkgpath &quot;${mpkgbase}/${category}/${portname}-${portversion}.mpkg&quot;
</del><ins>+                set portname &quot;&quot;
+                set portversion &quot;&quot;
+                set description &quot;&quot;
+                set long_description &quot;&quot;
+                set homepage &quot;&quot;
+                set category &quot;&quot;
</ins><span class="cx"> 
</span><del>-        if {[catch {system &quot;mkdir -p -m 0755 ${mpkgpath}/Contents/Resources&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        
-        # list of .pkg names for dependencies,
-        # built up by copy_package_if_available, and used in the Info.plist
-        set dependencies {}
-        set result [copy_package_if_available ${portname} $pkgbase &quot;${mpkgpath}/Contents/Resources/&quot;]
-        if {$result == -1} {
-                puts stderr &quot;aborting; one or more dependencies was missing.&quot;
-                if {[catch {system &quot;rm -R ${mpkgpath}&quot;} error]} {
</del><ins>+                if {[info exists portinfo(name)]} {        set portname $portinfo(name) }
+                if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
+                if {[info exists portinfo(description)]} { set description $portinfo(description) }
+                if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
+                if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
+                if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
+                if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
+
+                puts &quot;meta-packaging ${category}/${portname}-${portversion}&quot;
+
+                set mpkgpath &quot;${mpkgbase}/${category}/${portname}-${portversion}.mpkg&quot;
+
+                if {[catch {system &quot;mkdir -p -m 0755 ${mpkgpath}/Contents/Resources&quot;} error]} {
</ins><span class="cx">                         puts stderr &quot;Internal error: $error&quot;
</span><span class="cx">                 }
</span><del>-                continue
-        } else {
-                set result [lsort -uniq $result]
-                eval &quot;lappend dependencies $result&quot;
-        }
-        
-        #
-        # Begin quote from portmpkg.tcl
-        #
-    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
-    mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
-    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage} {
-        if {![info exists $variable]} {
-            set pkg_$variable &quot;&quot;
-        } else {
-            set pkg_$variable [set $variable]
-        }
-    }
-    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
-    file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
</del><ins>+
+                # list of .pkg names for dependencies,
+                # built up by copy_package_if_available, and used in the Info.plist
+                set dependencies {}
+                set result [copy_package_if_available ${portname} $pkgbase &quot;${mpkgpath}/Contents/Resources/&quot;]
+                if {$result == -1} {
+                        puts stderr &quot;aborting; one or more dependencies was missing.&quot;
+                        if {[catch {system &quot;rm -R ${mpkgpath}&quot;} error]} {
+                                puts stderr &quot;Internal error: $error&quot;
+                        }
+                        continue
+                } else {
+                        set result [lsort -uniq $result]
+                        eval &quot;lappend dependencies $result&quot;
+                }
+
+                #
+                # Begin quote from portmpkg.tcl
+                #
+                write_PkgInfo ${mpkgpath}/Contents/PkgInfo
+                mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
+                write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
+                # long_description, description, or homepage may not exist
+                foreach variable {long_description description homepage} {
+                        if {![info exists $variable]} {
+                                set pkg_$variable &quot;&quot;
+                        } else {
+                                set pkg_$variable [set $variable]
+                        }
+                }
+                write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
+                file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
</ins><span class="cx">                         ${mpkgpath}/Contents/Resources/background.tiff
</span><del>-        #
-        # End quote from portmpkg.tcl
-        #
</del><ins>+                #
+                # End quote from portmpkg.tcl
+                #
+        }
</ins><span class="cx"> }
</span><del>-
-}
</del><span class="cx"> # end foreach pname
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingpackagealltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/packageall.tcl (116517 => 116518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/packageall.tcl        2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/packageall.tcl        2014-01-27 15:39:11 UTC (rev 116518)
</span><span class="lines">@@ -11,14 +11,14 @@
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="cx"> # are met:
</span><span class="cx"> # 1. Redistributions of source code must retain the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer.
</del><ins>+#         notice, this list of conditions and the following disclaimer.
</ins><span class="cx"> # 2. Redistributions in binary form must reproduce the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
</del><ins>+#         notice, this list of conditions and the following disclaimer in the
+#         documentation and/or other materials provided with the distribution.
</ins><span class="cx"> # 3. Neither the name of Apple Inc. nor the names of its contributors
</span><del>-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
</del><ins>+#         may be used to endorse or promote products derived from this software
+#         without specific prior written permission.
+#
</ins><span class="cx"> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
</span><span class="cx"> # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
</span><span class="cx"> # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
</span><span class="lines">@@ -44,82 +44,82 @@
</span><span class="cx"> 
</span><span class="cx"> # ui_options accessor
</span><span class="cx"> proc ui_isset {val} {
</span><del>-    global ui_options
-    if {[info exists ui_options($val)]} {
-        if {$ui_options($val) eq &quot;yes&quot;} {
-            return 1
</del><ins>+        global ui_options
+        if {[info exists ui_options($val)]} {
+                if {$ui_options($val) eq &quot;yes&quot;} {
+                        return 1
+                }
</ins><span class="cx">         }
</span><del>-    }
-    return 0
</del><ins>+        return 0
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-# UI Callback 
</del><ins>+# UI Callback
</ins><span class="cx"> 
</span><span class="cx"> proc ui_prefix {priority} {
</span><del>-    switch $priority {
-        debug {
-                return &quot;DEBUG: &quot;
-        }
-        error {
-                return &quot;Error: &quot;
-        }
-        warn {
-                return &quot;Warning: &quot;
-        }
-        default {
-                return &quot;&quot;
-        }
-    }
</del><ins>+        switch $priority {
+                debug {
+                        return &quot;DEBUG: &quot;
+                }
+                error {
+                        return &quot;Error: &quot;
+                }
+                warn {
+                        return &quot;Warning: &quot;
+                }
+                default {
+                        return &quot;&quot;
+                }
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc ui_channels {priority} {
</span><del>-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-                    return {stdout}
-            } else {
-                    return {}
-            }
-        }
-        info {
</del><ins>+        global logfd
+        switch $priority {
+                debug {
+                        if {[ui_isset ports_debug]} {
+                                return {stdout}
+                        } else {
+                                return {}
+                        }
+                }
+                info {
</ins><span class="cx">                         # put verbose stuff only to the log file
</span><del>-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
</del><ins>+                        if {[ui_isset ports_verbose]} {
+                                return {$logfd}
+                        } else {
+                                return {}
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
</del><ins>+                msg {
+                        if {[ui_isset ports_quiet]} {
+                                return {}
</ins><span class="cx">                         } else {
</span><span class="cx">                                 return {stdout}
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        default {
-                return {stdout}
-        }
-    }
</del><ins>+                default {
+                        return {stdout}
+                }
+        }
</ins><span class="cx"> }
</span><del>-        
</del><ins>+
</ins><span class="cx"> proc pkg_ui_log {message} {
</span><del>-    global logfd
-    if {$logfd ne &quot;&quot;} {
-        log_message $logfd $message
-    }
</del><ins>+        global logfd
+        if {$logfd ne &quot;&quot;} {
+                log_message $logfd $message
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc log_message {channel message} {
</span><del>-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
</del><ins>+        seek $channel 0 end
+        puts $channel $message
+        flush $channel
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Recursive bottom-up approach of building a list of dependencies.
</span><span class="cx"> proc get_dependencies {portname includeBuildDeps} {
</span><span class="cx">         set result {}
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[catch {set res [mportsearch &quot;^$portname\$&quot;]} error]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;$errorInfo&quot;
</span><span class="lines">@@ -129,12 +129,12 @@
</span><span class="cx">         foreach {name array} $res {
</span><span class="cx">                 array set portinfo $array
</span><span class="cx">                 if {![info exists portinfo(name)] ||
</span><del>-                        ![info exists portinfo(version)] || 
</del><ins>+                        ![info exists portinfo(version)] ||
</ins><span class="cx">                         ![info exists portinfo(categories)]} {
</span><span class="cx">                         ui_error &quot;Internal error: $name missing some portinfo keys&quot;
</span><span class="cx">                         continue
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set portname $portinfo(name)
</span><span class="cx">                 set portversion $portinfo(version)
</span><span class="cx">                 set category [lindex $portinfo(categories) 0]
</span><span class="lines">@@ -147,16 +147,16 @@
</span><span class="cx">                 set depends {}
</span><span class="cx">                 if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_build)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_build)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_fetch)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_extract)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_extract)&quot;
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach depspec $depends {
</span><span class="cx">                         set dep [lindex [split $depspec :] end]
</span><span class="cx">                         set x [get_dependencies $dep $includeBuildDeps]
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">         set portname [lindex $dep 0]
</span><span class="cx">         set portversion [lindex $dep 1]
</span><span class="cx">         set category [lindex $dep 2]
</span><del>-        
</del><ins>+
</ins><span class="cx">         set pkgpath ${basepath}/${category}/${portname}-${portversion}.pkg
</span><span class="cx">         if {[file readable $pkgpath]} {
</span><span class="cx">                 ui_msg &quot;installing binary: $pkgpath&quot;
</span><span class="lines">@@ -194,13 +194,12 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> # Standard procedures
</span><span class="cx"> 
</span><span class="cx"> proc fatal args {
</span><del>-    global argv0
-    puts stderr &quot;$argv0: $args&quot;
-    exit
</del><ins>+        global argv0
+        puts stderr &quot;$argv0: $args&quot;
+        exit
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Main
</span><span class="lines">@@ -209,8 +208,8 @@
</span><span class="cx"> #        set ui_options(ports_verbose) yes
</span><span class="cx"> 
</span><span class="cx"> if {[catch {mportinit ui_options options variations} result]} {
</span><del>-    puts &quot;Failed to initialize ports system, $result&quot;
-    exit 1
</del><ins>+        puts &quot;Failed to initialize ports system, $result&quot;
+        exit 1
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> package require Pextlib
</span><span class="lines">@@ -221,210 +220,208 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> foreach pname $argv {
</span><ins>+        if {[catch {set res [mportsearch &quot;^${pname}\$&quot;]} result]} {
+                puts &quot;port search failed: $result&quot;
+                exit 1
+        }
</ins><span class="cx"> 
</span><del>-if {[catch {set res [mportsearch &quot;^${pname}\$&quot;]} result]} {
-        puts &quot;port search failed: $result&quot;
-        exit 1
-}
</del><ins>+        set logpath &quot;/darwinports/logs&quot;
+        set logfd &quot;&quot;
</ins><span class="cx"> 
</span><del>-set logpath &quot;/darwinports/logs&quot;
-set logfd &quot;&quot;
</del><ins>+        foreach {name array} $res {
+                array unset portinfo
+                array set portinfo $array
</ins><span class="cx"> 
</span><del>-foreach {name array} $res {
-        array unset portinfo
-        array set portinfo $array
</del><ins>+                # Start with verbose output off;
+                # this will prevent the repopulation of /opt/local from getting logged.
+                set ui_options(ports_verbose) no
</ins><span class="cx"> 
</span><del>-        # Start with verbose output off;
-        # this will prevent the repopulation of /opt/local from getting logged.
-        set ui_options(ports_verbose) no
</del><ins>+                if {![info exists portinfo(porturl)]} {
+                        puts stderr &quot;Internal error: no porturl for $name&quot;
+                        continue
+                }
</ins><span class="cx"> 
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr &quot;Internal error: no porturl for $name&quot;
-                continue
-        }
-        
-        set pkgbase /darwinports/pkgs/
-        set porturl $portinfo(porturl)
</del><ins>+                set pkgbase /darwinports/pkgs/
+                set porturl $portinfo(porturl)
</ins><span class="cx"> 
</span><del>-        # Skip up-to-date packages
-        if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                if {[info exists portinfo(name)] &amp;&amp;
-                        [info exists portinfo(version)] &amp;&amp;
-                        [info exists portinfo(categories)]} {
-                        set portname $portinfo(name)
-                        set portversion $portinfo(version)
-                        set category [lindex $portinfo(categories) 0]
-                        set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
-                        if {[file readable $pkgfile] &amp;&amp; ([file mtime ${pkgfile}] &gt; [file mtime ${portpath}/Portfile])} {
-                                puts stderr &quot;Skipping ${portname}-${portversion}; package is up to date.&quot;
-                                continue
</del><ins>+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
+                        if {[info exists portinfo(name)] &amp;&amp;
+                                [info exists portinfo(version)] &amp;&amp;
+                                [info exists portinfo(categories)]} {
+                                set portname $portinfo(name)
+                                set portversion $portinfo(version)
+                                set category [lindex $portinfo(categories) 0]
+                                set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
+                                if {[file readable $pkgfile] &amp;&amp; ([file mtime ${pkgfile}] &gt; [file mtime ${portpath}/Portfile])} {
+                                        puts stderr &quot;Skipping ${portname}-${portversion}; package is up to date.&quot;
+                                        continue
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        }
-        
-        # Skipt packages which previously failed
-                
-        # Building the port:
-        # - remove /opt/local so it won't pollute the port.
-        # - re-install MacPorts.
-        # - keep distfiles outside /opt/local so we don't have to keep fetching them.
-        # - send out an email to the maintainer if any errors occurred.
</del><span class="cx"> 
</span><del>-        ui_msg &quot;removing /opt/local&quot;
-        #unset ui_options(ports_verbose)
-        if {[catch {system &quot;rm -Rf /opt/local&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;rm -Rf /etc/fonts&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;cd $env(HOME)/darwinports &amp;&amp; make &amp;&amp; make install&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;rmdir /opt/local/var/db/dports/distfiles&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        #set ui_options(ports_verbose) yes
</del><ins>+                # Skipt packages which previously failed
</ins><span class="cx"> 
</span><del>-        # If there was a log file left over from the previous pass,
-        # then the port failed with an error.  Send the log in an
-        # email to the maintainers.
-        if {$logfd ne &quot;&quot;} {
-                close $logfd
-                set logfd &quot;&quot;
-        }
-        #if {[file readable $logfilename]} {
-        #        if {[catch {system &quot;&lt;$logfilename /usr/sbin/sendmail -t&quot;} error]} {
-        #                puts stderr &quot;Internal error: $error&quot;
-        #        }
-        #}
</del><ins>+                # Building the port:
+                # - remove /opt/local so it won't pollute the port.
+                # - re-install MacPorts.
+                # - keep distfiles outside /opt/local so we don't have to keep fetching them.
+                # - send out an email to the maintainer if any errors occurred.
</ins><span class="cx"> 
</span><del>-        # Open the log file for writing
-        set logfd [open ${logpath}/${name}.log w]
</del><ins>+                ui_msg &quot;removing /opt/local&quot;
+                #unset ui_options(ports_verbose)
+                if {[catch {system &quot;rm -Rf /opt/local&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;rm -Rf /etc/fonts&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;cd $env(HOME)/darwinports &amp;&amp; make &amp;&amp; make install&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;rmdir /opt/local/var/db/dports/distfiles&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                #set ui_options(ports_verbose) yes
</ins><span class="cx"> 
</span><del>-        set valid 1
</del><ins>+                # If there was a log file left over from the previous pass,
+                # then the port failed with an error.  Send the log in an
+                # email to the maintainers.
+                if {$logfd ne &quot;&quot;} {
+                        close $logfd
+                        set logfd &quot;&quot;
+                }
+                #if {[file readable $logfilename]} {
+                #        if {[catch {system &quot;&lt;$logfilename /usr/sbin/sendmail -t&quot;} error]} {
+                #                puts stderr &quot;Internal error: $error&quot;
+                #        }
+                #}
</ins><span class="cx"> 
</span><del>-        set lint_errors {}
-        set portname &quot;&quot;
-        set portversion &quot;&quot;
-        set description &quot;&quot;
-        set category &quot;&quot;
</del><ins>+                # Open the log file for writing
+                set logfd [open ${logpath}/${name}.log w]
</ins><span class="cx"> 
</span><del>-        if {![info exists portinfo(name)]} {
-                lappend lint_errors &quot;missing name key&quot;
-                set valid 0
-        } else {
-                set portname $portinfo(name)
-        }
-        
-        if {![info exists portinfo(description)]} {
-                lappend lint_errors &quot;missing description key&quot;
-                set valid 0
-        } else {
-                set description $portinfo(description)
-        }
-        
-        if {![info exists portinfo(version)]} {
-                lappend lint_errors &quot;missing version key&quot;
-                set valid 0
-        } else {
-                set portversion $portinfo(version)
-        }
-        
-        if {![info exists portinfo(categories)]} {
-                lappend lint_errors &quot;missing categories key&quot;
-                set valid 0
-        } else {
-                set category [lindex $portinfo(categories) 0]
-        }
-        
-        if {![info exists portinfo(maintainers)]} {
-                append lint_errors &quot;missing maintainers key&quot;
-                set valid 0
-                set maintainers kevin@opendarwin.org
-        } else {
-                set maintainers $portinfo(maintainers)
-        }
-        
-        pkg_ui_log &quot;To: [join $maintainers {, }]&quot;
-        pkg_ui_log &quot;From: donotreply@opendarwin.org&quot;
-        pkg_ui_log &quot;Subject: MacPorts $portinfo(name)-$portinfo(version) build failure&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;The following is a transcript produced by the MacPorts automated build       &quot;
-        pkg_ui_log &quot;system.  You are receiving this email because you are listed as a maintainer    &quot;
-        pkg_ui_log &quot;of this port, which has failed the automated packaging process.  Please update  &quot;
-        pkg_ui_log &quot;the port as soon as possible.&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;Thank you,&quot;
-        pkg_ui_log &quot;The MacPorts Team&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;================================================================================&quot;
-        pkg_ui_log &quot;&quot;
</del><ins>+                set valid 1
</ins><span class="cx"> 
</span><del>-        if {!$valid} {
-                foreach error $lint_errors {
-                        ui_error $error
</del><ins>+                set lint_errors {}
+                set portname &quot;&quot;
+                set portversion &quot;&quot;
+                set description &quot;&quot;
+                set category &quot;&quot;
+
+                if {![info exists portinfo(name)]} {
+                        lappend lint_errors &quot;missing name key&quot;
+                        set valid 0
+                } else {
+                        set portname $portinfo(name)
</ins><span class="cx">                 }
</span><del>-        }
</del><span class="cx"> 
</span><del>-        ui_msg &quot;packaging ${category}/${portname}-${portversion}&quot;
</del><ins>+                if {![info exists portinfo(description)]} {
+                        lappend lint_errors &quot;missing description key&quot;
+                        set valid 0
+                } else {
+                        set description $portinfo(description)
+                }
</ins><span class="cx"> 
</span><del>-        # Install binary dependencies if we can, to speed things up.
-        #set depends {}
-        #if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
-        #if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
-        #if {[info exists portinfo(depends_build)]} { eval &quot;lappend depends $portinfo(depends_build)&quot; }
-        #foreach depspec $depends {
-        #        set dep [lindex [split $depspec :] end]
-                #install_binary_if_available $dep $pkgbase
-        #}
-        set dependencies [get_dependencies $portname 1]
-        set dependencies [lsort -unique $dependencies]
-        foreach dep $dependencies {
-                install_binary_if_available $dep $pkgbase
-        }
</del><ins>+                if {![info exists portinfo(version)]} {
+                        lappend lint_errors &quot;missing version key&quot;
+                        set valid 0
+                } else {
+                        set portversion $portinfo(version)
+                }
</ins><span class="cx"> 
</span><del>-        set options(package.type) pkg
-        set options(package.destpath) ${pkgbase}/${category}/
</del><ins>+                if {![info exists portinfo(categories)]} {
+                        lappend lint_errors &quot;missing categories key&quot;
+                        set valid 0
+                } else {
+                        set category [lindex $portinfo(categories) 0]
+                }
</ins><span class="cx"> 
</span><del>-        # Turn on verbose output for the build
-        set ui_options(ports_verbose) yes
-        set options(subport) $name
-        if {[catch {set workername [mportopen $porturl [array get options] [array get variations] yes]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-            ui_error &quot;Internal error: unable to open port: $result&quot;
-            continue
-        }        
-        if {[catch {set result [mportexec $workername pkg]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-            ui_error &quot;port package failed: $result&quot;
-                mportclose $workername
-            continue
-        }
-        set ui_options(ports_verbose) no
-        # Turn verbose output off after the build
</del><ins>+                if {![info exists portinfo(maintainers)]} {
+                        append lint_errors &quot;missing maintainers key&quot;
+                        set valid 0
+                        set maintainers kevin@opendarwin.org
+                } else {
+                        set maintainers $portinfo(maintainers)
+                }
</ins><span class="cx"> 
</span><del>-        mportclose $workername
</del><ins>+                pkg_ui_log &quot;To: [join $maintainers {, }]&quot;
+                pkg_ui_log &quot;From: donotreply@opendarwin.org&quot;
+                pkg_ui_log &quot;Subject: MacPorts $portinfo(name)-$portinfo(version) build failure&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;The following is a transcript produced by the MacPorts automated build                 &quot;
+                pkg_ui_log &quot;system.  You are receiving this email because you are listed as a maintainer        &quot;
+                pkg_ui_log &quot;of this port, which has failed the automated packaging process.  Please update        &quot;
+                pkg_ui_log &quot;the port as soon as possible.&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;Thank you,&quot;
+                pkg_ui_log &quot;The MacPorts Team&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;================================================================================&quot;
+                pkg_ui_log &quot;&quot;
</ins><span class="cx"> 
</span><del>-        # We made it to the end.  We can delete the log file.
-        close $logfd
-        set logfd &quot;&quot;
-        file delete ${logpath}/${name}.log
-}
</del><ins>+                if {!$valid} {
+                        foreach error $lint_errors {
+                                ui_error $error
+                        }
+                }
</ins><span class="cx"> 
</span><ins>+                ui_msg &quot;packaging ${category}/${portname}-${portversion}&quot;
+
+                # Install binary dependencies if we can, to speed things up.
+                #set depends {}
+                #if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
+                #if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
+                #if {[info exists portinfo(depends_build)]} { eval &quot;lappend depends $portinfo(depends_build)&quot; }
+                #foreach depspec $depends {
+                #        set dep [lindex [split $depspec :] end]
+                        #install_binary_if_available $dep $pkgbase
+                #}
+                set dependencies [get_dependencies $portname 1]
+                set dependencies [lsort -unique $dependencies]
+                foreach dep $dependencies {
+                        install_binary_if_available $dep $pkgbase
+                }
+
+                set options(package.type) pkg
+                set options(package.destpath) ${pkgbase}/${category}/
+
+                # Turn on verbose output for the build
+                set ui_options(ports_verbose) yes
+                set options(subport) $name
+                if {[catch {set workername [mportopen $porturl [array get options] [array get variations] yes]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug &quot;$errorInfo&quot;
+                        ui_error &quot;Internal error: unable to open port: $result&quot;
+                        continue
+                }
+                if {[catch {set result [mportexec $workername pkg]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug &quot;$errorInfo&quot;
+                        ui_error &quot;port package failed: $result&quot;
+                        mportclose $workername
+                        continue
+                }
+                set ui_options(ports_verbose) no
+                # Turn verbose output off after the build
+
+                mportclose $workername
+
+                # We made it to the end.  We can delete the log file.
+                close $logfd
+                set logfd &quot;&quot;
+                file delete ${logpath}/${name}.log
+        }
</ins><span class="cx"> }
</span><span class="cx"> # end foreach pname
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingrpmalltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/rpmall.tcl (116517 => 116518)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/rpmall.tcl        2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/rpmall.tcl        2014-01-27 15:39:11 UTC (rev 116518)
</span><span class="lines">@@ -12,14 +12,14 @@
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="cx"> # are met:
</span><span class="cx"> # 1. Redistributions of source code must retain the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer.
</del><ins>+#         notice, this list of conditions and the following disclaimer.
</ins><span class="cx"> # 2. Redistributions in binary form must reproduce the above copyright
</span><del>-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
</del><ins>+#         notice, this list of conditions and the following disclaimer in the
+#         documentation and/or other materials provided with the distribution.
</ins><span class="cx"> # 3. Neither the name of Apple Inc. nor the names of its contributors
</span><del>-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
</del><ins>+#         may be used to endorse or promote products derived from this software
+#         without specific prior written permission.
+#
</ins><span class="cx"> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
</span><span class="cx"> # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
</span><span class="cx"> # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
</span><span class="lines">@@ -45,84 +45,84 @@
</span><span class="cx"> 
</span><span class="cx"> # ui_options accessor
</span><span class="cx"> proc ui_isset {val} {
</span><del>-    global ui_options
-    if {[info exists ui_options($val)]} {
-        if {$ui_options($val) eq &quot;yes&quot;} {
-            return 1
</del><ins>+        global ui_options
+        if {[info exists ui_options($val)]} {
+                if {$ui_options($val) eq &quot;yes&quot;} {
+                        return 1
+                }
</ins><span class="cx">         }
</span><del>-    }
-    return 0
</del><ins>+        return 0
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> set options(package.destpath) &quot;/darwinports/rpms&quot;
</span><span class="cx"> 
</span><del>-# UI Callback 
</del><ins>+# UI Callback
</ins><span class="cx"> 
</span><span class="cx"> proc ui_prefix {priority} {
</span><del>-    switch $priority {
-        debug {
-                return &quot;DEBUG: &quot;
-        }
-        error {
-                return &quot;Error: &quot;
-        }
-        warn {
-                return &quot;Warning: &quot;
-        }
-        default {
-                return &quot;&quot;
-        }
-    }
</del><ins>+        switch $priority {
+                debug {
+                        return &quot;DEBUG: &quot;
+                }
+                error {
+                        return &quot;Error: &quot;
+                }
+                warn {
+                        return &quot;Warning: &quot;
+                }
+                default {
+                        return &quot;&quot;
+                }
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc ui_channels {priority} {
</span><del>-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-                    return {stdout}
-            } else {
-                    return {}
-            }
-        }
-        info {
</del><ins>+        global logfd
+        switch $priority {
+                debug {
+                        if {[ui_isset ports_debug]} {
+                                return {stdout}
+                        } else {
+                                return {}
+                        }
+                }
+                info {
</ins><span class="cx">                         # put verbose stuff only to the log file
</span><del>-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
</del><ins>+                        if {[ui_isset ports_verbose]} {
+                                return {$logfd}
+                        } else {
+                                return {}
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
</del><ins>+                msg {
+                        if {[ui_isset ports_quiet]} {
+                                return {}
</ins><span class="cx">                         } else {
</span><span class="cx">                                 return {stdout}
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        default {
-                return {stdout}
-        }
-    }
</del><ins>+                default {
+                        return {stdout}
+                }
+        }
</ins><span class="cx"> }
</span><del>-        
</del><ins>+
</ins><span class="cx"> proc pkg_ui_log {message} {
</span><del>-    global logfd
-    if {$logfd ne &quot;&quot;} {
-        log_message $logfd $message
-    }
</del><ins>+        global logfd
+        if {$logfd ne &quot;&quot;} {
+                log_message $logfd $message
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc log_message {channel message} {
</span><del>-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
</del><ins>+        seek $channel 0 end
+        puts $channel $message
+        flush $channel
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Recursive bottom-up approach of building a list of dependencies.
</span><span class="cx"> proc get_dependencies {portname includeBuildDeps} {
</span><span class="cx">         set result {}
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[catch {set search [mportsearch &quot;^$portname\$&quot;]} error]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;$errorInfo&quot;
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">         foreach {name array} $search {
</span><span class="cx">                 array set portinfo $array
</span><span class="cx">                 if {![info exists portinfo(name)] ||
</span><del>-                        ![info exists portinfo(version)] || 
</del><ins>+                        ![info exists portinfo(version)] ||
</ins><span class="cx">                         ![info exists portinfo(categories)]} {
</span><span class="cx">                         ui_error &quot;Internal error: $name missing some portinfo keys&quot;
</span><span class="cx">                         continue
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">                 if {![info exists portinfo(revision)]} {
</span><span class="cx">                         set portinfo(revision) 0
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set portname $portinfo(name)
</span><span class="cx">                 set portversion $portinfo(version)
</span><span class="cx">                 set revision $portinfo(revision)
</span><span class="lines">@@ -152,13 +152,13 @@
</span><span class="cx">                 set depends {}
</span><span class="cx">                 if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_build)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_build)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_fetch)&quot;
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_extract)]} { 
</del><ins>+                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval &quot;lappend depends $portinfo(depends_extract)&quot;
</span><span class="cx">                 }
</span><span class="cx">                 foreach depspec $depends {
</span><span class="lines">@@ -202,9 +202,9 @@
</span><span class="cx"> # Standard procedures
</span><span class="cx"> 
</span><span class="cx"> proc fatal args {
</span><del>-    global argv0
-    puts stderr &quot;$argv0: $args&quot;
-    exit
</del><ins>+        global argv0
+        puts stderr &quot;$argv0: $args&quot;
+        exit
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # Main
</span><span class="lines">@@ -217,8 +217,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if {[catch {mportinit ui_options options variations} result]} {
</span><del>-    puts &quot;Failed to initialize ports system, $result&quot;
-    exit 1
</del><ins>+        puts &quot;Failed to initialize ports system, $result&quot;
+        exit 1
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> package require Pextlib
</span><span class="lines">@@ -229,275 +229,274 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> foreach pname $argv {
</span><ins>+        if {[catch {set allpackages [mportsearch &quot;^${pname}\$&quot;]} result]} {
+                puts &quot;port search failed: $result&quot;
+                exit 1
+        }
</ins><span class="cx"> 
</span><del>-if {[catch {set allpackages [mportsearch &quot;^${pname}\$&quot;]} result]} {
-        puts &quot;port search failed: $result&quot;
-        exit 1
-}
</del><ins>+        set logpath &quot;/darwinports/logs&quot;
+        set logfd &quot;&quot;
</ins><span class="cx"> 
</span><del>-set logpath &quot;/darwinports/logs&quot;
-set logfd &quot;&quot;
</del><ins>+        foreach {name array} $allpackages {
+                array unset portinfo
+                array set portinfo $array
</ins><span class="cx"> 
</span><del>-foreach {name array} $allpackages {
-        array unset portinfo
-        array set portinfo $array
</del><ins>+                #ui_msg &quot;foo $portinfo(porturl)&quot;
</ins><span class="cx"> 
</span><del>-        #ui_msg &quot;foo $portinfo(porturl)&quot;
</del><ins>+                # Start with verbose output off;
+                # this will prevent the repopulation of /opt/local from getting logged.
+                set ui_options(ports_verbose) no
</ins><span class="cx"> 
</span><del>-        # Start with verbose output off;
-        # this will prevent the repopulation of /opt/local from getting logged.
-        set ui_options(ports_verbose) no
</del><ins>+                if {![info exists portinfo(porturl)]} {
+                        puts stderr &quot;Internal error: no porturl for $name&quot;
+                        continue
+                }
+                if {![info exists portinfo(revision)]} {
+                        set portinfo(revision) 0
+                }
</ins><span class="cx"> 
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr &quot;Internal error: no porturl for $name&quot;
-                continue
-        }
-        if {![info exists portinfo(revision)]} {
-                set portinfo(revision) 0
-        }
</del><ins>+                set porturl $portinfo(porturl)
</ins><span class="cx"> 
</span><del>-        set porturl $portinfo(porturl)
</del><ins>+                # this is used to short-circuit the RPM check and
+                # move on to the next package
</ins><span class="cx"> 
</span><del>-        # this is used to short-circuit the RPM check and
-        # move on to the next package
</del><ins>+                global exit_loop
+                set exit_loop false
</ins><span class="cx"> 
</span><del>-        global exit_loop
-        set exit_loop false
</del><ins>+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
+                        if {[info exists portinfo(name)] &amp;&amp;
+                                [info exists portinfo(version)] &amp;&amp;
+                                [info exists portinfo(revision)]} {
+                                set portname $portinfo(name)
+                                set portversion $portinfo(version)
+                                set revision $portinfo(revision)
</ins><span class="cx"> 
</span><del>-        # Skip up-to-date packages
-        if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                if {[info exists portinfo(name)] &amp;&amp;
-                        [info exists portinfo(version)] &amp;&amp;
-                        [info exists portinfo(revision)]} {
-                        set portname $portinfo(name)
-                        set portversion $portinfo(version)
-                        set revision $portinfo(revision)
-
-                        foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
-                                foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
-                                        set rpmpath &quot;${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm&quot;
-                                        #ui_msg &quot;trying ${rpmpath}&quot;
-                                        if {[file readable $rpmpath] &amp;&amp; ([file mtime ${rpmpath}] &gt;= [file mtime ${portpath}/Portfile])} {
-                                                puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package is up to date.&quot;
-                                                set exit_loop true
</del><ins>+                                foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
+                                        foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
+                                                set rpmpath &quot;${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm&quot;
+                                                #ui_msg &quot;trying ${rpmpath}&quot;
+                                                if {[file readable $rpmpath] &amp;&amp; ([file mtime ${rpmpath}] &gt;= [file mtime ${portpath}/Portfile])} {
+                                                        puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package is up to date.&quot;
+                                                        set exit_loop true
+                                                        break
+                                                }
+                                        }
+                                        if {${exit_loop}} {
</ins><span class="cx">                                                 break
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                if {${exit_loop}} {
-                                        break
</del><ins>+                        }
+                }
+                if {${exit_loop}} {
+                        continue
+                }
+
+                # Skip packages which previously failed
+                set exit_loop false
+
+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
+                        if {[info exists portinfo(name)] &amp;&amp;
+                                [info exists portinfo(version)] &amp;&amp;
+                                [info exists portinfo(revision)]} {
+                                set portname $portinfo(name)
+                                set portversion $portinfo(version)
+                                set revision $portinfo(revision)
+
+                                set logfilepath &quot;${logpath}/${portname}.log&quot;
+                                if {[file readable ${logfilepath}] &amp;&amp; ([file mtime ${logfilepath}] &gt; [file mtime ${portpath}/Portfile])} {
+                                        puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package failed, but has not changed.&quot;
+                                        set exit_loop true
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        }
-        if {${exit_loop}} {
-                continue
-        }
-        
-        # Skip packages which previously failed
-        set exit_loop false
-                
-        # Skip up-to-date packages
-        if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                if {[info exists portinfo(name)] &amp;&amp;
-                        [info exists portinfo(version)] &amp;&amp;
-                        [info exists portinfo(revision)]} {
-                        set portname $portinfo(name)
-                        set portversion $portinfo(version)
-                        set revision $portinfo(revision)
</del><ins>+                if {${exit_loop}} {
+                        continue
+                }
</ins><span class="cx"> 
</span><del>-                        set logfilepath &quot;${logpath}/${portname}.log&quot;
-                        if {[file readable ${logfilepath}] &amp;&amp; ([file mtime ${logfilepath}] &gt; [file mtime ${portpath}/Portfile])} {
-                                puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package failed, but has not changed.&quot;
-                                set exit_loop true
</del><ins>+                # Building the port:
+                # - remove /opt/local so it won't pollute the port.
+                # - re-install MacPorts.
+                # - keep distfiles outside /opt/local so we don't have to keep fetching them.
+                # - send out an email to the maintainer if any errors occurred.
+
+                set remove_files &quot;&quot;
+                foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
+                        foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
+                                set remove_files &quot;${remove_files} '${dir}/${arch}/'*.rpm&quot;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-        }
-        if {${exit_loop}} {
-                continue
-        }
-        
-        # Building the port:
-        # - remove /opt/local so it won't pollute the port.
-        # - re-install MacPorts.
-        # - keep distfiles outside /opt/local so we don't have to keep fetching them.
-        # - send out an email to the maintainer if any errors occurred.
</del><ins>+                system &quot;rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true&quot;
</ins><span class="cx"> 
</span><del>-        set remove_files &quot;&quot;
-        foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
-                foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
-                        set remove_files &quot;${remove_files} '${dir}/${arch}/'*.rpm&quot;
</del><ins>+                ui_msg &quot;-&gt;          Removing /opt/local&quot;
+                #unset ui_options(ports_verbose)
+                if {[catch {system &quot;rm -Rf /opt/local&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
</ins><span class="cx">                 }
</span><del>-        }
-        system &quot;rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true&quot;
</del><ins>+                # this is bad on pure darwin  :)
+                #if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
+                #        puts stderr &quot;Internal error: $error&quot;
+                #}
+                #if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
+                #        puts stderr &quot;Internal error: $error&quot;
+                #}
+                #if {[catch {system &quot;rm -Rf /etc/fonts&quot;} error]} {
+                #        puts stderr &quot;Internal error: $error&quot;
+                #}
+                ui_msg &quot;-&gt;          Installing MacPorts&quot;
+                if {[catch {system &quot;cd $env(HOME)/darwinports &amp;&amp; make &amp;&amp; make install&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;rmdir /opt/local/var/db/dports/distfiles&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                if {[catch {system &quot;ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles&quot;} error]} {
+                        puts stderr &quot;Internal error: $error&quot;
+                }
+                #set ui_options(ports_verbose) yes
</ins><span class="cx"> 
</span><del>-        ui_msg &quot;-&gt;    Removing /opt/local&quot;
-        #unset ui_options(ports_verbose)
-        if {[catch {system &quot;rm -Rf /opt/local&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        # this is bad on pure darwin  :)
-        #if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
-        #        puts stderr &quot;Internal error: $error&quot;
-        #}
-        #if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
-        #        puts stderr &quot;Internal error: $error&quot;
-        #}
-        #if {[catch {system &quot;rm -Rf /etc/fonts&quot;} error]} {
-        #        puts stderr &quot;Internal error: $error&quot;
-        #}
-        ui_msg &quot;-&gt;    Installing MacPorts&quot;
-        if {[catch {system &quot;cd $env(HOME)/darwinports &amp;&amp; make &amp;&amp; make install&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;rmdir /opt/local/var/db/dports/distfiles&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        if {[catch {system &quot;ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles&quot;} error]} {
-                puts stderr &quot;Internal error: $error&quot;
-        }
-        #set ui_options(ports_verbose) yes
</del><ins>+                # If there was a log file left over from the previous pass,
+                # then the port failed with an error.  Send the log in an
+                # email to the maintainers.
+                if {$logfd ne &quot;&quot;} {
+                        close $logfd
+                        set logfd &quot;&quot;
+                }
+                #if {[file readable $logfilename]} {
+                #        if {[catch {system &quot;&lt;$logfilename /usr/sbin/sendmail -t&quot;} error]} {
+                #                puts stderr &quot;Internal error: $error&quot;
+                #        }
+                #}
</ins><span class="cx"> 
</span><del>-        # If there was a log file left over from the previous pass,
-        # then the port failed with an error.  Send the log in an
-        # email to the maintainers.
-        if {$logfd ne &quot;&quot;} {
-                close $logfd
-                set logfd &quot;&quot;
-        }
-        #if {[file readable $logfilename]} {
-        #        if {[catch {system &quot;&lt;$logfilename /usr/sbin/sendmail -t&quot;} error]} {
-        #                puts stderr &quot;Internal error: $error&quot;
-        #        }
-        #}
</del><ins>+                # Open the log file for writing
+                set logfd [open ${logpath}/${name}.log w]
</ins><span class="cx"> 
</span><del>-        # Open the log file for writing
-        set logfd [open ${logpath}/${name}.log w]
</del><ins>+                set valid 1
</ins><span class="cx"> 
</span><del>-        set valid 1
</del><ins>+                set lint_errors {}
+                set portname &quot;&quot;
+                set portversion &quot;&quot;
+                set description &quot;&quot;
+                set category &quot;&quot;
</ins><span class="cx"> 
</span><del>-        set lint_errors {}
-        set portname &quot;&quot;
-        set portversion &quot;&quot;
-        set description &quot;&quot;
-        set category &quot;&quot;
</del><ins>+                if {![info exists portinfo(name)]} {
+                        lappend lint_errors &quot;missing name key&quot;
+                        set valid 0
+                } else {
+                        set portname $portinfo(name)
+                }
</ins><span class="cx"> 
</span><del>-        if {![info exists portinfo(name)]} {
-                lappend lint_errors &quot;missing name key&quot;
-                set valid 0
-        } else {
-                set portname $portinfo(name)
-        }
-        
-        if {![info exists portinfo(description)]} {
-                lappend lint_errors &quot;missing description key&quot;
-                set valid 0
-        } else {
-                set description $portinfo(description)
-        }
-        
-        if {![info exists portinfo(version)]} {
-                lappend lint_errors &quot;missing version key&quot;
-                set valid 0
-        } else {
-                set portversion $portinfo(version)
-        }
-        
-        if {![info exists portinfo(categories)]} {
-                lappend lint_errors &quot;missing categories key&quot;
-                set valid 0
-        } else {
-                set category [lindex $portinfo(categories) 0]
-        }
-        
-        if {![info exists portinfo(maintainers)]} {
-                append lint_errors &quot;missing maintainers key&quot;
-                set valid 0
-                set maintainers kevin@opendarwin.org
-        } else {
-                set maintainers $portinfo(maintainers)
-        }
-        
-        pkg_ui_log &quot;To: [join $maintainers {, }]&quot;
-        pkg_ui_log &quot;From: donotreply@opendarwin.org&quot;
-        pkg_ui_log &quot;Subject: MacPorts $portinfo(name)-$portinfo(version) build failure&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;The following is a transcript produced by the MacPorts automated build       &quot;
-        pkg_ui_log &quot;system.  You are receiving this email because you are listed as a maintainer    &quot;
-        pkg_ui_log &quot;of this port, which has failed the automated packaging process.  Please update  &quot;
-        pkg_ui_log &quot;the port as soon as possible.&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;Thank you,&quot;
-        pkg_ui_log &quot;The MacPorts Team&quot;
-        pkg_ui_log &quot;&quot;
-        pkg_ui_log &quot;================================================================================&quot;
-        pkg_ui_log &quot;&quot;
</del><ins>+                if {![info exists portinfo(description)]} {
+                        lappend lint_errors &quot;missing description key&quot;
+                        set valid 0
+                } else {
+                        set description $portinfo(description)
+                }
</ins><span class="cx"> 
</span><del>-        if {!$valid} {
-                foreach error $lint_errors {
-                        ui_error $error
</del><ins>+                if {![info exists portinfo(version)]} {
+                        lappend lint_errors &quot;missing version key&quot;
+                        set valid 0
+                } else {
+                        set portversion $portinfo(version)
</ins><span class="cx">                 }
</span><del>-        }
</del><span class="cx"> 
</span><del>-        ui_msg &quot;--&gt;   Packaging ${category}/${portname}-${portversion}&quot;
</del><ins>+                if {![info exists portinfo(categories)]} {
+                        lappend lint_errors &quot;missing categories key&quot;
+                        set valid 0
+                } else {
+                        set category [lindex $portinfo(categories) 0]
+                }
</ins><span class="cx"> 
</span><del>-        foreach prebuild {&quot;ccache&quot; &quot;rpm&quot; &quot;unzip&quot;} {
-                if {![file exists /bin/${prebuild}] &amp;&amp; ![file exists /usr/bin/${prebuild}]} {
-                        ui_msg &quot;---&gt;  Pre-installing ${prebuild}&quot;
-                        if {[catch {set search [mportsearch &quot;^${prebuild}\$&quot;]} error]} {
-                                global errorInfo
-                                ui_debug &quot;$errorInfo&quot;
-                                ui_error &quot;Internal error: port search ${prebuild} failed: $error&quot;
</del><ins>+                if {![info exists portinfo(maintainers)]} {
+                        append lint_errors &quot;missing maintainers key&quot;
+                        set valid 0
+                        set maintainers kevin@opendarwin.org
+                } else {
+                        set maintainers $portinfo(maintainers)
+                }
+
+                pkg_ui_log &quot;To: [join $maintainers {, }]&quot;
+                pkg_ui_log &quot;From: donotreply@opendarwin.org&quot;
+                pkg_ui_log &quot;Subject: MacPorts $portinfo(name)-$portinfo(version) build failure&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;The following is a transcript produced by the MacPorts automated build                 &quot;
+                pkg_ui_log &quot;system.  You are receiving this email because you are listed as a maintainer        &quot;
+                pkg_ui_log &quot;of this port, which has failed the automated packaging process.  Please update        &quot;
+                pkg_ui_log &quot;the port as soon as possible.&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;Thank you,&quot;
+                pkg_ui_log &quot;The MacPorts Team&quot;
+                pkg_ui_log &quot;&quot;
+                pkg_ui_log &quot;================================================================================&quot;
+                pkg_ui_log &quot;&quot;
+
+                if {!$valid} {
+                        foreach error $lint_errors {
+                                ui_error $error
</ins><span class="cx">                         }
</span><del>-                        array set prebuildinfo [lindex $search 1]
-                        set ui_options(ports_verbose) yes
-                        set options(subport) ${prebuild}
-                        if {[catch {set workername [mportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
-                                $result == 1} {
-                                global errorInfo
-                                ui_debug &quot;$errorInfo&quot;
-                                ui_error &quot;Internal error: unable to install ${prebuild}... exiting&quot;
-                                exit 1
</del><ins>+                }
+
+                ui_msg &quot;--&gt;   Packaging ${category}/${portname}-${portversion}&quot;
+
+                foreach prebuild {&quot;ccache&quot; &quot;rpm&quot; &quot;unzip&quot;} {
+                        if {![file exists /bin/${prebuild}] &amp;&amp; ![file exists /usr/bin/${prebuild}]} {
+                                ui_msg &quot;---&gt;  Pre-installing ${prebuild}&quot;
+                                if {[catch {set search [mportsearch &quot;^${prebuild}\$&quot;]} error]} {
+                                        global errorInfo
+                                        ui_debug &quot;$errorInfo&quot;
+                                        ui_error &quot;Internal error: port search ${prebuild} failed: $error&quot;
+                                }
+                                array set prebuildinfo [lindex $search 1]
+                                set ui_options(ports_verbose) yes
+                                set options(subport) ${prebuild}
+                                if {[catch {set workername [mportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
+                                        $result == 1} {
+                                        global errorInfo
+                                        ui_debug &quot;$errorInfo&quot;
+                                        ui_error &quot;Internal error: unable to install ${prebuild}... exiting&quot;
+                                        exit 1
+                                }
+                                if {[catch {set result [mportexec $workername activate]} result] ||
+                                        $result == 1} {
+                                        global errorInfo
+                                        ui_debug &quot;$errorInfo&quot;
+                                        ui_error &quot;installation of ${prebuild} failed: $result&quot;
+                                        mportclose $workername
+                                        exit 1
+                                }
</ins><span class="cx">                         }
</span><del>-                        if {[catch {set result [mportexec $workername activate]} result] ||
-                                $result == 1} {
-                                global errorInfo
-                                ui_debug &quot;$errorInfo&quot;
-                                ui_error &quot;installation of ${prebuild} failed: $result&quot;
-                                mportclose $workername
-                                exit 1
-                        }
</del><span class="cx">                 }
</span><del>-        }
</del><span class="cx"> 
</span><del>-        # Turn on verbose output for the build
-        set ui_options(ports_verbose) yes
-        set options(subport) $name
-        if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-            ui_error &quot;Internal error: unable to open port: $result&quot;
-            continue
-        }
-        if {[catch {set result [mportexec $workername rpmpackage]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-            ui_error &quot;port package failed: $result&quot;
</del><ins>+                # Turn on verbose output for the build
+                set ui_options(ports_verbose) yes
+                set options(subport) $name
+                if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug &quot;$errorInfo&quot;
+                        ui_error &quot;Internal error: unable to open port: $result&quot;
+                        continue
+                }
+                if {[catch {set result [mportexec $workername rpmpackage]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug &quot;$errorInfo&quot;
+                        ui_error &quot;port package failed: $result&quot;
+                        mportclose $workername
+                        continue
+                }
+                set ui_options(ports_verbose) no
+                # Turn verbose output off after the build
+
</ins><span class="cx">                 mportclose $workername
</span><del>-            continue
</del><ins>+
+                # We made it to the end.  We can delete the log file.
+                close $logfd
+                set logfd &quot;&quot;
+                file delete ${logpath}/${name}.log
</ins><span class="cx">         }
</span><del>-        set ui_options(ports_verbose) no
-        # Turn verbose output off after the build
</del><span class="cx"> 
</span><del>-        mportclose $workername
-
-        # We made it to the end.  We can delete the log file.
-        close $logfd
-        set logfd &quot;&quot;
-        file delete ${logpath}/${name}.log
</del><span class="cx"> }
</span><del>-
-}
</del><span class="cx"> # end foreach pname
</span></span></pre>
</div>
</div>

</body>
</html>