<!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 "AS IS"
</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 "Debug: "
- }
- error {
-         return "Error: "
- }
- warn {
-         return "Warning: "
- }
- default {
-         return ""
- }
- }
</del><ins>+        switch $priority {
+                debug {
+                        return "Debug: "
+                }
+                error {
+                        return "Error: "
+                }
+                warn {
+                        return "Warning: "
+                }
+                default {
+                        return ""
+                }
+        }
</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 "$result."
</span><span class="cx">                 puts "Have you initialized the build system? Use the -i flag:"
</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 "Internal error: $name missing some portinfo keys"
</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)] && ${anyplatform_flag} != "true"} {
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 ui_silent "Package build for $portinfo(name) succeeded"
</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 ""
</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 "$errorInfo"
</span><span class="lines">@@ -718,8 +718,8 @@
</span><span class="cx">                 }
</span><span class="cx">                 ui_msg "Done."
</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 "Fatal error: $result."
</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 "Internal error: $name missing some portinfo keys"
</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 "lappend depends $portinfo(depends_run)" }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
</span><del>-                if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} {
</del><ins>+                if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_build)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} {
</del><ins>+                if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_fetch)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} {
</del><ins>+                if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_extract)"
</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 "AS IS"
</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 == "XFree86"} { return {} }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[catch {set res [mportsearch "^$portname\$"]} error]} {
</span><span class="cx">                 puts stderr "Internal error: port search failed: $error"
</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 "lappend depends $portinfo(depends_run)" }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
</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 "lappend dependencies $result"
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 set pkgname "${portname}-${portversion}.pkg"
</span><span class="cx">                 lappend dependencies $pkgname
</span><span class="cx">                 set pkgpath "${basepath}/${category}/${pkgname}"
</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 ""} {
-        set long_description $description
- }
</del><ins>+        set fd [open ${filename} w+]
+        if {$long_description eq ""} {
+                set long_description $description
+        }
</ins><span class="cx">
</span><span class="cx"> puts $fd "
</span><span class="cx"> <html lang=\"en\">
</span><span class="lines">@@ -137,15 +137,15 @@
</span><span class="cx"> <font face=\"Helvetica\">${long_description}</font>
</span><span class="cx"> <p>"
</span><span class="cx">
</span><del>- if {$homepage ne ""} {
-        puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
- }
</del><ins>+        if {$homepage ne ""} {
+                puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
+        }
</ins><span class="cx">
</span><del>- puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
</del><ins>+        puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>"
</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 "."]
</span><del>-        
</del><ins>+
</ins><span class="cx">         if {[string index $destination end] ne "/"} {
</span><span class="cx">                 append destination /
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         set depxml ""
</span><span class="cx">         foreach dep $dependencies {
</span><span class="cx">                 append depxml "<dict>
</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 "$argv0: $args"
- exit
</del><ins>+        global argv0
+        puts stderr "$argv0: $args"
+        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 "Failed to initialize ports system, $result"
- exit 1
</del><ins>+        puts "Failed to initialize ports system, $result"
+        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 ".*"
</del><ins>+        lappend argv ".*"
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> foreach pname $argv {
</span><ins>+        if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
+                puts "port search failed: $result"
+                exit 1
+        }
</ins><span class="cx">
</span><del>-if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
-        puts "port search failed: $result"
-        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 "Internal error: no porturl for $name"
+                        continue
+                }
</ins><span class="cx">
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr "Internal error: no porturl for $name"
-                continue
-        }
-        
-        set pkgbase "/darwinports/pkgs/"
-        set mpkgbase "/darwinports/mpkgs/"
-        set porturl $portinfo(porturl)
-        set prefix "/opt/local"
</del><ins>+                set pkgbase "/darwinports/pkgs/"
+                set mpkgbase "/darwinports/mpkgs/"
+                set porturl $portinfo(porturl)
+                set prefix "/opt/local"
</ins><span class="cx">
</span><del>-        # Skip up-to-date packages
-        if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-                if {[info exists portinfo(name)] &&
-                        [info exists portinfo(version)] &&
-                        [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] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
-                                puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
-                                continue
</del><ins>+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+                        if {[info exists portinfo(name)] &&
+                                [info exists portinfo(version)] &&
+                                [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] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
+                                        puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
+                                        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 ""
-        set portversion ""
-        set description ""
-        set long_description ""
-        set homepage ""
-        set category ""
</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 "meta-packaging ${category}/${portname}-${portversion}"
</del><ins>+                # Building the mpkg:
+                # - create an mpkg skeleton
+                # - copy dependent pkgs into Contents/Resources directory
</ins><span class="cx">
</span><del>-        set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
</del><ins>+                set portname ""
+                set portversion ""
+                set description ""
+                set long_description ""
+                set homepage ""
+                set category ""
</ins><span class="cx">
</span><del>-        if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        
-        # 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 "${mpkgpath}/Contents/Resources/"]
-        if {$result == -1} {
-                puts stderr "aborting; one or more dependencies was missing."
-                if {[catch {system "rm -R ${mpkgpath}"} 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 "meta-packaging ${category}/${portname}-${portversion}"
+
+                set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
+
+                if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
</ins><span class="cx">                         puts stderr "Internal error: $error"
</span><span class="cx">                 }
</span><del>-                continue
-        } else {
-                set result [lsort -uniq $result]
-                eval "lappend dependencies $result"
-        }
-        
-        #
-        # 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 ""
-        } 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 "${mpkgpath}/Contents/Resources/"]
+                if {$result == -1} {
+                        puts stderr "aborting; one or more dependencies was missing."
+                        if {[catch {system "rm -R ${mpkgpath}"} error]} {
+                                puts stderr "Internal error: $error"
+                        }
+                        continue
+                } else {
+                        set result [lsort -uniq $result]
+                        eval "lappend dependencies $result"
+                }
+
+                #
+                # 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 ""
+                        } 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 "AS IS"
</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 "yes"} {
-         return 1
</del><ins>+        global ui_options
+        if {[info exists ui_options($val)]} {
+                if {$ui_options($val) eq "yes"} {
+                        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 "DEBUG: "
- }
- error {
-         return "Error: "
- }
- warn {
-         return "Warning: "
- }
- default {
-         return ""
- }
- }
</del><ins>+        switch $priority {
+                debug {
+                        return "DEBUG: "
+                }
+                error {
+                        return "Error: "
+                }
+                warn {
+                        return "Warning: "
+                }
+                default {
+                        return ""
+                }
+        }
</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 ""} {
-        log_message $logfd $message
- }
</del><ins>+        global logfd
+        if {$logfd ne ""} {
+                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 "^$portname\$"]} error]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug "$errorInfo"
</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 "Internal error: $name missing some portinfo keys"
</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 "lappend depends $portinfo(depends_run)" }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_build)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_fetch)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_extract)"
</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 "installing binary: $pkgpath"
</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 "$argv0: $args"
- exit
</del><ins>+        global argv0
+        puts stderr "$argv0: $args"
+        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 "Failed to initialize ports system, $result"
- exit 1
</del><ins>+        puts "Failed to initialize ports system, $result"
+        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 "^${pname}\$"]} result]} {
+                puts "port search failed: $result"
+                exit 1
+        }
</ins><span class="cx">
</span><del>-if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
-        puts "port search failed: $result"
-        exit 1
-}
</del><ins>+        set logpath "/darwinports/logs"
+        set logfd ""
</ins><span class="cx">
</span><del>-set logpath "/darwinports/logs"
-set logfd ""
</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 "Internal error: no porturl for $name"
+                        continue
+                }
</ins><span class="cx">
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr "Internal error: no porturl for $name"
-                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) "" portpath]} {
-                if {[info exists portinfo(name)] &&
-                        [info exists portinfo(version)] &&
-                        [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] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-                                puts stderr "Skipping ${portname}-${portversion}; package is up to date."
-                                continue
</del><ins>+                # Skip up-to-date packages
+                if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+                        if {[info exists portinfo(name)] &&
+                                [info exists portinfo(version)] &&
+                                [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] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
+                                        puts stderr "Skipping ${portname}-${portversion}; package is up to date."
+                                        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 "removing /opt/local"
-        #unset ui_options(ports_verbose)
-        if {[catch {system "rm -Rf /opt/local"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "rm -Rf /etc/X11"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "rm -Rf /etc/fonts"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        #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 ""} {
-                close $logfd
-                set logfd ""
-        }
-        #if {[file readable $logfilename]} {
-        #        if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
-        #                puts stderr "Internal error: $error"
-        #        }
-        #}
</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 "removing /opt/local"
+                #unset ui_options(ports_verbose)
+                if {[catch {system "rm -Rf /opt/local"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "rm -Rf /etc/X11"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "rm -Rf /etc/fonts"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                #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 ""} {
+                        close $logfd
+                        set logfd ""
+                }
+                #if {[file readable $logfilename]} {
+                #        if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
+                #                puts stderr "Internal error: $error"
+                #        }
+                #}
</ins><span class="cx">
</span><del>-        set lint_errors {}
-        set portname ""
-        set portversion ""
-        set description ""
-        set category ""
</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 "missing name key"
-                set valid 0
-        } else {
-                set portname $portinfo(name)
-        }
-        
-        if {![info exists portinfo(description)]} {
-                lappend lint_errors "missing description key"
-                set valid 0
-        } else {
-                set description $portinfo(description)
-        }
-        
-        if {![info exists portinfo(version)]} {
-                lappend lint_errors "missing version key"
-                set valid 0
-        } else {
-                set portversion $portinfo(version)
-        }
-        
-        if {![info exists portinfo(categories)]} {
-                lappend lint_errors "missing categories key"
-                set valid 0
-        } else {
-                set category [lindex $portinfo(categories) 0]
-        }
-        
-        if {![info exists portinfo(maintainers)]} {
-                append lint_errors "missing maintainers key"
-                set valid 0
-                set maintainers kevin@opendarwin.org
-        } else {
-                set maintainers $portinfo(maintainers)
-        }
-        
-        pkg_ui_log "To: [join $maintainers {, }]"
-        pkg_ui_log "From: donotreply@opendarwin.org"
-        pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
-        pkg_ui_log ""
-        pkg_ui_log "The following is a transcript produced by the MacPorts automated build "
-        pkg_ui_log "system. You are receiving this email because you are listed as a maintainer "
-        pkg_ui_log "of this port, which has failed the automated packaging process. Please update "
-        pkg_ui_log "the port as soon as possible."
-        pkg_ui_log ""
-        pkg_ui_log ""
-        pkg_ui_log "Thank you,"
-        pkg_ui_log "The MacPorts Team"
-        pkg_ui_log ""
-        pkg_ui_log "================================================================================"
-        pkg_ui_log ""
</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 ""
+                set portversion ""
+                set description ""
+                set category ""
+
+                if {![info exists portinfo(name)]} {
+                        lappend lint_errors "missing name key"
+                        set valid 0
+                } else {
+                        set portname $portinfo(name)
</ins><span class="cx">                 }
</span><del>-        }
</del><span class="cx">
</span><del>-        ui_msg "packaging ${category}/${portname}-${portversion}"
</del><ins>+                if {![info exists portinfo(description)]} {
+                        lappend lint_errors "missing description key"
+                        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 "lappend depends $portinfo(depends_run)" }
-        #if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-        #if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-        #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 "missing version key"
+                        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 "missing categories key"
+                        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 "$errorInfo"
-         ui_error "Internal error: unable to open port: $result"
-         continue
-        }        
-        if {[catch {set result [mportexec $workername pkg]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug "$errorInfo"
-         ui_error "port package failed: $result"
-                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 "missing maintainers key"
+                        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 "To: [join $maintainers {, }]"
+                pkg_ui_log "From: donotreply@opendarwin.org"
+                pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
+                pkg_ui_log ""
+                pkg_ui_log "The following is a transcript produced by the MacPorts automated build                 "
+                pkg_ui_log "system. You are receiving this email because you are listed as a maintainer        "
+                pkg_ui_log "of this port, which has failed the automated packaging process. Please update        "
+                pkg_ui_log "the port as soon as possible."
+                pkg_ui_log ""
+                pkg_ui_log ""
+                pkg_ui_log "Thank you,"
+                pkg_ui_log "The MacPorts Team"
+                pkg_ui_log ""
+                pkg_ui_log "================================================================================"
+                pkg_ui_log ""
</ins><span class="cx">
</span><del>-        # We made it to the end. We can delete the log file.
-        close $logfd
-        set logfd ""
-        file delete ${logpath}/${name}.log
-}
</del><ins>+                if {!$valid} {
+                        foreach error $lint_errors {
+                                ui_error $error
+                        }
+                }
</ins><span class="cx">
</span><ins>+                ui_msg "packaging ${category}/${portname}-${portversion}"
+
+                # Install binary dependencies if we can, to speed things up.
+                #set depends {}
+                #if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+                #if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+                #if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
+                #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 "$errorInfo"
+                        ui_error "Internal error: unable to open port: $result"
+                        continue
+                }
+                if {[catch {set result [mportexec $workername pkg]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug "$errorInfo"
+                        ui_error "port package failed: $result"
+                        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 ""
+                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 "AS IS"
</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 "yes"} {
-         return 1
</del><ins>+        global ui_options
+        if {[info exists ui_options($val)]} {
+                if {$ui_options($val) eq "yes"} {
+                        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) "/darwinports/rpms"
</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 "DEBUG: "
- }
- error {
-         return "Error: "
- }
- warn {
-         return "Warning: "
- }
- default {
-         return ""
- }
- }
</del><ins>+        switch $priority {
+                debug {
+                        return "DEBUG: "
+                }
+                error {
+                        return "Error: "
+                }
+                warn {
+                        return "Warning: "
+                }
+                default {
+                        return ""
+                }
+        }
</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 ""} {
-        log_message $logfd $message
- }
</del><ins>+        global logfd
+        if {$logfd ne ""} {
+                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 "^$portname\$"]} error]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug "$errorInfo"
</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 "Internal error: $name missing some portinfo keys"
</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 "lappend depends $portinfo(depends_run)" }
</span><span class="cx">                 if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_build)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_fetch)"
</span><span class="cx">                 }
</span><del>-                if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
</del><ins>+                if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
</ins><span class="cx">                         eval "lappend depends $portinfo(depends_extract)"
</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 "$argv0: $args"
- exit
</del><ins>+        global argv0
+        puts stderr "$argv0: $args"
+        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 "Failed to initialize ports system, $result"
- exit 1
</del><ins>+        puts "Failed to initialize ports system, $result"
+        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 "^${pname}\$"]} result]} {
+                puts "port search failed: $result"
+                exit 1
+        }
</ins><span class="cx">
</span><del>-if {[catch {set allpackages [mportsearch "^${pname}\$"]} result]} {
-        puts "port search failed: $result"
-        exit 1
-}
</del><ins>+        set logpath "/darwinports/logs"
+        set logfd ""
</ins><span class="cx">
</span><del>-set logpath "/darwinports/logs"
-set logfd ""
</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 "foo $portinfo(porturl)"
</ins><span class="cx">
</span><del>-        #ui_msg "foo $portinfo(porturl)"
</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 "Internal error: no porturl for $name"
+                        continue
+                }
+                if {![info exists portinfo(revision)]} {
+                        set portinfo(revision) 0
+                }
</ins><span class="cx">
</span><del>-        if {![info exists portinfo(porturl)]} {
-                puts stderr "Internal error: no porturl for $name"
-                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) "" portpath]} {
+                        if {[info exists portinfo(name)] &&
+                                [info exists portinfo(version)] &&
+                                [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) "" portpath]} {
-                if {[info exists portinfo(name)] &&
-                        [info exists portinfo(version)] &&
-                        [info exists portinfo(revision)]} {
-                        set portname $portinfo(name)
-                        set portversion $portinfo(version)
-                        set revision $portinfo(revision)
-
-                        foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-                                foreach arch {"ppc" "i386" "fat"} {
-                                        set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-                                        #ui_msg "trying ${rpmpath}"
-                                        if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
-                                                puts stderr "-> skipping ${portname}-${portversion}; package is up to date."
-                                                set exit_loop true
</del><ins>+                                foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+                                        foreach arch {"ppc" "i386" "fat"} {
+                                                set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
+                                                #ui_msg "trying ${rpmpath}"
+                                                if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
+                                                        puts stderr "-> skipping ${portname}-${portversion}; package is up to date."
+                                                        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) "" portpath]} {
+                        if {[info exists portinfo(name)] &&
+                                [info exists portinfo(version)] &&
+                                [info exists portinfo(revision)]} {
+                                set portname $portinfo(name)
+                                set portversion $portinfo(version)
+                                set revision $portinfo(revision)
+
+                                set logfilepath "${logpath}/${portname}.log"
+                                if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
+                                        puts stderr "-> skipping ${portname}-${portversion}; package failed, but has not changed."
+                                        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) "" portpath]} {
-                if {[info exists portinfo(name)] &&
-                        [info exists portinfo(version)] &&
-                        [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 "${logpath}/${portname}.log"
-                        if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
-                                puts stderr "-> skipping ${portname}-${portversion}; package failed, but has not changed."
-                                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 ""
+                foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+                        foreach arch {"ppc" "i386" "fat"} {
+                                set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
</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 "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
</ins><span class="cx">
</span><del>-        set remove_files ""
-        foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-                foreach arch {"ppc" "i386" "fat"} {
-                        set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
</del><ins>+                ui_msg "->         Removing /opt/local"
+                #unset ui_options(ports_verbose)
+                if {[catch {system "rm -Rf /opt/local"} error]} {
+                        puts stderr "Internal error: $error"
</ins><span class="cx">                 }
</span><del>-        }
-        system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
</del><ins>+                # this is bad on pure darwin :)
+                #if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+                #        puts stderr "Internal error: $error"
+                #}
+                #if {[catch {system "rm -Rf /etc/X11"} error]} {
+                #        puts stderr "Internal error: $error"
+                #}
+                #if {[catch {system "rm -Rf /etc/fonts"} error]} {
+                #        puts stderr "Internal error: $error"
+                #}
+                ui_msg "->         Installing MacPorts"
+                if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+                        puts stderr "Internal error: $error"
+                }
+                #set ui_options(ports_verbose) yes
</ins><span class="cx">
</span><del>-        ui_msg "-> Removing /opt/local"
-        #unset ui_options(ports_verbose)
-        if {[catch {system "rm -Rf /opt/local"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        # this is bad on pure darwin :)
-        #if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-        #        puts stderr "Internal error: $error"
-        #}
-        #if {[catch {system "rm -Rf /etc/X11"} error]} {
-        #        puts stderr "Internal error: $error"
-        #}
-        #if {[catch {system "rm -Rf /etc/fonts"} error]} {
-        #        puts stderr "Internal error: $error"
-        #}
-        ui_msg "-> Installing MacPorts"
-        if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-                puts stderr "Internal error: $error"
-        }
-        #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 ""} {
+                        close $logfd
+                        set logfd ""
+                }
+                #if {[file readable $logfilename]} {
+                #        if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
+                #                puts stderr "Internal error: $error"
+                #        }
+                #}
</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 ""} {
-                close $logfd
-                set logfd ""
-        }
-        #if {[file readable $logfilename]} {
-        #        if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
-        #                puts stderr "Internal error: $error"
-        #        }
-        #}
</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 ""
+                set portversion ""
+                set description ""
+                set category ""
</ins><span class="cx">
</span><del>-        set lint_errors {}
-        set portname ""
-        set portversion ""
-        set description ""
-        set category ""
</del><ins>+                if {![info exists portinfo(name)]} {
+                        lappend lint_errors "missing name key"
+                        set valid 0
+                } else {
+                        set portname $portinfo(name)
+                }
</ins><span class="cx">
</span><del>-        if {![info exists portinfo(name)]} {
-                lappend lint_errors "missing name key"
-                set valid 0
-        } else {
-                set portname $portinfo(name)
-        }
-        
-        if {![info exists portinfo(description)]} {
-                lappend lint_errors "missing description key"
-                set valid 0
-        } else {
-                set description $portinfo(description)
-        }
-        
-        if {![info exists portinfo(version)]} {
-                lappend lint_errors "missing version key"
-                set valid 0
-        } else {
-                set portversion $portinfo(version)
-        }
-        
-        if {![info exists portinfo(categories)]} {
-                lappend lint_errors "missing categories key"
-                set valid 0
-        } else {
-                set category [lindex $portinfo(categories) 0]
-        }
-        
-        if {![info exists portinfo(maintainers)]} {
-                append lint_errors "missing maintainers key"
-                set valid 0
-                set maintainers kevin@opendarwin.org
-        } else {
-                set maintainers $portinfo(maintainers)
-        }
-        
-        pkg_ui_log "To: [join $maintainers {, }]"
-        pkg_ui_log "From: donotreply@opendarwin.org"
-        pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
-        pkg_ui_log ""
-        pkg_ui_log "The following is a transcript produced by the MacPorts automated build "
-        pkg_ui_log "system. You are receiving this email because you are listed as a maintainer "
-        pkg_ui_log "of this port, which has failed the automated packaging process. Please update "
-        pkg_ui_log "the port as soon as possible."
-        pkg_ui_log ""
-        pkg_ui_log ""
-        pkg_ui_log "Thank you,"
-        pkg_ui_log "The MacPorts Team"
-        pkg_ui_log ""
-        pkg_ui_log "================================================================================"
-        pkg_ui_log ""
</del><ins>+                if {![info exists portinfo(description)]} {
+                        lappend lint_errors "missing description key"
+                        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 "missing version key"
+                        set valid 0
+                } else {
+                        set portversion $portinfo(version)
</ins><span class="cx">                 }
</span><del>-        }
</del><span class="cx">
</span><del>-        ui_msg "--> Packaging ${category}/${portname}-${portversion}"
</del><ins>+                if {![info exists portinfo(categories)]} {
+                        lappend lint_errors "missing categories key"
+                        set valid 0
+                } else {
+                        set category [lindex $portinfo(categories) 0]
+                }
</ins><span class="cx">
</span><del>-        foreach prebuild {"ccache" "rpm" "unzip"} {
-                if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
-                        ui_msg "---> Pre-installing ${prebuild}"
-                        if {[catch {set search [mportsearch "^${prebuild}\$"]} error]} {
-                                global errorInfo
-                                ui_debug "$errorInfo"
-                                ui_error "Internal error: port search ${prebuild} failed: $error"
</del><ins>+                if {![info exists portinfo(maintainers)]} {
+                        append lint_errors "missing maintainers key"
+                        set valid 0
+                        set maintainers kevin@opendarwin.org
+                } else {
+                        set maintainers $portinfo(maintainers)
+                }
+
+                pkg_ui_log "To: [join $maintainers {, }]"
+                pkg_ui_log "From: donotreply@opendarwin.org"
+                pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
+                pkg_ui_log ""
+                pkg_ui_log "The following is a transcript produced by the MacPorts automated build                 "
+                pkg_ui_log "system. You are receiving this email because you are listed as a maintainer        "
+                pkg_ui_log "of this port, which has failed the automated packaging process. Please update        "
+                pkg_ui_log "the port as soon as possible."
+                pkg_ui_log ""
+                pkg_ui_log ""
+                pkg_ui_log "Thank you,"
+                pkg_ui_log "The MacPorts Team"
+                pkg_ui_log ""
+                pkg_ui_log "================================================================================"
+                pkg_ui_log ""
+
+                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 "$errorInfo"
-                                ui_error "Internal error: unable to install ${prebuild}... exiting"
-                                exit 1
</del><ins>+                }
+
+                ui_msg "--> Packaging ${category}/${portname}-${portversion}"
+
+                foreach prebuild {"ccache" "rpm" "unzip"} {
+                        if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
+                                ui_msg "---> Pre-installing ${prebuild}"
+                                if {[catch {set search [mportsearch "^${prebuild}\$"]} error]} {
+                                        global errorInfo
+                                        ui_debug "$errorInfo"
+                                        ui_error "Internal error: port search ${prebuild} failed: $error"
+                                }
+                                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 "$errorInfo"
+                                        ui_error "Internal error: unable to install ${prebuild}... exiting"
+                                        exit 1
+                                }
+                                if {[catch {set result [mportexec $workername activate]} result] ||
+                                        $result == 1} {
+                                        global errorInfo
+                                        ui_debug "$errorInfo"
+                                        ui_error "installation of ${prebuild} failed: $result"
+                                        mportclose $workername
+                                        exit 1
+                                }
</ins><span class="cx">                         }
</span><del>-                        if {[catch {set result [mportexec $workername activate]} result] ||
-                                $result == 1} {
-                                global errorInfo
-                                ui_debug "$errorInfo"
-                                ui_error "installation of ${prebuild} failed: $result"
-                                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 "$errorInfo"
-         ui_error "Internal error: unable to open port: $result"
-         continue
-        }
-        if {[catch {set result [mportexec $workername rpmpackage]} result] ||
-                $result == 1} {
-                global errorInfo
-                ui_debug "$errorInfo"
-         ui_error "port package failed: $result"
</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 "$errorInfo"
+                        ui_error "Internal error: unable to open port: $result"
+                        continue
+                }
+                if {[catch {set result [mportexec $workername rpmpackage]} result] ||
+                        $result == 1} {
+                        global errorInfo
+                        ui_debug "$errorInfo"
+                        ui_error "port package failed: $result"
+                        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 ""
+                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 ""
-        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>