<!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>[123004] trunk/base</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/123004">123004</a></dd>
<dt>Author</dt> <dd>afb@macports.org</dd>
<dt>Date</dt> <dd>2014-08-03 11:55:09 -0700 (Sun, 03 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>base: remove package support for rpm and deb</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasedocport1">trunk/base/doc/port.1</a></li>
<li><a href="#trunkbasedocport1txt">trunk/base/doc/port.1.txt</a></li>
<li><a href="#trunkbasedocprefixmtreein">trunk/base/doc/prefix.mtree.in</a></li>
<li><a href="#trunkbaseportmgrpackagingSETUPchrootsh">trunk/base/portmgr/packaging/SETUP.chroot.sh</a></li>
<li><a href="#trunkbaseportmgrpackagingbuildallsh">trunk/base/portmgr/packaging/buildall.sh</a></li>
<li><a href="#trunkbasesrcmacports10macportstcl">trunk/base/src/macports1.0/macports.tcl</a></li>
<li><a href="#trunkbasesrcpackage10Makefilein">trunk/base/src/package1.0/Makefile.in</a></li>
<li><a href="#trunkbasesrcpackage10packagetcl">trunk/base/src/package1.0/package.tcl</a></li>
<li><a href="#trunkbasesrcportporttcl">trunk/base/src/port/port.tcl</a></li>
<li><a href="#trunkbasesrcport10portsandboxtcl">trunk/base/src/port1.0/portsandbox.tcl</a></li>
<li><a href="#trunkbasesrcport10portutiltcl">trunk/base/src/port1.0/portutil.tcl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkbaseportmgrpackagingdpkgalltcl">trunk/base/portmgr/packaging/dpkgall.tcl</a></li>
<li><a href="#trunkbaseportmgrpackagingrpmalltcl">trunk/base/portmgr/packaging/rpmall.tcl</a></li>
<li><a href="#trunkbasesrcpackage10portdpkgtcl">trunk/base/src/package1.0/portdpkg.tcl</a></li>
<li><a href="#trunkbasesrcpackage10portrpmtcl">trunk/base/src/package1.0/portrpm.tcl</a></li>
<li><a href="#trunkbasesrcpackage10portsrpmtcl">trunk/base/src/package1.0/portsrpm.tcl</a></li>
<li><a href="#trunkbasesrcpackage10testsportdpkgtest">trunk/base/src/package1.0/tests/portdpkg.test</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbasedocport1"></a>
<div class="modfile"><h4>Modified: trunk/base/doc/port.1 (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/doc/port.1        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/doc/port.1        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1243,24 +1243,6 @@
</span><span class="cx"> \fIportname\fR
</span><span class="cx"> and its dependencies\&amp;.
</span><span class="cx"> .RE
</span><del>-.PP
-rpm
-.RS 4
-Creates an RPM binary package of
-\fIportname\fR, similar to a tgz \(lqarchive\(rq\&amp;.
-.RE
-.PP
-srpm
-.RS 4
-Creates a SRPM source package of
-\fIportname\fR, similar to a xar \(lqportpkg\(rq\&amp;.
-.RE
-.PP
-dpkg
-.RS 4
-Creates a DEB binary package of
-\fIportname\fR\&amp;.
-.RE
</del><span class="cx"> .SH &quot;EXAMPLES&quot;
</span><span class="cx"> .sp
</span><span class="cx"> The following demonstrates invoking port with the extract target on portdir \(lqtextproc/figlet\(rq and extract\&amp;.suffix set to \(lq\&amp;.tgz\(rq:
</span></span></pre></div>
<a id="trunkbasedocport1txt"></a>
<div class="modfile"><h4>Modified: trunk/base/doc/port.1.txt (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/doc/port.1.txt        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/doc/port.1.txt        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -638,16 +638,7 @@
</span><span class="cx">     Creates an internet-enabled disk image containing an OS X metapackage of
</span><span class="cx">     'portname' and its dependencies.
</span><span class="cx"> 
</span><del>-rpm::
-    Creates an RPM binary package of 'portname', similar to a tgz ``archive''.
</del><span class="cx"> 
</span><del>-srpm::
-    Creates a SRPM source package of 'portname', similar to a xar ``portpkg''.
-
-dpkg::
-    Creates a DEB binary package of 'portname'.
-
-
</del><span class="cx"> EXAMPLES
</span><span class="cx"> --------
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbasedocprefixmtreein"></a>
<div class="modfile"><h4>Modified: trunk/base/doc/prefix.mtree.in (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/doc/prefix.mtree.in        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/doc/prefix.mtree.in        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -237,8 +237,6 @@
</span><span class="cx">         skel
</span><span class="cx">         ..
</span><span class="cx">     ..
</span><del>-    src
-    ..
</del><span class="cx">     var
</span><span class="cx">     ..
</span><span class="cx">     www
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingSETUPchrootsh"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/SETUP.chroot.sh (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/SETUP.chroot.sh        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/portmgr/packaging/SETUP.chroot.sh        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> mkdir -p /darwinports/logs
</span><span class="cx"> mkdir -p /darwinports/pkgs
</span><span class="cx"> mkdir -p /darwinports/mpkgs
</span><del>-mkdir -p /darwinports/rpms
</del><span class="cx"> 
</span><span class="cx"> cd $HOME/darwinports
</span><span class="cx"> #tclsh base/src/portmgr/packageall.tcl
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingbuildallsh"></a>
<div class="modfile"><h4>Modified: trunk/base/portmgr/packaging/buildall.sh (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/buildall.sh        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/portmgr/packaging/buildall.sh        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -97,9 +97,6 @@
</span><span class="cx"> echo &quot;file:///darwinports/dports&quot; &gt; /opt/local/etc/ports/sources.conf
</span><span class="cx"> echo &quot;BatchMode yes&quot; &gt;&gt; /etc/ssh_config
</span><span class="cx"> EOF
</span><del>-        if [ &quot;$PKGTYPE&quot; = &quot;dpkg&quot; ]; then
-            echo &quot;/opt/local/bin/port install dpkg&quot; &gt;&gt; $dir/bootstrap.sh
-        fi
</del><span class="cx">         chmod 755 $dir/bootstrap.sh
</span><span class="cx">         echo &quot;Bootstrapping darwinports in chroot&quot;
</span><span class="cx">         /sbin/mount_devfs devfs ${dir}/dev
</span><span class="lines">@@ -137,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx"> # main:  This is where we start the show.
</span><span class="cx"> TGTPORTS=&quot;&quot;
</span><del>-PKGTYPE=rpmpackage
</del><ins>+PKGTYPE=mpkg
</ins><span class="cx"> 
</span><span class="cx"> if [ $# -lt 1 ]; then
</span><span class="cx">         echo &quot;Usage: $0 chrootdir [-p pkgtype] [targetportsfile]&quot;
</span><span class="lines">@@ -207,10 +204,6 @@
</span><span class="cx">                 echo $pkg &gt;&gt; outputdir/summary/portspackaged
</span><span class="cx">                 if [ &quot;$PKGTYPE&quot; = &quot;mpkg&quot; ]; then
</span><span class="cx">                     mv $DIR/Package/*.mpkg outputdir/Packages/
</span><del>-                elif [ &quot;$PKGTYPE&quot; = &quot;rpmpackage&quot; ]; then
-                    mv $DIR/Package/RPMS/${ARCH}/*.rpm outputdir/Packages/
-                elif [ &quot;$PKGTYPE&quot; = &quot;dpkg&quot; ]; then
-                    mv $DIR/Package/*.deb outputdir/Packages/
</del><span class="cx">                 fi
</span><span class="cx">                 type=&quot;succeeded&quot;
</span><span class="cx">         fi
</span></span></pre></div>
<a id="trunkbaseportmgrpackagingdpkgalltcl"></a>
<div class="delfile"><h4>Deleted: trunk/base/portmgr/packaging/dpkgall.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/dpkgall.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/portmgr/packaging/dpkgall.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,943 +0,0 @@
</span><del>-#!/usr/bin/env tclsh8.4
-# dpkgbuild.tcl
-# $Id$
-#
-# Copyright (c) 2009-2011 The MacPorts Project
-# Copyright (c) 2004 Landon Fuller &lt;landonf@macports.org&gt;
-# Copyright (c) 2003 Kevin Van Vechten &lt;kevin@opendarwin.org&gt;
-# Copyright (c) 2002 Apple Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#         notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#         notice, this list of conditions and the following disclaimer in the
-#         documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Inc. nor the names of its contributors
-#         may be used to endorse or promote products derived from this software
-#         without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-#######################################
-#
-# Must be installed outside of dports tree:
-#        tcl 8.4
-#        curl
-#        tar
-#        gzip
-#        unzip
-#        dports tree
-#
-# A tar file containing full /${portprefix} directory tree, stored in:
-#        $pkgrepo/$architecture/root.tar.gz
-# The /${portprefix} directory tree must contain:
-#        MacPorts installation
-#        dpkg
-#
-# Configuration:
-#        /etc/ports/dpkg.conf
-#        /etc/ports/dpkg
-#
-#######################################
-
-package require darwinports
-
-# Configuration Namespace
-namespace eval dpkg {
-        variable configopts &quot;pkgrepo architecture portlistfile portprefix dportsrc silentmode initialports&quot;
-
-        # Preferences
-        variable silentmode false
-        variable configfile &quot;/etc/ports/dpkg.conf&quot;
-        variable portlist &quot;&quot;
-        variable portprefix &quot;/usr/dports&quot;
-        variable dportsrc &quot;/usr/darwinports&quot;
-        variable pkgrepo &quot;/export/dpkg/&quot;
-        # architecture is set in main
-        variable architecture
-        variable initialports &quot;dpkg apt&quot;
-        variable aptpackagedir
-        variable packagedir
-        # portlistfile defaults to ${pkgrepo}/${architecture}/etc/buildlist.txt (set in main)
-        variable portlistfile
-        # baselistfile defaults to ${pkgrepo}/${architecture}/etc/baselist.txt (set in main)
-        variable baselistfile
-
-        # Non-user modifiable.
-        # Ports required for building. Format:
-        # &lt;binary&gt; &lt;portname&gt; &lt;binary&gt; &lt;portname&gt; ...
-        variable requiredports &quot;dpkg dpkg apt-get apt&quot;
-
-        # Current log file descriptor
-        variable logfd
-}
-
-# MacPorts UI Event Callbacks
-proc ui_prefix {priority} {
-        switch $priority {
-                debug {
-                        return &quot;Debug: &quot;
-                }
-                error {
-                        return &quot;Error: &quot;
-                }
-                warn {
-                        return &quot;Warning: &quot;
-                }
-                default {
-                        return &quot;&quot;
-                }
-        }
-}
-
-proc ui_channels {priority} {
-        global dpkg::logfd
-        if {[info exists logfd] &amp;&amp; $logfd ne &quot;&quot;} {
-                return {$logfd}
-        } elseif {$message(priority) ne &quot;debug&quot;} {
-                # If there's no log file, echo to stdout
-                return {stdout}
-        }
-}
-
-proc ui_silent {message} {
-        global dpkg::silentmode
-        if {&quot;${silentmode}&quot; != true} {
-                puts $message
-                ui_msg $message
-        } else {
-                ui_msg $message
-        }
-}
-
-# Outputs message to console and to log
-# Should only be used with errors
-proc ui_noisy_error {message} {
-        puts $message
-        ui_error $message
-}
-
-proc log_message {channel message} {
-        seek $channel 0 end
-        puts $channel $message
-        flush $channel
-}
-
-# Read in configuration file
-proc readConfig {file} {
-        global dpkg::configopts
-
-        set fd [open $file r]
-        while {[gets $fd line] &gt;= 0} {
-                foreach option $configopts {
-                        if {[regexp &quot;^$option\[ \t\]+(\[A-Za-z0-9_:,\./-\]+$)&quot; $line match val] == 1} {
-                                set dpkg::$option $val
-                        }
-                }
-        }
-}
-
-# Read a list of newline seperated port names from $file
-proc readPortList {file} {
-        set fd [open $file r]
-        set portlist &quot;&quot;
-
-        while {[gets $fd line] &gt;= 0} {
-                lappend portlist $line
-        }
-
-        return $portlist
-}
-
-# Escape all regex characters in a portname
-proc regex_escape_portname {portname} {
-        regsub -all &quot;(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}&quot; $portname &quot;\\\\&amp;&quot; escaped_string
-        return $escaped_string
-}
-
-# Print usage string
-proc print_usage {args} {
-        global argv0
-        puts &quot;Usage: [file tail $argv0] \[-qa\] \[-f configfile\] \[-p portlist\]&quot;
-        puts &quot;        -q        Quiet mode (only errors reported)&quot;
-        puts &quot;        -w        No warnings (progress still reported)&quot;
-        puts &quot;        -a        Build all ports&quot;
-        puts &quot;        -b        Re-generate base install archive&quot;
-        puts &quot;        -p        Attempt to build ports that do not advertise support for the build platform&quot;
-        puts &quot;        -i        Initialize Build System (Should only be run on a new build system)&quot;
-}
-
-# Delete and restore the build system
-proc reset_tree {args} {
-        global dpkg::portprefix dpkg::pkgrepo dpkg::architecture
-
-        ui_silent &quot;Restoring pristine ${portprefix} from ${pkgrepo}/${architecture}/root.tar.gz&quot;
-        if {[catch {system &quot;rm -Rf ${portprefix}&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        if {[catch {system &quot;cd / &amp;&amp; tar xvf ${pkgrepo}/${architecture}/root.tar.gz&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        ui_silent &quot;Linking static distfiles directory to ${portprefix}/var/db/dports/distfiles.&quot;
-        if {[file isdirectory ${portprefix}/var/db/dports/distfiles&quot;]} {
-                if {[catch {system &quot;rm -rf ${portprefix}/var/db/dports/distfiles&quot;} error]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: $error&quot;
-                        exit 1
-                }
-
-                if {[catch {system &quot;ln -s ${pkgrepo}/distfiles ${portprefix}/var/db/dports/distfiles&quot;} error]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: $error&quot;
-                        exit 1
-                }
-        }
-}
-
-proc main {argc argv} {
-        global dpkg::configfile dpkg::pkgrepo dpkg::architecture dpkg::portlistfile
-        global dpkg::portsArray dpkg::portprefix dpkg::silentmode dpkg::logfd dpkg::packagedir dpkg::aptpackagedir
-        global dpkg::requiredports dpkg::baselistfile tcl_platform
-
-        # First time through, we reset the tree
-        set firstrun_flag true
-
-        # Read command line options
-        set buildall_flag false
-        set anyplatform_flag false
-        set nowarn_flag false
-        set basegen_flag false
-        set initialize_flag false
-
-        for {set i 0} {$i &lt; $argc} {incr i} {
-                set arg [lindex $argv $i]
-                switch -- $arg {
-                        -a {
-                                set buildall_flag true
-                        }
-                        -b {
-                                set basegen_flag true
-                        }
-                        -f {
-                                incr i
-                                set configfile [lindex $argv $i]
-
-                                if {![file readable $configfile]} {
-                                        return -code error &quot;Configuration file \&quot;$configfile\&quot; is unreadable.&quot;
-                                }
-                        }
-                        -i {
-                                set initialize_flag true
-                        }
-                        -p {
-                                incr i
-                                set portlistfile [lindex $argv $i]
-                                if {![file readable $portlistfile]} {
-                                        return -code error &quot;Port list file \&quot;$portlistfile\&quot; is unreadable.&quot;
-                                }
-                        }
-                        -q {
-                                set silentmode true
-                        }
-                        -w {
-                                set nowarn_flag true
-                        }
-                        -p {
-                                set anyplatform_flag true
-                        }
-                        default {
-                                print_usage
-                                exit 1
-                        }
-                }
-        }
-
-        # Initialize System
-        array set ui_options {}
-        array set options {}
-        array set variations {}
-        mportinit ui_options options variations
-
-        # If -i was specified, install base system and exit
-        if {$initialize_flag == &quot;true&quot;} {
-                initialize_system
-                exit 0
-        }
-
-        # We must have dpkg by now
-        if {[catch {set_architecture} result]} {
-                puts &quot;$result.&quot;
-                puts &quot;Have you initialized the build system? Use the -i flag:&quot;
-                print_usage
-                exit 1
-        }
-
-        # Set the platform
-        set platformString [string tolower $tcl_platform(os)]
-
-        set packagedir ${pkgrepo}/${architecture}/packages/
-        set aptpackagedir ${pkgrepo}/apt/dists/stable/main/binary-${architecture}/
-
-        # Read configuration files
-        if {[file readable $configfile]} {
-                readConfig $configfile
-        }
-
-        # If portlistfile has not been set, supply a reasonable default
-        if {![info exists portlistfile]} {
-                # The default portlist file
-                set portlistfile [file join $pkgrepo $architecture etc buildlist.txt]
-        }
-
-        # If baselistfile has not been set, supply a reasonable default
-        if {![info exists baselistfile]} {
-                # The default baselist file
-                set baselistfile [file join $pkgrepo $architecture etc baselist.txt]
-        }
-
-        # Read the port list
-        if {[file readable $portlistfile]} {
-                set portlist [readPortList $portlistfile]
-        } else {
-                set portlist &quot;&quot;
-        }
-
-        if {[file readable $baselistfile]} {
-                set baselist [readPortList $baselistfile]
-        } else {
-                set baselist &quot;&quot;
-        }
-
-        # If no portlist file was specified, create a portlist that includes all ports
-        if {[llength $portlist] == 0 || &quot;$buildall_flag&quot; == &quot;true&quot;} {
-                set res [mportlistall]
-                foreach {name array} $res {
-                        lappend portlist $name
-                }
-        } else {
-                # Port list was specified. Ensure that all the specified ports are available.
-                # Add ${baselist} and get_required_ports to the list
-                set portlist [lsort -unique [concat $portlist $baselist [get_required_ports]]]
-                foreach port $portlist {
-                        set fail false
-
-                        if {[catch {set res [get_portinfo $port]} result]} {
-                                global errorInfo
-                                ui_debug &quot;$errorInfo&quot;
-                                ui_noisy_error &quot;Error: $result&quot;
-                                set fail true
-                        }
-
-                        # Add all of the specified ports' dependencies to the portlist
-                        set dependencies [get_dependencies $port false]
-                        foreach dep $dependencies {
-                                lappend portlist [lindex $dep 0]
-                        }
-                }
-                if {&quot;$fail&quot; == &quot;true&quot;} {
-                        exit 1
-                }
-        }
-
-        # Clean out duplicates
-        set portlist [lsort -unique $portlist]
-
-        # Ensure that the log directory exists, and open up
-        # the default debug log
-        open_default_log w
-
-        # Set the dport options
-        # Package build path
-        set options(package.destpath) ${packagedir}
-
-        # Ensure that it exists
-        file mkdir $options(package.destpath)
-
-        # Force mode
-        set options(ports_force) yes
-
-        # Set variations (empty)
-        set variations [list]
-
-
-        if {&quot;$silentmode&quot; != &quot;true&quot; &amp;&amp; &quot;$nowarn_flag&quot; != &quot;true&quot;} {
-                puts &quot;WARNING: The full contents of ${portprefix}, /usr/X11R6, and /etc/X11 will be deleted by this script. If you do not want this, control-C NOW.&quot;
-                exec sleep 10
-        }
-
-        # Destroy the existing apt repository
-        if {[catch {system &quot;rm -Rf ${aptpackagedir}&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        # Recreate
-        file mkdir ${aptpackagedir}
-
-        close_default_log
-
-        foreach port $portlist {
-                # Open the default debug log write/append
-                open_default_log
-
-                if {[catch {set res [get_portinfo $port]} error]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: port search failed: $error&quot;
-                        exit 1
-                }
-
-                # Reset array from previous runs
-                unset -nocomplain portinfo
-                array set portinfo [lindex $res 1]
-
-                if {![info exists portinfo(name)] ||
-                        ![info exists portinfo(version)] ||
-                        ![info exists portinfo(revision)] ||
-                        ![info exists portinfo(categories)]} {
-                        ui_noisy_error &quot;Internal error: $name missing some portinfo keys&quot;
-                        close $logfd
-                        continue
-                }
-
-                # open correct subport
-                set options(subport) $portinfo(name)
-
-                # Skip un-supported ports
-                if {[info exists portinfo(platforms)] &amp;&amp; ${anyplatform_flag} != &quot;true&quot;} {
-                        if {[lsearch $portinfo(platforms) $platformString] == -1} {
-                                ui_silent &quot;Skipping unsupported port $portinfo(name) (platform: $platformString supported: $portinfo(platforms))&quot;
-                                continue
-                        }
-                }
-
-
-                # Add apt override line. dpkg is special cased and marked 'required'
-                # TODO: add the ability to specify the &quot;required&quot; priority for specific
-                # ports in a config file.
-                if {&quot;$portinfo(name)&quot; == &quot;dpkg&quot;} {
-                        set pkg_priority required
-                } else {
-                        set pkg_priority optional
-                }
-                add_override $portinfo(name) $pkg_priority [lindex $portinfo(categories) 0]
-
-                # Skip up-to-date software
-                set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-                if {[file exists ${pkgfile}]} {
-                        if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                                if {[file readable $pkgfile] &amp;&amp; ([file mtime ${pkgfile}] &gt; [file mtime ${portpath}/Portfile])} {
-                                        ui_silent &quot;Skipping ${portinfo(name)}-${portinfo(version)}-${portinfo(revision)}; package is up to date.&quot;
-                                        # Shove the package into the apt repository
-                                        copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-                                        continue
-                                }
-                        }
-                }
-
-                # We're going to actually build the package, reset the tree
-                # if this is our first time through. The tree is always reset
-                # at the end of a packaging run, too.
-                if {$firstrun_flag == true} {
-                        reset_tree
-                        set firstrun_flag false
-                }
-
-                ui_silent &quot;Building $portinfo(name) ...&quot;
-
-                # Close the main debug log
-                close_default_log
-
-                # Create log directory and open the build log
-                file mkdir [file join ${pkgrepo} ${architecture} log build ${port}]
-                set logfd [open ${pkgrepo}/${architecture}/log/build/${port}/build.log w 0644]
-
-                # Install binary dependencies if possible
-                set dependencies [get_dependencies $portinfo(name)]
-                foreach dep $dependencies {
-                        install_binary_if_available $dep
-                }
-
-                if {[catch {set workername [mportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: unable to open port: $result&quot;
-                        exit 1
-                }
-
-                if {[catch {set result [mportexec $workername clean]} result] || $result == 1} {
-                        ui_noisy_error &quot;Cleaning $portinfo(name) failed, consult build log&quot;
-
-                        # Close the log
-                        close $logfd
-
-                        # Copy the log to the failure directory
-                        copy_failure_log $portinfo(name)
-
-                        # Close the port
-                        mportclose $workername
-
-                        continue
-                }
-
-                # Re-open the port. MacPorts doesn't play well with multiple targets, apparently
-                mportclose $workername
-                if {[catch {set workername [mportopen $portinfo(porturl) [array get options] [array get variations] yes]} result] || $result == 1} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: unable to open port: $result&quot;
-                        exit 1
-                }
-
-                if {[catch {set result [mportexec $workername dpkg]} result] || $result == 1} {
-                        ui_noisy_error &quot;Packaging $portinfo(name) failed, consult build log&quot;
-
-                        # Copy the log to the failure directory
-                        copy_failure_log $portinfo(name)
-
-                        # Close the port
-                        mportclose $workername
-
-                        # Close the log
-                        close $logfd
-
-                        # Open default log
-                        open_default_log
-
-                        ui_silent &quot;Resetting /usr/dports ...&quot;
-                        reset_tree
-                        ui_silent &quot;Done.&quot;
-
-                        # Close the log
-                        close $logfd
-
-                        continue
-                }
-
-                ui_silent &quot;Package build for $portinfo(name) succeeded&quot;
-
-                # Into the apt repository you go!
-                copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
-
-                ui_silent &quot;Resetting /usr/dports ...&quot;
-                reset_tree
-                ui_silent &quot;Done.&quot;
-
-                # Close the log
-                close $logfd
-
-                # Delete any previous failure logs
-                delete_failure_log $portinfo(name)
-
-                # Close the port
-                mportclose $workername
-        }
-
-        open_default_log
-
-        # If required, rebuild the clientinstall.tgz
-        if {$basegen_flag == true} {
-                # dpkg is always required
-                set pkglist [lsort -unique [concat dpkg $baselist [get_required_ports]]]
-                set workdir [file join ${pkgrepo} ${architecture}]
-                set rootdir [file join $workdir clientroot]
-                set rootfile [file join $workdir client-root.tar.gz]
-                file mkdir ${rootdir}
-
-                # dpkg is required
-                array set portinfo [lindex [get_portinfo dpkg] 1]
-                set pkgfile [get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]
-                system &quot;cd \&quot;${rootdir}\&quot; &amp;&amp; ar x \&quot;${pkgfile}\&quot; data.tar.gz&quot;
-                system &quot;cd \&quot;${rootdir}\&quot; &amp;&amp; tar xvf data.tar.gz; rm data.tar.gz&quot;
-
-                foreach port $pkglist {
-                        set dependencies [get_dependencies $port false]
-                        foreach dep $dependencies {
-                                lappend newpkglist [lindex $dep 0]
-                        }
-                }
-
-                if {[info exists newpkglist]} {
-                        set pkglist [lsort -unique [concat $newpkglist $pkglist]]
-                }
-
-                foreach port $pkglist {
-                        array set portinfo [lindex [get_portinfo $port] 1]
-                        system &quot;dpkg --root \&quot;${rootdir}\&quot; --force-depends -i \&quot;[get_pkgpath $portinfo(name) $portinfo(version) $portinfo(revision)]\&quot;&quot;
-                }
-
-                system &quot;cd \&quot;${rootdir}\&quot; &amp;&amp; tar cf \&quot;[file join ${workdir} clientinstall.tar.gz]\&quot; .&quot;
-                file delete -force ${rootdir}
-        }
-
-        ui_silent &quot;Building apt-get index ...&quot;
-        if {[catch {system &quot;cd ${pkgrepo}/apt &amp;&amp; dpkg-scanpackages dists override &gt;${aptpackagedir}/Packages&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-
-        if {[catch {system &quot;cd ${aptpackagedir} &amp;&amp; gzip Packages&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-        remove_override_file
-        ui_silent &quot;Done.&quot;
-
-        ui_silent &quot;Package run finished.&quot;
-        close_default_log
-
-        exit 0
-}
-
-# Return ports listed in $dpkg::requiredports that are not
-# installed
-proc get_required_ports {args} {
-        global dpkg::requiredports
-        set reqlist &quot;&quot;
-
-        foreach {binary port} $requiredports {
-                if {[find_binary $binary] eq &quot;&quot;} {
-                        lappend reqlist $port
-                }
-        }
-        return $reqlist
-}
-
-# Given a binary name, searches PATH
-proc find_binary {binary} {
-        global env
-        set path [split $env(PATH) :]
-        foreach dir $path {
-                set file [file join $dir $binary]
-                if {[file exists $file]} {
-                        return $file
-                }
-        }
-        return &quot;&quot;
-}
-
-# Set the architecture global
-proc set_architecture {args} {
-        set dpkg::architecture &quot;[exec dpkg --print-installation-architecture]&quot;
-}
-
-# Initialize a new build system
-proc initialize_system {args} {
-        global dpkg::initialports dpkg::pkgrepo
-        global dpkg::architecture dpkg::portprefix
-
-        # Create standard directories
-        ui_msg &quot;Creating ${pkgrepo} directory&quot;
-        file mkdir ${pkgrepo}
-
-        set builddeps &quot;&quot;
-        set rundeps &quot;&quot;
-
-        foreach port [get_required_ports] {
-                set builddeps [concat $builddeps [get_dependencies $port true]]
-                set rundeps [concat $rundeps [get_dependencies $port false]]
-        }
-
-        set buildlist [lsort -unique $builddeps]
-
-        foreach port $builddeps {
-                if {[lsearch -exact $port $rundeps] &gt;= 0} {
-                        lappend removelist $port
-                }
-        }
-
-        set options &quot;&quot;
-        set variations &quot;&quot;
-
-        foreach port [get_required_ports] {
-                set options(subport) $port
-                if {[catch {do_portexec $port [array get options] [array get variants] activate} result]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Fatal error: $result&quot;
-                        exit 1
-                }
-        }
-
-        if {[info exists removelist]} {
-                ui_msg &quot;Removing build dependencies ...&quot;
-                foreach portlist $removelist {
-                        set port [lindex $portlist 0]
-
-                        ui_msg &quot;Uninstalling $port.&quot;
-                        if { [catch {registry_uninstall::uninstall $portname $portversion &quot;&quot; 0 [array get options]} result] } {
-                                global errorInfo
-                                ui_debug &quot;$errorInfo&quot;
-                                ui_noisy_errorr &quot;Fatal error: Uninstalling $port failed: $result&quot;
-                                exit 1
-                        }
-                }
-                ui_msg &quot;Done.&quot;
-        }
-
-
-        if {[catch {set_architecture} result]} {
-                puts &quot;Fatal error: $result.&quot;
-                exit 1
-        }
-
-        ui_msg &quot;Creating [file join ${pkgrepo} ${architecture}] directory&quot;
-        file mkdir [file join ${pkgrepo} ${architecture}]
-        file mkdir [file join ${pkgrepo} ${architecture} etc]
-
-        ui_msg &quot;Generating pristine archive: [file join ${pkgrepo} ${architecture} root.tar.gz]&quot;
-        if {[catch {system &quot;tar -zcf \&quot;[file join ${pkgrepo} ${architecture} root.tar.gz]\&quot; \&quot;${portprefix}\&quot;&quot;} result]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Fatal error: Archive creation failed: $result&quot;
-                exit 1
-        }
-
-        ui_msg &quot;Build system successfully initialized!&quot;
-}
-
-# Execute a target on a port (by port name)
-proc do_portexec {port options variants target} {
-
-        array set portinfo [lindex [get_portinfo $port] 1]
-
-        if {[catch {set workername [mportopen $portinfo(porturl) $options $variants yes]} result] || $result == 1} {
-                return -code error &quot;Internal error: unable to open port: $result&quot;
-                exit 1
-        }
-
-        if {[catch {set result [mportexec $workername $target]} result] || $result == 1} {
-
-                # Close the port
-                mportclose $workername
-
-                # Return error
-                return -code error &quot;Executing target $target on $portinfo(name) failed.&quot;
-        }
-}
-
-proc get_portinfo {port} {
-        set searchstring [regex_escape_portname $port]
-        set res [mportlookup ${searchstring}]
-
-        if {[llength $res] &lt; 2} {
-                return -code error &quot;Port \&quot;$port\&quot; not found in index.&quot;
-        }
-
-        return $res
-}
-
-# Given name, version, and revision, returns the path to a package file
-proc get_pkgpath {name version revision} {
-        global dpkg::pkgrepo dpkg::architecture
-        global dpkg::packagedir
-        if {${revision} == 0} {
-                set revision &quot;&quot;
-        } else {
-                set revision &quot;-${revision}&quot;
-        }
-
-        return [string tolower ${packagedir}/${name}_${version}${revision}_${architecture}.deb]
-}
-
-# Opens the default log file and sets dpkg::logfd
-proc open_default_log {{mode a}} {
-        global dpkg::pkgrepo dpkg::architecture dpkg::logfd
-        # Ensure that the log directory exists, and open up
-        # the default debug log
-        file mkdir ${pkgrepo}/${architecture}/log/
-        set logfd [open ${pkgrepo}/${architecture}/log/debug.log ${mode} 0644]
-}
-
-# Closes the current logfile
-proc close_default_log {args} {
-        global dpkg::logfd
-        close $logfd
-}
-
-# Copies a port log file to the failure directory
-proc copy_failure_log {name} {
-        global dpkg::pkgrepo dpkg::architecture
-        # Copy the log to the failure log directory
-        file mkdir ${pkgrepo}/${architecture}/log/failure/${name}
-        file copy -force ${pkgrepo}/${architecture}/log/build/${name}/build.log ${pkgrepo}/${architecture}/log/failure/${name}/
-}
-
-# Deletes a port's failure log
-proc delete_failure_log {name} {
-        global dpkg::pkgrepo dpkg::architecture
-        if {[catch {system &quot;rm -Rf ${pkgrepo}/${architecture}/log/failure/${name}&quot;} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-}
-
-# Add an override entry to the apt override file
-proc add_override {name priority section {maintainer &quot;&quot;}} {
-        global dpkg::aptpackagedir dpkg::pkgrepo
-        set output &quot;${name}        ${priority}        ${section}&quot;
-        if {${maintainer} != &quot;&quot;} {
-                append output &quot; ${maintainer}&quot;
-        }
-        set fd [open &quot;${pkgrepo}/apt/override&quot; a 0644]
-        puts $fd $output
-        close $fd
-}
-
-# Deletes the apt override file
-proc remove_override_file {args} {
-        global dpkg::aptpackagedir dpkg::pkgrepo
-        if {[catch {file delete -force ${pkgrepo}/apt/override} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_noisy_error &quot;Internal error: $error&quot;
-                exit 1
-        }
-}
-
-# Copies a given package to the apt repository
-proc copy_pkg_to_apt {name version revision category} {
-        global dpkg::aptpackagedir
-
-        set pkgfile [get_pkgpath $name $version $revision]
-        file mkdir $aptpackagedir/main/$category
-        file link -hard $aptpackagedir/main/$category/[file tail $pkgfile] $pkgfile
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname {includeBuildDeps &quot;true&quot;}} {
-        set result [get_dependencies_recurse $portname $includeBuildDeps]
-        return [lsort -unique $result]
-}
-
-proc get_dependencies_recurse {portname includeBuildDeps} {
-        set result {}
-
-        set res [get_portinfo $portname]
-
-        foreach {name array} $res {
-                array set portinfo $array
-                if {![info exists portinfo(name)] ||
-                        ![info exists portinfo(version)] ||
-                        ![info exists portinfo(revision)] ||
-                        ![info exists portinfo(categories)]} {
-                        ui_error &quot;Internal error: $name missing some portinfo keys&quot;
-                        continue
-                }
-
-                lappend result [list $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]]
-
-                # Append the package's dependents to the result list
-                set depends {}
-                if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
-                if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_build)]} {
-                        eval &quot;lappend depends $portinfo(depends_build)&quot;
-                }
-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} {
-                        eval &quot;lappend depends $portinfo(depends_fetch)&quot;
-                }
-                if {$includeBuildDeps == &quot;true&quot; &amp;&amp; [info exists portinfo(depends_extract)]} {
-                        eval &quot;lappend depends $portinfo(depends_extract)&quot;
-                }
-                foreach depspec $depends {
-                        set dep [lindex [split $depspec :] end]
-                        set x [get_dependencies_recurse $dep $includeBuildDeps]
-                        eval &quot;lappend result $x&quot;
-                        set result [lsort -unique $result]
-                }
-        }
-        return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-        global dpkg::architecture dpkg::pkgrepo dpkg::portprefix
-
-        set portname [lindex $dep 0]
-        set portversion [lindex $dep 1]
-        set portrevision [lindex $dep 2]
-        set category [lindex $dep 3]
-
-        if {${portrevision} != &quot;&quot;} {
-                set verstring ${portversion}_${portrevision}
-        } else {
-                set verstring ${portversion}
-        }
-
-        set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
-        set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
-
-        # Check if the package is available, and ensure that it has not already been
-        # installed through MacPorts (bootstrap packages such as dpkg and its
-        # dependencies are always installed)
-        if {[file readable $pkgpath] &amp;&amp; ![file exists $receiptdir/receipt.bz2]} {
-                ui_silent &quot;Installing binary: $pkgpath&quot;
-                if {[catch {system &quot;dpkg --force-depends -i ${pkgpath}&quot;} error]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: $error&quot;
-                        exit 1
-                }
-                # Touch the receipt
-                file mkdir $receiptdir
-                if {[catch {system &quot;touch [file join $receiptdir receipt.bz2]&quot;} error]} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_noisy_error &quot;Internal error: $error&quot;
-                        exit 1
-                }
-        }
-}
-
-### main() entry point ####
-main $argc $argv
</del></span></pre></div>
<a id="trunkbaseportmgrpackagingrpmalltcl"></a>
<div class="delfile"><h4>Deleted: trunk/base/portmgr/packaging/rpmall.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/portmgr/packaging/rpmall.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/portmgr/packaging/rpmall.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,502 +0,0 @@
</span><del>-#!/usr/bin/env tclsh
-# rpmall.tcl
-# $Id$
-#
-# Copyright (c) 2009-2011 The MacPorts Project
-# Copyright (c) 2003 Benjamin Reed &lt;ranger@befunk.com&gt;
-# Copyright (c) 2003 Kevin Van Vechten &lt;kevin@opendarwin.org&gt;
-# Copyright (c) 2002 Apple Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#         notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#         notice, this list of conditions and the following disclaimer in the
-#         documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Inc. nor the names of its contributors
-#         may be used to endorse or promote products derived from this software
-#         without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-package require darwinports
-
-# globals
-set portdir .
-
-# UI Instantiations
-array set ui_options {}
-# ui_options(ports_debug) - If set, output debugging messages.
-# ui_options(ports_verbose) - If set, output info messages (ui_info)
-# ui_options(ports_quiet) - If set, don't output &quot;standard messages&quot;
-
-# ui_options accessor
-proc ui_isset {val} {
-        global ui_options
-        if {[info exists ui_options($val)]} {
-                if {$ui_options($val) eq &quot;yes&quot;} {
-                        return 1
-                }
-        }
-        return 0
-}
-
-set options(package.destpath) &quot;/darwinports/rpms&quot;
-
-# UI Callback
-
-proc ui_prefix {priority} {
-        switch $priority {
-                debug {
-                        return &quot;DEBUG: &quot;
-                }
-                error {
-                        return &quot;Error: &quot;
-                }
-                warn {
-                        return &quot;Warning: &quot;
-                }
-                default {
-                        return &quot;&quot;
-                }
-        }
-}
-
-proc ui_channels {priority} {
-        global logfd
-        switch $priority {
-                debug {
-                        if {[ui_isset ports_debug]} {
-                                return {stdout}
-                        } else {
-                                return {}
-                        }
-                }
-                info {
-                        # put verbose stuff only to the log file
-                        if {[ui_isset ports_verbose]} {
-                                return {$logfd}
-                        } else {
-                                return {}
-                        }
-                }
-                msg {
-                        if {[ui_isset ports_quiet]} {
-                                return {}
-                        } else {
-                                return {stdout}
-                        }
-                }
-                default {
-                        return {stdout}
-                }
-        }
-}
-
-proc pkg_ui_log {message} {
-        global logfd
-        if {$logfd ne &quot;&quot;} {
-                log_message $logfd $message
-        }
-}
-
-proc log_message {channel message} {
-        seek $channel 0 end
-        puts $channel $message
-        flush $channel
-}
-
-# Recursive bottom-up approach of building a list of dependencies.
-proc get_dependencies {portname includeBuildDeps} {
-        set result {}
-
-        if {[catch {set search [mportsearch &quot;^$portname\$&quot;]} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_error &quot;Internal error: port search failed: $error&quot;
-                return {}
-        }
-        foreach {name array} $search {
-                array set portinfo $array
-                if {![info exists portinfo(name)] ||
-                        ![info exists portinfo(version)] ||
-                        ![info exists portinfo(categories)]} {
-                        ui_error &quot;Internal error: $name missing some portinfo keys&quot;
-                        continue
-                }
-                if {![info exists portinfo(revision)]} {
-                        set portinfo(revision) 0
-                }
-
-                set portname $portinfo(name)
-                set portversion $portinfo(version)
-                set revision $portinfo(revision)
-
-                # Append the package itself to the result list
-                lappend result [list $portname $portversion $revision]
-
-                # Append the package's dependents to the result list
-                set depends {}
-                if {[info exists portinfo(depends_run)]} { eval &quot;lappend depends $portinfo(depends_run)&quot; }
-                if {[info exists portinfo(depends_lib)]} { eval &quot;lappend depends $portinfo(depends_lib)&quot; }
-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_build)]} {
-                        eval &quot;lappend depends $portinfo(depends_build)&quot;
-                }
-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_fetch)]} {
-                        eval &quot;lappend depends $portinfo(depends_fetch)&quot;
-                }
-                if {$includeBuildDeps ne &quot;&quot; &amp;&amp; [info exists portinfo(depends_extract)]} {
-                        eval &quot;lappend depends $portinfo(depends_extract)&quot;
-                }
-                foreach depspec $depends {
-                        set dep [lindex [split $depspec :] end]
-                        set x [get_dependencies $dep $includeBuildDeps]
-                        eval &quot;lappend result $x&quot;
-                        set result [lsort -unique $result]
-                }
-        }
-        return $result
-}
-
-# Install binary packages if they've already been built.  This will
-# speed up the testing, since we won't have to recompile dependencies
-# which have already been compiled.
-
-proc install_binary_if_available {dep} {
-        set portname [lindex $dep 0]
-        set portversion [lindex $dep 1]
-        set revision [lindex $dep 2]
-
-        foreach dir {&quot;${prefix}/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
-                foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
-                        set rpmpath &quot;${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm&quot;
-                        if {[file readable $rpmpath]} {
-                                ui_msg &quot;Installing binary: $rpmpath&quot;
-                                if {[catch {system &quot;rpm -Uvh --force $rpmpath&quot;} error ]} {
-                                        global errorInfo
-                                        ui_debug &quot;$errorInfo&quot;
-                                        ui_error &quot;Internal error: $error&quot;
-                                } else {
-                                        return true
-                                }
-                        }
-                }
-        }
-        return false
-}
-
-
-# Standard procedures
-
-proc fatal args {
-        global argv0
-        puts stderr &quot;$argv0: $args&quot;
-        exit
-}
-
-# Main
-array set options [list]
-array set variations [list]
-
-#        set ui_options(ports_verbose) yes
-if {![file exists /usr/bin/sw_vers]} {
-        set variations(puredarwin) &quot;+&quot;
-}
-
-if {[catch {mportinit ui_options options variations} result]} {
-        puts &quot;Failed to initialize ports system, $result&quot;
-        exit 1
-}
-
-package require Pextlib
-
-# If no arguments were given, default to all ports.
-if {[llength $argv] == 0} {
-        lappend argv &quot;.*&quot;
-}
-
-foreach pname $argv {
-        if {[catch {set allpackages [mportsearch &quot;^${pname}\$&quot;]} result]} {
-                puts &quot;port search failed: $result&quot;
-                exit 1
-        }
-
-        set logpath &quot;/darwinports/logs&quot;
-        set logfd &quot;&quot;
-
-        foreach {name array} $allpackages {
-                array unset portinfo
-                array set portinfo $array
-
-                #ui_msg &quot;foo $portinfo(porturl)&quot;
-
-                # Start with verbose output off;
-                # this will prevent the repopulation of /opt/local from getting logged.
-                set ui_options(ports_verbose) no
-
-                if {![info exists portinfo(porturl)]} {
-                        puts stderr &quot;Internal error: no porturl for $name&quot;
-                        continue
-                }
-                if {![info exists portinfo(revision)]} {
-                        set portinfo(revision) 0
-                }
-
-                set porturl $portinfo(porturl)
-
-                # this is used to short-circuit the RPM check and
-                # move on to the next package
-
-                global exit_loop
-                set exit_loop false
-
-                # Skip up-to-date packages
-                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                        if {[info exists portinfo(name)] &amp;&amp;
-                                [info exists portinfo(version)] &amp;&amp;
-                                [info exists portinfo(revision)]} {
-                                set portname $portinfo(name)
-                                set portversion $portinfo(version)
-                                set revision $portinfo(revision)
-
-                                foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
-                                        foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
-                                                set rpmpath &quot;${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm&quot;
-                                                #ui_msg &quot;trying ${rpmpath}&quot;
-                                                if {[file readable $rpmpath] &amp;&amp; ([file mtime ${rpmpath}] &gt;= [file mtime ${portpath}/Portfile])} {
-                                                        puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package is up to date.&quot;
-                                                        set exit_loop true
-                                                        break
-                                                }
-                                        }
-                                        if {${exit_loop}} {
-                                                break
-                                        }
-                                }
-                        }
-                }
-                if {${exit_loop}} {
-                        continue
-                }
-
-                # Skip packages which previously failed
-                set exit_loop false
-
-                # Skip up-to-date packages
-                if {[regsub {^file://} $portinfo(porturl) &quot;&quot; portpath]} {
-                        if {[info exists portinfo(name)] &amp;&amp;
-                                [info exists portinfo(version)] &amp;&amp;
-                                [info exists portinfo(revision)]} {
-                                set portname $portinfo(name)
-                                set portversion $portinfo(version)
-                                set revision $portinfo(revision)
-
-                                set logfilepath &quot;${logpath}/${portname}.log&quot;
-                                if {[file readable ${logfilepath}] &amp;&amp; ([file mtime ${logfilepath}] &gt; [file mtime ${portpath}/Portfile])} {
-                                        puts stderr &quot;-&gt;    skipping ${portname}-${portversion}; package failed, but has not changed.&quot;
-                                        set exit_loop true
-                                }
-                        }
-                }
-                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.
-
-                set remove_files &quot;&quot;
-                foreach dir {&quot;/opt/local/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/darwinports/rpms/RPMS&quot;} {
-                        foreach arch {&quot;ppc&quot; &quot;i386&quot; &quot;fat&quot;} {
-                                set remove_files &quot;${remove_files} '${dir}/${arch}/'*.rpm&quot;
-                        }
-                }
-                system &quot;rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true&quot;
-
-                ui_msg &quot;-&gt;          Removing /opt/local&quot;
-                #unset ui_options(ports_verbose)
-                if {[catch {system &quot;rm -Rf /opt/local&quot;} error]} {
-                        puts stderr &quot;Internal error: $error&quot;
-                }
-                # this is bad on pure darwin  :)
-                #if {[catch {system &quot;rm -Rf /usr/X11R6&quot;} error]} {
-                #        puts stderr &quot;Internal error: $error&quot;
-                #}
-                #if {[catch {system &quot;rm -Rf /etc/X11&quot;} error]} {
-                #        puts stderr &quot;Internal error: $error&quot;
-                #}
-                #if {[catch {system &quot;rm -Rf /etc/fonts&quot;} error]} {
-                #        puts stderr &quot;Internal error: $error&quot;
-                #}
-                ui_msg &quot;-&gt;          Installing MacPorts&quot;
-                if {[catch {system &quot;cd $env(HOME)/darwinports &amp;&amp; make &amp;&amp; make install&quot;} error]} {
-                        puts stderr &quot;Internal error: $error&quot;
-                }
-                if {[catch {system &quot;rmdir /opt/local/var/db/dports/distfiles&quot;} error]} {
-                        puts stderr &quot;Internal error: $error&quot;
-                }
-                if {[catch {system &quot;ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles&quot;} error]} {
-                        puts stderr &quot;Internal error: $error&quot;
-                }
-                #set ui_options(ports_verbose) yes
-
-                # If there was a log file left over from the previous pass,
-                # then the port failed with an error.  Send the log in an
-                # email to the maintainers.
-                if {$logfd ne &quot;&quot;} {
-                        close $logfd
-                        set logfd &quot;&quot;
-                }
-                #if {[file readable $logfilename]} {
-                #        if {[catch {system &quot;&lt;$logfilename /usr/sbin/sendmail -t&quot;} error]} {
-                #                puts stderr &quot;Internal error: $error&quot;
-                #        }
-                #}
-
-                # Open the log file for writing
-                set logfd [open ${logpath}/${name}.log w]
-
-                set valid 1
-
-                set lint_errors {}
-                set portname &quot;&quot;
-                set portversion &quot;&quot;
-                set description &quot;&quot;
-                set category &quot;&quot;
-
-                if {![info exists portinfo(name)]} {
-                        lappend lint_errors &quot;missing name key&quot;
-                        set valid 0
-                } else {
-                        set portname $portinfo(name)
-                }
-
-                if {![info exists portinfo(description)]} {
-                        lappend lint_errors &quot;missing description key&quot;
-                        set valid 0
-                } else {
-                        set description $portinfo(description)
-                }
-
-                if {![info exists portinfo(version)]} {
-                        lappend lint_errors &quot;missing version key&quot;
-                        set valid 0
-                } else {
-                        set portversion $portinfo(version)
-                }
-
-                if {![info exists portinfo(categories)]} {
-                        lappend lint_errors &quot;missing categories key&quot;
-                        set valid 0
-                } else {
-                        set category [lindex $portinfo(categories) 0]
-                }
-
-                if {![info exists portinfo(maintainers)]} {
-                        append lint_errors &quot;missing maintainers key&quot;
-                        set valid 0
-                        set maintainers kevin@opendarwin.org
-                } else {
-                        set maintainers $portinfo(maintainers)
-                }
-
-                pkg_ui_log &quot;To: [join $maintainers {, }]&quot;
-                pkg_ui_log &quot;From: donotreply@opendarwin.org&quot;
-                pkg_ui_log &quot;Subject: MacPorts $portinfo(name)-$portinfo(version) build failure&quot;
-                pkg_ui_log &quot;&quot;
-                pkg_ui_log &quot;The following is a transcript produced by the MacPorts automated build                 &quot;
-                pkg_ui_log &quot;system.  You are receiving this email because you are listed as a maintainer        &quot;
-                pkg_ui_log &quot;of this port, which has failed the automated packaging process.  Please update        &quot;
-                pkg_ui_log &quot;the port as soon as possible.&quot;
-                pkg_ui_log &quot;&quot;
-                pkg_ui_log &quot;&quot;
-                pkg_ui_log &quot;Thank you,&quot;
-                pkg_ui_log &quot;The MacPorts Team&quot;
-                pkg_ui_log &quot;&quot;
-                pkg_ui_log &quot;================================================================================&quot;
-                pkg_ui_log &quot;&quot;
-
-                if {!$valid} {
-                        foreach error $lint_errors {
-                                ui_error $error
-                        }
-                }
-
-                ui_msg &quot;--&gt;   Packaging ${category}/${portname}-${portversion}&quot;
-
-                foreach prebuild {&quot;ccache&quot; &quot;rpm&quot; &quot;unzip&quot;} {
-                        if {![file exists /bin/${prebuild}] &amp;&amp; ![file exists /usr/bin/${prebuild}]} {
-                                ui_msg &quot;---&gt;  Pre-installing ${prebuild}&quot;
-                                if {[catch {set search [mportsearch &quot;^${prebuild}\$&quot;]} error]} {
-                                        global errorInfo
-                                        ui_debug &quot;$errorInfo&quot;
-                                        ui_error &quot;Internal error: port search ${prebuild} failed: $error&quot;
-                                }
-                                array set prebuildinfo [lindex $search 1]
-                                set ui_options(ports_verbose) yes
-                                set options(subport) ${prebuild}
-                                if {[catch {set workername [mportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
-                                        $result == 1} {
-                                        global errorInfo
-                                        ui_debug &quot;$errorInfo&quot;
-                                        ui_error &quot;Internal error: unable to install ${prebuild}... exiting&quot;
-                                        exit 1
-                                }
-                                if {[catch {set result [mportexec $workername activate]} result] ||
-                                        $result == 1} {
-                                        global errorInfo
-                                        ui_debug &quot;$errorInfo&quot;
-                                        ui_error &quot;installation of ${prebuild} failed: $result&quot;
-                                        mportclose $workername
-                                        exit 1
-                                }
-                        }
-                }
-
-                # Turn on verbose output for the build
-                set ui_options(ports_verbose) yes
-                set options(subport) $name
-                if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result] ||
-                        $result == 1} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_error &quot;Internal error: unable to open port: $result&quot;
-                        continue
-                }
-                if {[catch {set result [mportexec $workername rpmpackage]} result] ||
-                        $result == 1} {
-                        global errorInfo
-                        ui_debug &quot;$errorInfo&quot;
-                        ui_error &quot;port package failed: $result&quot;
-                        mportclose $workername
-                        continue
-                }
-                set ui_options(ports_verbose) no
-                # Turn verbose output off after the build
-
-                mportclose $workername
-
-                # We made it to the end.  We can delete the log file.
-                close $logfd
-                set logfd &quot;&quot;
-                file delete ${logpath}/${name}.log
-        }
-
-}
-# end foreach pname
</del></span></pre></div>
<a id="trunkbasesrcmacports10macportstcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/macports1.0/macports.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/macports1.0/macports.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/macports1.0/macports.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -3361,10 +3361,7 @@
</span><span class="cx">         dmg -
</span><span class="cx">         mdmg -
</span><span class="cx">         pkg -
</span><del>-        mpkg -
-        rpm -
-        dpkg -
-        srpm {return 1}
</del><ins>+        mpkg {return 1}
</ins><span class="cx">         default {return 0}
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -3379,14 +3376,11 @@
</span><span class="cx">         configure   -
</span><span class="cx">         build       {return &quot;depends_fetch depends_extract depends_build depends_lib&quot;}
</span><span class="cx">         test        -
</span><del>-        srpm        -
</del><span class="cx">         destroot    {return &quot;depends_fetch depends_extract depends_build depends_lib depends_run&quot;}
</span><span class="cx">         dmg         -
</span><span class="cx">         pkg         -
</span><span class="cx">         mdmg        -
</span><del>-        mpkg        -
-        rpm         -
-        dpkg        {
</del><ins>+        mpkg        {
</ins><span class="cx">             if {[global_option_isset ports_binary_only] ||
</span><span class="cx">                 (![global_option_isset ports_source_only] &amp;&amp; [$workername eval _archive_available])} {
</span><span class="cx">                 return &quot;depends_lib depends_run&quot;
</span></span></pre></div>
<a id="trunkbasesrcpackage10Makefilein"></a>
<div class="modfile"><h4>Modified: trunk/base/src/package1.0/Makefile.in (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/Makefile.in        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/Makefile.in        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> INSTALLDIR=        ${DESTDIR}${TCL_PACKAGE_PATH}/package1.0
</span><span class="cx"> 
</span><span class="cx"> SRCS=        package.tcl portdmg.tcl portmdmg.tcl portmpkg.tcl portpkg.tcl \
</span><del>-        portrpm.tcl portsrpm.tcl portdpkg.tcl portunarchive.tcl \
</del><ins>+        portunarchive.tcl \
</ins><span class="cx">         portarchivefetch.tcl
</span><span class="cx"> 
</span><span class="cx"> all:: pkgIndex.tcl
</span></span></pre></div>
<a id="trunkbasesrcpackage10packagetcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/package1.0/package.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/package.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/package.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -33,12 +33,9 @@
</span><span class="cx"> # standard package load
</span><span class="cx"> package provide mp_package 1.0
</span><span class="cx"> 
</span><del>-package require portrpm 1.0
-package require portsrpm 1.0
</del><span class="cx"> package require portpkg 1.0
</span><span class="cx"> package require portmpkg 1.0
</span><span class="cx"> package require portdmg 1.0
</span><span class="cx"> package require portmdmg 1.0
</span><del>-package require portdpkg 1.0
</del><span class="cx"> package require portarchivefetch 1.0
</span><span class="cx"> package require portunarchive 1.0
</span></span></pre></div>
<a id="trunkbasesrcpackage10portdpkgtcl"></a>
<div class="delfile"><h4>Deleted: trunk/base/src/package1.0/portdpkg.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/portdpkg.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/portdpkg.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,206 +0,0 @@
</span><del>-# et:ts=4
-# portdpkg.tcl
-# $Id$
-#
-# Copyright (c) 2005, 2007, 2009, 2011 The MacPorts Project
-# Copyright (c) 2004 Landon Fuller &lt;landonf@macports.org&gt;
-# Copyright (c) 2002 - 2003 Apple Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-package provide portdpkg 1.0
-package require portutil 1.0
-
-set org.macports.dpkg [target_new org.macports.dpkg portdpkg::main]
-target_runtype ${org.macports.dpkg} always
-target_provides ${org.macports.dpkg} dpkg
-target_requires ${org.macports.dpkg} archivefetch unarchive destroot
-
-namespace eval portdpkg {
-}
-
-# Options
-options dpkg.asroot \
-        package.destpath
-
-# Set up defaults
-default dpkg.asroot yes
-
-set_ui_prefix
-
-proc portdpkg::main {args} {
-        global UI_PREFIX destpath os.arch os.platform supported_archs configure.build_arch
-
-        ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Creating dpkg for %s-%s&quot;] [option subport] [option version]]&quot;
-
-        # get deplist
-        set deps [make_dependency_list [option subport]]
-        set deps [lsort -unique $deps]
-        foreach dep $deps {
-                set name [lindex [split $dep /] 0]
-                set vers [lindex [split $dep /] 1]
-                # don't re-package ourself
-                if {$name != [option subport]} {
-                        lappend dependencies &quot;${name} (&gt;= ${vers})&quot;
-                }
-        }
-
-        if {[info exists dependencies]} {
-                ui_debug $dependencies
-        }
-
-        set controlpath [file join ${destpath} DEBIAN]
-        if {[file exists ${controlpath}]} {
-                if {![file isdirectory ${controlpath}]} {
-                        return -code error [format [msgcat::mc &quot;Can not create dpkg control directory. %s not a directory.&quot;] ${controlpath}]
-                } else {
-                        ui_info [msgcat::mc &quot;Removing stale dpkg control directory.&quot;]
-                        delete &quot;${controlpath}&quot;
-                }
-        }
-        file mkdir ${controlpath}
-
-        set controlfd [open [file join ${controlpath} control] w+]
-
-        # Size, in kilobytes, of ${destpath}
-           set pkg_installed-size [expr {[dirSize ${destpath}] / 1024}]
-
-        # Create debian dependency list
-        if {[info exists dependencies]} {
-                if {[llength ${dependencies}] != 0} {
-                        set pkg_depends [join ${dependencies} &quot;, &quot;]
-                }
-        }
-
-        # Create dpkg version number
-        if {[option epoch] != 0} {
-                set pkg_version &quot;[option epoch]:[option version]&quot;
-        } else {
-                set pkg_version &quot;[option version]&quot;
-        }
-        if {[option revision] != 0} {
-                append pkg_version &quot;-[option revision]&quot;
-        }
-
-        # Set dpkg category to first (main) category
-        set pkg_category [lindex [option categories] 0]
-
-        # Format the long description. Add a homepage if possible.
-        if {[exists long_description]} {
-                set pkg_long_description &quot; [option long_description]\n&quot;
-        } elseif {[exists description]} {
-                set pkg_long_description &quot; [option description]\n&quot;
-        } else {
-                set pkg_long_description &quot; [option subport]\n&quot;
-        }
-
-        if {[exists homepage]} {
-                append pkg_long_description &quot; .\n&quot;
-                append pkg_long_description &quot; [option homepage]\n&quot;
-        }
-
-        # Discern correct architecture
-        # From http://www.debian.org/doc/debian-policy/ch-customized-programs.html#fr55:
-        # The following architectures and operating systems are currently recognised
-        # by dpkg-archictecture. The architecture, arch, is one of the following:
-        # alpha, arm, hppa, i386, ia64, m68k, mips, mipsel, powerpc, s390, sh, sheb,
-        # sparc and sparc64. The operating system, os, is one of: linux, gnu,
-        # freebsd and openbsd. Use of gnu in this string is reserved for the
-        # GNU/Hurd operating system.
-        switch -regex ${configure.build_arch} {
-                i[3-9]86 { set pkg_arch &quot;i386&quot; }
-                x86_64 { set pkg_arch &quot;x86_64&quot; }
-                default { set pkg_arch ${os.arch} }
-        }
-
-        # On systems other than Linux, the Architecture must contain
-        # the operating system name
-        if {${os.platform} != &quot;linux&quot;} {
-                set pkg_arch &quot;${os.platform}-${pkg_arch}&quot;
-        } elseif {${pkg_arch} == &quot;x86_64&quot;} {
-                set pkg_arch &quot;amd64&quot;
-        }
-
-        # An architecture-independent package
-        if {$supported_archs eq &quot;noarch&quot;} {
-                set pkg_arch &quot;all&quot;
-        }
-
-        puts $controlfd &quot;Package: [option subport]&quot;
-        puts $controlfd &quot;Architecture: ${pkg_arch}&quot;
-        puts $controlfd &quot;Version: ${pkg_version}&quot;
-        puts $controlfd &quot;Section: ${pkg_category}&quot;
-        puts $controlfd &quot;Maintainer: [option maintainers]&quot;
-        if {[info exists pkg_depends]} {
-                puts $controlfd &quot;Depends: ${pkg_depends}&quot;
-        }
-        puts $controlfd &quot;Installed-Size: ${pkg_installed-size}&quot;
-
-        puts $controlfd &quot;Description: [option description]&quot;
-        # pkg_long_description is pre-formatted. Do not add a newline
-        puts -nonewline $controlfd &quot;$pkg_long_description&quot;
-        close $controlfd
-
-        # Build debian package in package.destpath
-        system &quot;dpkg-deb -b \&quot;${destpath}\&quot; \&quot;[option package.destpath]\&quot;&quot;
-
-        ui_info [msgcat::mc &quot;Removing dpkg control directory.&quot;]
-        delete &quot;${controlpath}&quot;
-}
-
-proc portdpkg::make_dependency_list {portname} {
-        set result {}
-        if {[catch {set res [mport_lookup $portname]} error]} {
-                global errorInfo
-                ui_debug &quot;$errorInfo&quot;
-                ui_error &quot;port lookup failed: $error&quot;
-                return 1
-        }
-        foreach {name array} $res {
-                array set portinfo $array
-
-                if {[info exists portinfo(depends_run)] || [info exists portinfo(depends_lib)]} {
-                        # get the union of depends_run and depends_lib
-                        # xxx: only examines the portfile component of the depspec
-                        set depends {}
-                        if {[info exists portinfo(depends_run)]} {
-                                lappend depends {*}$portinfo(depends_run)
-                        }
-                        if {[info exists portinfo(depends_lib)]} {
-                                lappend depends {*}$portinfo(depends_lib)
-                        }
-
-                        foreach depspec $depends {
-                                set dep [lindex [split $depspec :] end]
-                                lappend result {*}[make_dependency_list $dep]
-                        }
-                }
-                                lappend result $portinfo(name)/$portinfo(version)
-                                unset portinfo
-        }
-        return $result
-}
</del></span></pre></div>
<a id="trunkbasesrcpackage10portrpmtcl"></a>
<div class="delfile"><h4>Deleted: trunk/base/src/package1.0/portrpm.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/portrpm.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/portrpm.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,254 +0,0 @@
</span><del>-# et:ts=4
-# portrpm.tcl
-# $Id$
-#
-# Copyright (c) 2005 - 2007, 2009 - 2011, 2013 The MacPorts Project
-# Copyright (c) 2002 - 2003 Apple Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-package provide portrpm 1.0
-package require portutil 1.0
-
-set org.macports.rpm [target_new org.macports.rpm portrpm::rpm_main]
-target_runtype ${org.macports.rpm} always
-target_provides ${org.macports.rpm} rpm
-target_requires ${org.macports.rpm} archivefetch unarchive destroot
-
-namespace eval portrpm {
-}
-
-# Options
-options rpm.asroot \
-        package.destpath
-
-# Set up defaults
-default rpm.asroot yes
-
-default rpm.srcdir {${prefix}/src/macports}
-default rpm.tmpdir {${prefix}/var/tmp}
-
-set_ui_prefix
-
-proc portrpm::rpm_main {args} {
-    global subport version revision UI_PREFIX
-
-    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Creating RPM package for %s-%s&quot;] ${subport} ${version}]&quot;
-
-    return [rpm_pkg $subport $version $revision]
-}
-
-proc portrpm::rpm_pkg {portname portversion portrevision} {
-    global UI_PREFIX rpm.asroot package.destpath portdbpath destpath workpath \
-           prefix categories maintainers description long_description \
-           homepage epoch portpath os.platform os.arch os.version os.major \
-           supported_archs configure.build_arch license
-
-    set rpmdestpath &quot;&quot;
-    if {![string equal ${package.destpath} ${workpath}] &amp;&amp; ![string equal ${package.destpath} &quot;&quot;]} {
-        set rpm.asroot no
-        set pkgpath ${package.destpath}
-        file mkdir ${pkgpath}/BUILD \
-                   ${pkgpath}/RPMS \
-                   ${pkgpath}/SOURCES \
-                   ${pkgpath}/SPECS \
-                   ${pkgpath}/SRPMS
-        set rpmdestpath &quot;--define '_topdir ${pkgpath}'&quot;
-    }
-
-    set rpmbuildarch &quot;&quot;
-    if {$supported_archs eq &quot;noarch&quot;} {
-        set rpmbuildarch &quot;--target noarch&quot;
-    } elseif {[variant_exists universal] &amp;&amp; [variant_isset universal]} {
-        set rpmbuildarch &quot;--target fat&quot;
-    } elseif {${configure.build_arch} != &quot;&quot;} {
-        set rpmbuildarch &quot;--target ${configure.build_arch}&quot;
-    }
-
-    foreach dir [list &quot;${prefix}/src/macports/RPMS&quot; &quot;${prefix}/src/apple/RPMS&quot; &quot;/usr/src/apple/RPMS&quot; &quot;/macports/rpms/RPMS&quot;] {
-        foreach arch [list ${configure.build_arch} ${os.arch} &quot;fat&quot; &quot;noarch&quot;] {
-            set rpmpath &quot;$dir/${arch}/${portname}-${portversion}-${portrevision}.${arch}.rpm&quot;
-            if {[file readable $rpmpath] &amp;&amp; ([file mtime ${rpmpath}] &gt;= [file mtime ${portpath}/Portfile])} {
-                ui_debug &quot;$rpmpath&quot;
-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;RPM package for %s version %s is up-to-date&quot;] ${portname} ${portversion}]&quot;
-                return 0
-            }
-        }
-    }
-
-    set specpath ${workpath}/${portname}.spec
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage categories maintainers} {
-        if {![info exists $variable]} {
-            set pkg_$variable &quot;&quot;
-        } else {
-            set pkg_$variable [set $variable]
-        }
-    }
-    set category   [lindex [split $categories &quot; &quot;] 0]
-    set maintainer $maintainers
-
-    set dependencies {}
-    # get deplist
-    set deps [make_dependency_list $portname]
-    set deps [lsort -unique $deps]
-    foreach dep $deps {
-        set name [lindex [split $dep /] 0]
-        set vers [lindex [split $dep /] 1]
-        # don't re-package ourself
-        if {$name != $portname} {
-            lappend dependencies &quot;${name} &gt;= ${vers}&quot;
-        }
-    }
-
-    # depend on system (virtual packages for apple stuff)
-    lappend dependencies &quot;org.macports.${os.platform}${os.major}&quot;
-
-    set listpath ${workpath}/${portname}.filelist
-    system &quot;rm -f '${workpath}/${portname}.filelist' &amp;&amp; touch '${workpath}/${portname}.filelist'&quot;
-    #system &quot;cd '${destpath}' &amp;&amp; find . -type d | grep -v -E '^.$' | sed -e 's/\&quot;/\\\&quot;/g' -e 's/^./%dir \&quot;/' -e 's/$/\&quot;/' &gt; '${workpath}/${portname}.filelist'&quot;
-    system &quot;cd '${destpath}' &amp;&amp; find . ! -type d | grep -v /etc/ | sed -e 's/\&quot;/\\\&quot;/g' -e 's/^./\&quot;/' -e 's/$/\&quot;/' &gt;&gt; '${workpath}/${portname}.filelist'&quot;
-    system &quot;cd '${destpath}' &amp;&amp; find . ! -type d | grep /etc/ | sed -e 's/\&quot;/\\\&quot;/g' -e 's/^./%config \&quot;/' -e 's/$/\&quot;/' &gt;&gt; '${workpath}/${portname}.filelist'&quot;
-    write_spec ${specpath} ${destpath} ${listpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $pkg_homepage $category $license $maintainer $dependencies $epoch
-    system &quot;MP_USERECEIPTS='${portdbpath}/receipts' rpmbuild -bb -v ${rpmbuildarch} ${rpmdestpath} ${specpath}&quot;
-
-    return 0
-}
-
-proc portrpm::make_dependency_list {portname} {
-    set result {}
-    if {[catch {set res [mport_lookup $portname]} error]} {
-        global errorInfo
-        ui_debug &quot;$errorInfo&quot;
-        ui_error &quot;port lookup failed: $error&quot;
-        return 1
-    }
-    foreach {name array} $res {
-        array set portinfo $array
-
-        if {[info exists portinfo(depends_run)] || [info exists portinfo(depends_lib)]} {
-            # get the union of depends_run and depends_lib
-            # xxx: only examines the portfile component of the depspec
-            set depends {}
-            if {[info exists portinfo(depends_run)]} {
-                lappend depends {*}$portinfo(depends_run)
-            }
-            if {[info exists portinfo(depends_lib)]} {
-                lappend depends {*}$portinfo(depends_lib)
-            }
-
-            foreach depspec $depends {
-                set dep [lindex [split $depspec :] end]
-
-                # xxx: nasty hack
-                if {$dep ne &quot;XFree86&quot;} {
-                    lappend result {*}[make_dependency_list $dep]
-                }
-            }
-        }
-        lappend result $portinfo(name)/$portinfo(version)
-        unset portinfo
-    }
-    ui_debug &quot;dependencies for ${portname}: $result&quot;
-    return $result
-}
-
-proc portrpm::word_wrap {orig Length} {
-    set pos 0
-    set line &quot;&quot;
-    set text &quot;&quot;
-
-    set words [split $orig]
-    set numWords [llength $words]
-    for {set cnt 0} {$cnt &lt; $numWords} {incr cnt} {
-        set w [lindex $words $cnt]
-        set wLen [string length $w]
-
-        if {($pos+$wLen &lt; $Length)} {
-            # append word to current line
-            if {$pos} {append line &quot; &quot;; incr pos}
-            append line $w
-            incr pos $wLen
-        } else {
-            # line full =&gt; write buffer and  begin a new line
-            if {[string length $text]} {append text &quot;\n&quot;}
-            append text $line
-            set line $w
-            set pos $wLen
-        }
-    }
-
-    if {[string length $text]} {append text &quot;\n&quot;}
-    if {[string length $line]} {append text $line}
-    return $text
-}
-
-proc portrpm::write_spec {specfile destroot filelist portname portversion portrevision description long_description homepage category license maintainer dependencies epoch} {
-    set specfd [open ${specfile} w+]
-    set origportname ${portname}
-    regsub -all -- &quot;\-&quot; $portversion &quot;_&quot; portversion
-    regsub -all -- &quot;\-&quot; $portname &quot;_&quot; portname
-    puts $specfd &quot;\#Spec file generated by MacPorts
-%define distribution MacPorts
-%define vendor MacPorts
-%define packager ${maintainer}
-
-%define buildroot ${destroot}
-# Avoid cleaning BuildRoot in the pre-install:
-%define __spec_install_pre     %{___build_pre}
-%define __spec_clean_body      %{nil}
-
-Summary: ${description}
-Name: ${portname}
-Version: ${portversion}
-Release: ${portrevision}
-Group: ${category}
-License: ${license}
-URL: ${homepage}
-BuildRoot: ${destroot}
-AutoReq: no&quot;
-    if {$epoch != 0} {
-        puts $specfd &quot;Epoch: ${epoch}&quot;
-    }
-    if {[llength ${dependencies}] != 0} {
-        foreach require ${dependencies} {
-            puts $specfd &quot;Requires: [regsub -all -- &quot;\-&quot; $require &quot;_&quot;]&quot;
-        }
-    }
-    set wrap_description [word_wrap ${long_description} 72]
-    puts $specfd &quot;
-%description
-$wrap_description
-
-%prep
-%build
-%install
-%clean
-
-%files -f ${filelist}&quot;
-    close $specfd
-}
</del></span></pre></div>
<a id="trunkbasesrcpackage10portsrpmtcl"></a>
<div class="delfile"><h4>Deleted: trunk/base/src/package1.0/portsrpm.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/portsrpm.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/portsrpm.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,301 +0,0 @@
</span><del>-# et:ts=4
-# portsrpm.tcl
-# $Id$
-#
-# Copyright (c) 2007, 2009, 2011, 2013 The MacPorts Project
-# Copyright (c) 2002 - 2003 Apple Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. Neither the name of Apple Inc. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-package provide portsrpm 1.0
-package require portutil 1.0
-package require portfetch 1.0
-
-set org.macports.srpm [target_new org.macports.srpm portsrpm::srpm_main]
-target_runtype ${org.macports.srpm} always
-target_provides ${org.macports.srpm} srpm
-target_requires ${org.macports.srpm} checksum
-
-namespace eval portsrpm {
-}
-
-options package.destpath
-
-# Set up defaults
-default srpm.asroot yes
-
-set_ui_prefix
-
-proc portsrpm::srpm_main {args} {
-    global subport version revision UI_PREFIX
-
-    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Creating SRPM package for %s-%s&quot;] ${subport} ${version}]&quot;
-
-    return [srpm_pkg $subport $version $revision]
-}
-
-proc portsrpm::srpm_pkg {portname portversion portrevision} {
-    global UI_PREFIX package.destpath portdbpath destpath workpath distpath \
-           prefix categories maintainers description long_description \
-           homepage epoch portpath distfiles os.platform os.arch os.version \
-           os.major
-
-    set fetch_urls {}
-    portfetch::checkfiles fetch_urls
-
-    set rpmdestpath &quot;&quot;
-    if {![string equal ${package.destpath} ${workpath}] &amp;&amp; ![string equal ${package.destpath} &quot;&quot;]} {
-        set pkgpath ${package.destpath}
-        file mkdir ${pkgpath}/BUILD \
-                   ${pkgpath}/RPMS \
-                   ${pkgpath}/SOURCES \
-                   ${pkgpath}/SPECS \
-                   ${pkgpath}/SRPMS
-        set rpmdestpath &quot;--define '_topdir ${pkgpath}'&quot;
-    }
-
-    foreach dir [list &quot;${prefix}/src/macports/SRPMS&quot; &quot;${prefix}/src/apple/SRPMS&quot; &quot;/usr/src/apple/SRPMS&quot; &quot;/macports/rpms/SRPMS&quot;] {
-        foreach arch {&quot;src&quot; &quot;nosrc&quot;} {
-            set rpmpath &quot;$dir/${portname}-${portversion}-${portrevision}.${arch}.rpm&quot;
-            if {[file readable $rpmpath] &amp;&amp; ([file mtime ${rpmpath}] &gt;= [file mtime ${portpath}/Portfile])} {
-                ui_debug &quot;$rpmpath&quot;
-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;SRPM package for %s version %s is up-to-date&quot;] ${portname} ${portversion}]&quot;
-                return 0
-            }
-        }
-    }
-
-    set specpath ${workpath}/${portname}-port.spec
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage categories maintainers} {
-        if {![info exists $variable]} {
-            set pkg_$variable &quot;&quot;
-        } else {
-            set pkg_$variable [set $variable]
-        }
-    }
-    set category   [lindex [split $categories &quot; &quot;] 0]
-    set license    &quot;Unknown&quot;
-    set maintainer $maintainers
-
-    set dependencies {}
-    # get deplist
-    set deps [make_dependency_list $portname]
-    set deps [lsort -unique $deps]
-    foreach dep $deps {
-        set name [lindex [split $dep /] 0]
-        set vers [lindex [split $dep /] 1]
-        # don't re-package ourself
-        if {$name != $portname} {
-            lappend dependencies &quot;${name} &gt;= ${vers}&quot;
-        }
-    }
-
-    # true = .src.rpm (with distfiles), false = .nosrc.rpm (without distfiles)
-    set src false
-
-    #set sourcespath ${prefix}/src/macports/SOURCES
-    set sourcespath &quot;`rpm --eval %{_sourcedir}`&quot;
-
-    system &quot;cp -p ${portpath}/Portfile ${sourcespath}/$portname-Portfile&quot;
-    if {[info exists ${portpath}/files]} {
-        system &quot;cd ${portpath} &amp;&amp; zip -r -q ${sourcespath}/$portname-files.zip files -x \\*.DS_Store -x files/.svn\\*&quot;
-        set zip $portname-files.zip
-    } else {
-        set zip &quot;&quot;
-    }
-    foreach dist $distfiles {
-        system &quot;cp -p ${distpath}/${dist} ${sourcespath}/${dist}&quot;
-    }
-
-    write_port_spec ${specpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $pkg_homepage $category $license $maintainer $distfiles $fetch_urls $dependencies $epoch $src $zip
-    system &quot;rpmbuild -bs -v --nodeps ${rpmdestpath} ${specpath}&quot;
-
-    return 0
-}
-
-proc portsrpm::make_dependency_list {portname} {
-    set result {}
-    if {[catch {set res [mport_lookup $portname]} error]} {
-        global errorInfo
-        ui_debug &quot;$errorInfo&quot;
-        ui_error &quot;port lookup failed: $error&quot;
-        return 1
-    }
-    foreach {name array} $res {
-        array set portinfo $array
-
-        if {[info exists portinfo(depends_fetch)] || [info exists portinfo(depends_extract)]
-            || [info exists portinfo(depends_build)] || [info exists portinfo(depends_lib)]} {
-            # get the union of depends_fetch, depends_extract, depends_build and depends_lib
-            # xxx: only examines the portfile component of the depspec
-            set depends {}
-            if {[info exists portinfo(depends_fetch)]} {
-                lappend depends {*}$portinfo(depends_fetch)
-            }
-            if {[info exists portinfo(depends_extract)]} {
-                lappend depends {*}$portinfo(depends_extract)
-            }
-            if {[info exists portinfo(depends_build)]} {
-                lappend depends {*}$portinfo(depends_build)
-            }
-            if {[info exists portinfo(depends_lib)]} {
-                lappend depends {*}$portinfo(depends_lib)
-            }
-
-            foreach depspec $depends {
-                set dep [lindex [split $depspec :] end]
-
-                # xxx: nasty hack
-                if {$dep != &quot;XFree86&quot;} {
-                    lappend result {*}[make_dependency_list $dep]
-                }
-            }
-        }
-        lappend result $portinfo(name)/$portinfo(version)
-        unset portinfo
-    }
-    ui_debug &quot;dependencies for ${portname}: $result&quot;
-    return $result
-}
-
-proc portsrpm::word_wrap {orig Length} {
-    set pos 0
-    set line &quot;&quot;
-    set text &quot;&quot;
-
-    set words [split $orig]
-    set numWords [llength $words]
-    for {set cnt 0} {$cnt &lt; $numWords} {incr cnt} {
-        set w [lindex $words $cnt]
-        set wLen [string length $w]
-
-        if {($pos+$wLen &lt; $Length)} {
-            # append word to current line
-            if {$pos} {append line &quot; &quot;; incr pos}
-            append line $w
-            incr pos $wLen
-        } else {
-            # line full =&gt; write buffer and  begin a new line
-            if {[string length $text]} {append text &quot;\n&quot;}
-            append text $line
-            set line $w
-            set pos $wLen
-        }
-    }
-
-    if {[string length $text]} {append text &quot;\n&quot;}
-    if {[string length $line]} {append text $line}
-    return $text
-}
-
-proc portsrpm::write_port_spec {specfile portname portversion portrevision description long_description homepage category license maintainer distfiles fetch_urls dependencies epoch src zip} {
-    set specfd [open ${specfile} w+]
-    set origportname ${portname}
-    regsub -all -- &quot;\-&quot; $portversion &quot;_&quot; portversion
-    regsub -all -- &quot;\-&quot; $portname &quot;_&quot; portname
-    puts $specfd &quot;\#Spec file generated by MacPorts
-%define distribution MacPorts
-%define vendor MacPorts
-%define packager ${maintainer}
-
-Summary: ${description}
-Name: ${portname}
-Version: ${portversion}
-Release: ${portrevision}
-Group: ${category}
-License: ${license}
-URL: ${homepage}
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-Source0: ${portname}-Portfile&quot;
-    if {$zip ne &quot;&quot;} {
-        puts $specfd &quot;Source1: $zip&quot;
-    }
-    if {$epoch != 0} {
-        puts $specfd &quot;Epoch: ${epoch}&quot;
-    }
-    set first 2
-    set count $first
-    puts $specfd &quot;#distfiles&quot;
-    foreach file ${distfiles} {
-
-        puts -nonewline $specfd &quot;Source${count}: &quot;
-        if {![info exists $fetch_urls]} {
-        foreach {url_var distfile}  ${fetch_urls} {
-            if {$distfile eq $file} {
-                 global portfetch::$url_var master_sites
-                 set site [lindex [set $url_var] 0]
-                 set file [portfetch::assemble_url $site $distfile]
-                 break
-            }
-        }
-        }
-        puts $specfd $file
-        if (!$src) {
-            puts $specfd &quot;NoSource: $count&quot;
-        }
-        incr count
-    }
-    puts $specfd &quot;AutoReq: no&quot;
-    if {[llength ${dependencies}] != 0} {
-        foreach require ${dependencies} {
-            puts $specfd &quot;BuildRequires: [regsub -all -- &quot;\-&quot; $require &quot;_&quot;]&quot;
-        }
-    }
-    set wrap_description [word_wrap ${long_description} 72]
-    if {$zip ne &quot;&quot;} {
-        set and &quot;-a 1&quot;
-    } else {
-        set and &quot;&quot;
-    }
-    puts $specfd &quot;
-%description
-$wrap_description
-
-%prep
-%setup -c $and -T
-cp -p %{SOURCE0} Portfile
-#prepare work area
-port fetch
-port checksum
-port extract
-port patch
-
-%build
-port configure
-port build
-
-%install
-rm -rf \$RPM_BUILD_ROOT
-mkdir -p \$RPM_BUILD_ROOT
-port destroot
-port rpm
-
-%clean
-port clean&quot;
-    close $specfd
-}
</del></span></pre></div>
<a id="trunkbasesrcpackage10testsportdpkgtest"></a>
<div class="delfile"><h4>Deleted: trunk/base/src/package1.0/tests/portdpkg.test (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/package1.0/tests/portdpkg.test        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/package1.0/tests/portdpkg.test        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1,73 +0,0 @@
</span><del>-# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-
-package require tcltest 2
-namespace import tcltest::*
-
-set pwd [file dirname [file normalize $argv0]]
-
-source ../package_test_autoconf.tcl
-package require macports 1.0
-
-array set ui_options {}
-#set ui_options(ports_debug)   yes
-#set ui_options(ports_verbose) yes
-mportinit ui_options
-
-package require portdpkg 1.0
-source ./library.tcl
-macports_worker_init
-
-
-test main {
-    Port dpkg main unit test.
-} -constraints { ![catch {exec which dpkg-deb}]
-
-} -setup {
-    set os.platform darwin
-    set os.major 10
-    set os.arch i386
-    set epoch 1
-
-    set destpath $pwd/pkg
-    set configure.build_arch build_arch
-    set package.destpath $pwd/pkg
-
-    set subport fondu
-    set version 060102
-    set revision 1
-    set maintainers {test@macports.org}
-    set description test.description
-    set categories test
-    set supported_archs noarch
-
-
-} -body {
-    if {[catch {portdpkg::main}] != 0} {
-        return &quot;FAIL: cannot create dmg&quot;
-    }
-    if {![file exists $pwd/pkg/fondu_060102-1_all.deb]} {
-        return &quot;FAIL: missing .deb file&quot;
-    }
-    return &quot;Package deb successful.&quot;
-
-} -cleanup {
-    file delete -force $pwd/pkg
-
-} -result &quot;Package deb successful.&quot;
-
-
-test make_dependency_list {
-    Make dependency list unit test.
-} -setup {
-    set subport fondu
-    set version 060102
-    set revision 1
-} -body {
-    if {[portdpkg::make_dependency_list $subport] != &quot;fondu/060102&quot;} {
-        return &quot;FAIL: could not make dependency list&quot;
-    }
-    return &quot;Make dependency list successful.&quot;
-} -result &quot;Make dependency list successful.&quot;
-
-
-cleanupTests
</del></span></pre></div>
<a id="trunkbasesrcportporttcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port/port.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port/port.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/port/port.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -4257,12 +4257,9 @@
</span><span class="cx">     unarchive   [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     dmg         [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     mdmg        [list action_target         [ACTION_ARGS_PORTS]] \
</span><del>-    dpkg        [list action_target         [ACTION_ARGS_PORTS]] \
</del><span class="cx">     mpkg        [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     pkg         [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     portpkg     [list action_target         [ACTION_ARGS_PORTS]] \
</span><del>-    rpm         [list action_target         [ACTION_ARGS_PORTS]] \
-    srpm        [list action_target         [ACTION_ARGS_PORTS]] \
</del><span class="cx">     \
</span><span class="cx">     quit        [list action_exit           [ACTION_ARGS_NONE]] \
</span><span class="cx">     exit        [list action_exit           [ACTION_ARGS_NONE]] \
</span></span></pre></div>
<a id="trunkbasesrcport10portsandboxtcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port1.0/portsandbox.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port1.0/portsandbox.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/port1.0/portsandbox.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> # sandbox-exec -p '(version 1) (allow default) (deny file-write*) (allow file-write* &lt;filter&gt;)' some-command
</span><span class="cx"> proc portsandbox::set_profile {target} {
</span><span class="cx">     global os.major portsandbox_profile workpath distpath altprefix \
</span><del>-        package.destpath configure.ccache ccache_dir rpm.srcdir rpm.tmpdir
</del><ins>+        package.destpath configure.ccache ccache_dir
</ins><span class="cx"> 
</span><span class="cx">     switch $target {
</span><span class="cx">         activate -
</span><span class="lines">@@ -73,10 +73,6 @@
</span><span class="cx">                 set allow_dirs [list ${package.destpath}]
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        rpm -
-        srpm {
-            set allow_dirs [list ${rpm.srcdir} ${rpm.tmpdir}]
-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # TODO: remove altprefix support
</span></span></pre></div>
<a id="trunkbasesrcport10portutiltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port1.0/portutil.tcl (123003 => 123004)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port1.0/portutil.tcl        2014-08-03 16:11:31 UTC (rev 123003)
+++ trunk/base/src/port1.0/portutil.tcl        2014-08-03 18:55:09 UTC (rev 123004)
</span><span class="lines">@@ -1457,9 +1457,6 @@
</span><span class="cx">                         pkg         -
</span><span class="cx">                         portpkg     -
</span><span class="cx">                         mpkg        -
</span><del>-                        rpm         -
-                        srpm        -
-                        dpkg        -
</del><span class="cx">                         mdmg        -
</span><span class="cx">                         &quot;&quot;          { set deptypes &quot;depends_fetch depends_extract depends_lib depends_build depends_run&quot; }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>