<!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>[139406] branches/gsoc15-portfile/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/139406">139406</a></dd>
<dt>Author</dt> <dd>chunyang@macports.org</dd>
<dt>Date</dt> <dd>2015-08-16 01:27:33 -0700 (Sun, 16 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged latest base changes to gsoc15-portfile/base</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesgsoc15portfilebaseChangeLog">branches/gsoc15-portfile/base/ChangeLog</a></li>
<li><a href="#branchesgsoc15portfilebaseMakefilein">branches/gsoc15-portfile/base/Makefile.in</a></li>
<li><a href="#branchesgsoc15portfilebaseconfigure">branches/gsoc15-portfile/base/configure</a></li>
<li><a href="#branchesgsoc15portfilebaseconfigureac">branches/gsoc15-portfile/base/configure.ac</a></li>
<li><a href="#branchesgsoc15portfilebasesrcdarwintracelib10darwintracec">branches/gsoc15-portfile/base/src/darwintracelib1.0/darwintrace.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcdarwintracelib10procc">branches/gsoc15-portfile/base/src/darwintracelib1.0/proc.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmachista10Makefilein">branches/gsoc15-portfile/base/src/machista1.0/Makefile.in</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmachista10machista_wrapc">branches/gsoc15-portfile/base/src/machista1.0/machista_wrap.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmacports10macportstcl">branches/gsoc15-portfile/base/src/macports1.0/macports.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmacports10macports_dlisttcl">branches/gsoc15-portfile/base/src/macports1.0/macports_dlist.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmacports10macports_utiltcl">branches/gsoc15-portfile/base/src/macports1.0/macports_util.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmacports10testsmacportstest">branches/gsoc15-portfile/base/src/macports1.0/tests/macports.test</a></li>
<li><a href="#branchesgsoc15portfilebasesrcmacports10teststesttcl">branches/gsoc15-portfile/base/src/macports1.0/tests/test.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpackage10portarchivefetchtcl">branches/gsoc15-portfile/base/src/package1.0/portarchivefetch.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpackage10teststesttcl">branches/gsoc15-portfile/base/src/package1.0/tests/test.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10Makefilein">branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10Pextlibc">branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10Pextlibh">branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.h</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10systemc">branches/gsoc15-portfile/base/src/pextlib1.0/system.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10tracelibc">branches/gsoc15-portfile/base/src/pextlib1.0/tracelib.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10xinstallc">branches/gsoc15-portfile/base/src/pextlib1.0/xinstall.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcportporttcl">branches/gsoc15-portfile/base/src/port/port.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portchecksumtcl">branches/gsoc15-portfile/base/src/port1.0/portchecksum.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portconfiguretcl">branches/gsoc15-portfile/base/src/port1.0/portconfigure.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portdestroottcl">branches/gsoc15-portfile/base/src/port1.0/portdestroot.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portlinttcl">branches/gsoc15-portfile/base/src/port1.0/portlint.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portlivechecktcl">branches/gsoc15-portfile/base/src/port1.0/portlivecheck.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portmirrortcl">branches/gsoc15-portfile/base/src/port1.0/portmirror.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10porttracetcl">branches/gsoc15-portfile/base/src/port1.0/porttrace.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portuninstalltcl">branches/gsoc15-portfile/base/src/port1.0/portuninstall.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10portutiltcl">branches/gsoc15-portfile/base/src/port1.0/portutil.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcport10teststesttcl">branches/gsoc15-portfile/base/src/port1.0/tests/test.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcregistry20portimagetcl">branches/gsoc15-portfile/base/src/registry2.0/portimage.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcregistry20portuninstalltcl">branches/gsoc15-portfile/base/src/registry2.0/portuninstall.tcl</a></li>
<li><a href="#branchesgsoc15portfilebasesrcregistry20registrytcl">branches/gsoc15-portfile/base/src/registry2.0/registry.tcl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10advflockc">branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10advflockh">branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10flockc">branches/gsoc15-portfile/base/src/pextlib1.0/flock.c</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10flockh">branches/gsoc15-portfile/base/src/pextlib1.0/flock.h</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#branchesgsoc15portfilebase">branches/gsoc15-portfile/base/</a></li>
<li><a href="#branchesgsoc15portfilebasesrcpextlib10Makefilein">branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesgsoc15portfilebase"></a>
<div class="propset"><h4>Property changes: branches/gsoc15-portfile/base</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/branches/gsoc09-logging/base:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base:78828-88375
</span><span class="cx">/branches/gsoc11-statistics/base:79520,79666
</span><span class="cx">/branches/gsoc13-tests:106692-111324
</span><span class="cx">/branches/gsoc14-cleanup:123738-124046
</span><span class="cx">/branches/gsoc14-interactive/base:119516-124240
</span><span class="cx">/branches/universal-sanity/base:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/users/perry/base-bugs_and_notes:45682-46060
</span><span class="cx">/users/perry/base-select:44044-44692
</span><span class="cx">   + /branches/gsoc08-privileges/base:37343-46937
</span><span class="cx">/branches/gsoc09-logging/base:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base:78828-88375
</span><span class="cx">/branches/gsoc11-statistics/base:79520,79666
</span><span class="cx">/branches/gsoc13-tests:106692-111324
</span><span class="cx">/branches/gsoc14-cleanup:123738-124046
</span><span class="cx">/branches/gsoc14-interactive/base:119516-124240
</span><span class="cx">/branches/universal-sanity/base:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base:137076-139405
</span><span class="cx">/users/perry/base-bugs_and_notes:45682-46060
</span><span class="cx">/users/perry/base-select:44044-44692
</span><a id="branchesgsoc15portfilebaseChangeLog"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/ChangeLog (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/ChangeLog        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/ChangeLog        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -4,6 +4,14 @@
</span><span class="cx"> ###
</span><span class="cx"> 
</span><span class="cx"> Release 2.4 (unreleased)
</span><ins>+    - Replaced the strings previously printed by &quot;port help&quot; with much more
+      detailed and current manpages written using asciidoc that open
+      automatically. Added documentation for almost all commands currently
+      implemented by MacPorts.
+      (raimue in branch new-help-system, merge in r123002,
+       manpages written by cal, jmr, raimue, ionic, jeremyhu,
+       #44530, #15467)
+
</ins><span class="cx">     - Added macports_version to the Portfile execution context, to allow
</span><span class="cx">       checking the current MacPorts version in Portfiles.
</span><span class="cx">       (cal in r134511)
</span><span class="lines">@@ -22,7 +30,8 @@
</span><span class="cx"> 
</span><span class="cx">     - Handle SIGTERM and SIGINT (^C) in MacPorts to prevent inconsistencies in
</span><span class="cx">       the registry database when MacPorts is aborted during a critical
</span><del>-      operation. (cal in r118297 and r118298)
</del><ins>+      operation.
+      (cal in r118297 and r118298)
</ins><span class="cx"> 
</span><span class="cx">     - Remove &quot;support&quot; for rpm and deb packages in MacPorts, leaving pkg/mpkg.
</span><span class="cx">       (afb in r123004)
</span></span></pre></div>
<a id="branchesgsoc15portfilebaseMakefilein"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/Makefile.in (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/Makefile.in        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/Makefile.in        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> 
</span><span class="cx"> all:: Mk/macports.autoconf.mk
</span><span class="cx"> 
</span><del>-Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in doc/Makefile.in src/cflib1.0/Makefile.in src/cregistry/Makefile.in src/darwintracelib1.0/Makefile.in src/macports1.0/Makefile.in src/package1.0/Makefile.in src/port/Makefile.in src/port1.0/Makefile.in src/registry2.0/Makefile.in tests/Makefile.in config.status
</del><ins>+Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in doc/Makefile.in src/Makefile.in src/cflib1.0/Makefile.in src/cregistry/Makefile.in src/darwintracelib1.0/Makefile.in src/machista1.0/Makefile.in src/macports1.0/Makefile.in src/package1.0/Makefile.in src/pextlib1.0/Makefile.in src/port/Makefile.in src/port1.0/Makefile.in src/programs/Makefile.in src/programs/daemondo/Makefile.in src/registry2.0/Makefile.in tests/Makefile.in config.status
</ins><span class="cx">         ./config.status
</span><span class="cx">         ${MAKE} clean
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesgsoc15portfilebaseconfigure"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/configure (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/configure        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/configure        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -3038,7 +3038,7 @@
</span><span class="cx">     as_fn_error $? &quot;This version of Mac OS X is not supported
</span><span class="cx">                   Please upgrade at http://store.apple.com/&quot; &quot;$LINENO&quot; 5
</span><span class="cx">     ;;
</span><del>-  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-7]|10.7.[0-4]|10.8.[0-4]|10.9.[0-4])
</del><ins>+  10.4.[0-9]|10.4.10|10.5.[0-7]|10.6.[0-7]|10.7.[0-4]|10.8.[0-4]|10.9.[0-4]|10.10.[0-3])
</ins><span class="cx">     { $as_echo &quot;$as_me:${as_lineno-$LINENO}: WARNING: This version of Mac OS X is out of date&quot; &gt;&amp;5
</span><span class="cx"> $as_echo &quot;$as_me: WARNING: This version of Mac OS X is out of date&quot; &gt;&amp;2;}
</span><span class="cx">     { $as_echo &quot;$as_me:${as_lineno-$LINENO}: WARNING: Please run Software Update to update it&quot; &gt;&amp;5
</span></span></pre></div>
<a id="branchesgsoc15portfilebaseconfigureac"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/configure.ac (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/configure.ac        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/configure.ac        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">     AC_MSG_ERROR([This version of Mac OS X is not supported
</span><span class="cx">                   Please upgrade at http://store.apple.com/])
</span><span class="cx">     ;;
</span><del>-  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]]|10.7.[[0-4]]|10.8.[[0-4]]|10.9.[[0-4]])
</del><ins>+  10.4.[[0-9]]|10.4.10|10.5.[[0-7]]|10.6.[[0-7]]|10.7.[[0-4]]|10.8.[[0-4]]|10.9.[[0-4]]|10.10.[[0-3]])
</ins><span class="cx">     AC_MSG_WARN([This version of Mac OS X is out of date])
</span><span class="cx">     AC_MSG_WARN([Please run Software Update to update it])
</span><span class="cx">     ;;
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcdarwintracelib10darwintracec"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/darwintracelib1.0/darwintrace.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/darwintracelib1.0/darwintrace.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/darwintracelib1.0/darwintrace.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #include &lt;errno.h&gt;
</span><ins>+#include &lt;fcntl.h&gt;
</ins><span class="cx"> #include &lt;inttypes.h&gt;
</span><span class="cx"> #include &lt;pthread.h&gt;
</span><span class="cx"> #include &lt;string.h&gt;
</span><span class="lines">@@ -133,6 +134,13 @@
</span><span class="cx">  */
</span><span class="cx"> static char *filemap;
</span><span class="cx"> 
</span><ins>+static void __darwintrace_sock_destructor(FILE *dtsock) {
+        __darwintrace_close_sock = fileno(dtsock);
+        fclose(dtsock);
+        __darwintrace_close_sock = -1;
+        __darwintrace_sock_set(NULL);
+}
+
</ins><span class="cx"> /**
</span><span class="cx">  * Setup method called as constructor to set up thread-local storage for the
</span><span class="cx">  * thread id and the darwintrace socket.
</span><span class="lines">@@ -142,7 +150,7 @@
</span><span class="cx">                 perror(&quot;darwintrace: pthread_key_create&quot;);
</span><span class="cx">                 abort();
</span><span class="cx">         }
</span><del>-        if (0 != (errno = pthread_key_create(&amp;sock_key, NULL))) {
</del><ins>+        if (0 != (errno = pthread_key_create(&amp;sock_key, (void (*)(void *)) __darwintrace_sock_destructor))) {
</ins><span class="cx">                 perror(&quot;darwintrace: pthread_key_create&quot;);
</span><span class="cx">                 abort();
</span><span class="cx">         }
</span><span class="lines">@@ -333,7 +341,7 @@
</span><span class="cx">                 __darwintrace_close_sock = fileno(dtsock);
</span><span class="cx">                 fclose(dtsock);
</span><span class="cx">                 __darwintrace_close_sock = -1;
</span><del>-                pthread_setspecific(sock_key, NULL);
</del><ins>+                __darwintrace_sock_set(NULL);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -370,6 +378,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (__darwintrace_sock() == NULL) {
</span><span class="cx">                 int sock;
</span><ins>+                int sockflags;
</ins><span class="cx">                 FILE *stream;
</span><span class="cx">                 struct sockaddr_un sun;
</span><span class="cx"> 
</span><span class="lines">@@ -385,6 +394,29 @@
</span><span class="cx">                         abort();
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+                /* Set the close-on-exec flag as early as possible after the socket
+                 * creation. On OS X, there is no way to do this race-condition free
+                 * unless you synchronize around creation and fork(2) -- however,
+                 * blocking in this function is not acceptable for darwintrace, because
+                 * it could possibly run in a signal handler, leading to a deadlock.
+                 *
+                 * The close-on-exec flag is needed because we're using a thread-local
+                 * variable to hold a reference to this socket, but multi-threaded
+                 * programs that fork will only clone the thread that calls fork(2),
+                 * which leaves us with no reference to the other sockets (which are
+                 * inherited, because FDs are process-wide). Consequently, this can
+                 * lead to a resource leak.
+                 */
+                if (-1 == (sockflags = fcntl(sock, F_GETFD))) {
+                        perror(&quot;darwintrace: fcntl(F_GETFD)&quot;);
+                        abort();
+                }
+                sockflags |= FD_CLOEXEC;
+                if (-1 == fcntl(sock, F_SETFD, sockflags)) {
+                        perror(&quot;darwintrace: fcntl(F_SETFD, flags | FD_CLOEXEC)&quot;);
+                        abort();
+                }
+
</ins><span class="cx">                 if (strlen(__env_darwintrace_log) &gt; sizeof(sun.sun_path) - 1) {
</span><span class="cx">                         fprintf(stderr, &quot;darwintrace: Can't connect to socket %s: name too long\n&quot;, __env_darwintrace_log);
</span><span class="cx">                         abort();
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcdarwintracelib10procc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/darwintracelib1.0/proc.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/darwintracelib1.0/proc.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/darwintracelib1.0/proc.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -221,6 +221,8 @@
</span><span class="cx">          * That _does_ save us another ugly loop to get things right. */
</span><span class="cx">         bytes_read = read(fd, buffer, sizeof(buffer) - 1);
</span><span class="cx">         buffer[bytes_read] = '\0';
</span><ins>+        close(fd);
+
</ins><span class="cx">         const char *buffer_end = buffer + bytes_read;
</span><span class="cx">         if (bytes_read &gt; 2 &amp;&amp; buffer[0] == '#' &amp;&amp; buffer[1] == '!') {
</span><span class="cx">                 char *interp = buffer + 2;
</span><span class="lines">@@ -238,12 +240,10 @@
</span><span class="cx"> 
</span><span class="cx">                 /* check the iterpreter against the sandbox */
</span><span class="cx">                 if (!__darwintrace_is_in_sandbox(interp, DT_REPORT | DT_ALLOWDIR | DT_FOLLOWSYMS)) {
</span><del>-                        close(fd);
</del><span class="cx">                         return ENOENT;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        close(fd);
</del><span class="cx">         return 0;
</span><span class="cx"> #undef open
</span><span class="cx"> #undef close
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmachista10Makefilein"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/machista1.0/Makefile.in (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/machista1.0/Makefile.in        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/machista1.0/Makefile.in        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> else
</span><span class="cx">         @echo &quot;Building ${SWIG_SRCS} requires swig, which you apparently did not have installed when configuring MacPorts.&quot; &gt;&amp;2
</span><span class="cx">         @echo &quot;Please install swig and re-run configure&quot; &gt;&amp;2
</span><del>-        @echo &quot;I recommend installing SWIG 1.x in /opt/swig, because as of this writing SWIG 2.x-generated code does not compile warning-free&quot; &gt;&amp;2
</del><span class="cx">         @echo &quot;To use this SWIG, run configure as follows:&quot; &gt;&amp;2
</span><span class="cx">         @echo &quot;    SWIG=/opt/swig/bin/swig ./configure --your-usual-config-flags&quot; &gt;&amp;2
</span><span class="cx">         @echo &quot;If you checked out from svn you can also run svn revert in base/src/machista1.0 to get rid of this error&quot; &gt;&amp;2
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmachista10machista_wrapc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/machista1.0/machista_wrap.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/machista1.0/machista_wrap.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/machista1.0/machista_wrap.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+/*
+ * Non-generated MacPorts addition:
+ * Ignore these warnings in the generated SWIG code below.
+ *
+ * Please retain these #pragmas when regenerating the file!
+ */
+#pragma GCC   diagnostic ignored &quot;-Wmissing-field-initializers&quot;
+#pragma clang diagnostic ignored &quot;-Wmissing-field-initializers&quot;
+
</ins><span class="cx"> /* ----------------------------------------------------------------------------
</span><span class="cx">  * This file was automatically generated by SWIG (http://www.swig.org).
</span><span class="cx">  * Version 3.0.5
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmacports10macportstcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/macports1.0/macports.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/macports1.0/macports.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/macports1.0/macports.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> package require Tclx
</span><span class="cx"> 
</span><span class="cx"> namespace eval macports {
</span><del>-    namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities port_phases
</del><ins>+    namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
</ins><span class="cx">     variable bootstrap_options &quot;\
</span><span class="cx">         portdbpath binpath auto_path extra_env sources_conf prefix portdbformat \
</span><span class="cx">         portarchivetype portautoclean \
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">     variable open_mports {}
</span><span class="cx"> 
</span><span class="cx">     variable ui_priorities &quot;error warn msg notice info debug any&quot;
</span><del>-    variable port_phases &quot;any fetch checksum&quot;
</del><span class="cx">     variable current_phase main
</span><span class="cx"> 
</span><span class="cx">     variable ui_prefix &quot;---&gt; &quot;
</span><span class="lines">@@ -115,9 +114,7 @@
</span><span class="cx"> # ui_options accessor
</span><span class="cx"> proc macports::ui_isset {val} {
</span><span class="cx">     if {[info exists macports::ui_options($val)]} {
</span><del>-        if {$macports::ui_options($val) eq {yes}} {
-            return 1
-        }
</del><ins>+        return [string is true -strict $macports::ui_options($val)]
</ins><span class="cx">     }
</span><span class="cx">     return 0
</span><span class="cx"> }
</span><span class="lines">@@ -126,9 +123,7 @@
</span><span class="cx"> # global_options accessor
</span><span class="cx"> proc macports::global_option_isset {val} {
</span><span class="cx">     if {[info exists macports::global_options($val)]} {
</span><del>-        if {$macports::global_options($val) eq {yes}} {
-            return 1
-        }
</del><ins>+        return [string is true -strict $macports::global_options($val)]
</ins><span class="cx">     }
</span><span class="cx">     return 0
</span><span class="cx"> }
</span><span class="lines">@@ -143,10 +138,6 @@
</span><span class="cx">         ui_debug &quot;Logging disabled, error opening log file: $err&quot;
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><del>-    # Add our log-channel to all already initialized channels
-    foreach key [array names channels] {
-        set macports::channels($key) [concat $macports::channels($key) debuglog]
-    }
</del><span class="cx">     return 0
</span><span class="cx"> }
</span><span class="cx"> proc macports::ch_logging {mport} {
</span><span class="lines">@@ -212,13 +203,13 @@
</span><span class="cx"> proc set_phase {phase} {
</span><span class="cx">     global macports::current_phase
</span><span class="cx">     set macports::current_phase $phase
</span><del>-    if {$phase ne {main}} {
</del><ins>+    if {$phase ne &quot;main&quot;} {
</ins><span class="cx">         set cur_time [clock format [clock seconds] -format  {%+}]
</span><span class="cx">         ui_debug &quot;$phase phase started at $cur_time&quot;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-proc ui_message {priority prefix phase args} {
</del><ins>+proc ui_message {priority prefix args} {
</ins><span class="cx">     global macports::channels ::debuglog macports::current_phase
</span><span class="cx"> 
</span><span class="cx">     # 
</span><span class="lines">@@ -227,39 +218,41 @@
</span><span class="cx">     switch [llength $args] {
</span><span class="cx">        0 - 1 {}
</span><span class="cx">        2 {
</span><del>-           if {[lindex $args 0] ne {-nonewline}} {
-               set hint &quot;error: when 5 arguments are given, 2nd last must be \&quot;-newnewline\&quot;&quot;
-               error &quot;$hint\nusage: ui_message priority prefix phase ?-nonewline? string&quot;
</del><ins>+           if {[lindex $args 0] ne &quot;-nonewline&quot;} {
+               set hint &quot;error: when 4 arguments are given, 3rd must be \&quot;-nonewline\&quot;&quot;
+               error &quot;$hint\nusage: ui_message priority prefix ?-nonewline? string&quot;
</ins><span class="cx">            }
</span><span class="cx">        }
</span><span class="cx">        default {
</span><span class="cx">            set hint &quot;error: too many arguments specified&quot;
</span><del>-           error &quot;$hint\nusage: ui_message priority prefix phase ?-nonewline? string&quot;
</del><ins>+           error &quot;$hint\nusage: ui_message priority prefix ?-nonewline? string&quot;
</ins><span class="cx">        }
</span><span class="cx">     } 
</span><span class="cx"> 
</span><span class="cx">     foreach chan $macports::channels($priority) {
</span><del>-        if {[info exists ::debuglog] &amp;&amp; ($chan eq {debuglog})} {
-            set chan $::debuglog
-            if {[info exists macports::current_phase]} {
-                set phase $macports::current_phase
-            }
-            set strprefix &quot;:${priority}:$phase &quot;
-            if {[lindex $args 0] eq {-nonewline}} {
-                puts -nonewline $chan $strprefix[lindex $args 1]
-            } else {
-                puts $chan $strprefix[lindex $args 0]
-            }
</del><ins>+        if {[lindex $args 0] eq &quot;-nonewline&quot;} {
+            puts -nonewline $chan $prefix[lindex $args 1]
+        } else {
+            puts $chan $prefix[lindex $args 0]
+        }
+    }
</ins><span class="cx"> 
</span><ins>+    if {[info exists ::debuglog]} {
+        set chan $::debuglog
+        if {[info exists macports::current_phase]} {
+            set phase $macports::current_phase
+        }
+        set strprefix &quot;:${priority}:$phase &quot;
+        if {[lindex $args 0] eq &quot;-nonewline&quot;} {
+            puts -nonewline $chan $strprefix[lindex $args 1]
</ins><span class="cx">         } else {
</span><del>-            if {[lindex $args 0] eq {-nonewline}} {
-                puts -nonewline $chan $prefix[lindex $args 1]
-            } else {
-                puts $chan $prefix[lindex $args 0]
</del><ins>+            foreach str [split [lindex $args 0] &quot;\n&quot;] {
+                puts $chan $strprefix$str
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> proc macports::ui_init {priority args} {
</span><span class="cx">     global macports::channels ::debuglog
</span><span class="cx">     set default_channel [macports::ui_channels_default $priority]
</span><span class="lines">@@ -270,24 +263,16 @@
</span><span class="cx">         set channels($priority) $default_channel
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    # if some priority initialized after log file is being created
-    if {[info exists ::debuglog]} {
-        set channels($priority) [concat $channels($priority) debuglog]
-    }
</del><span class="cx">     # Simplify ui_$priority.
</span><span class="cx">     try {
</span><span class="cx">         set prefix [ui_prefix $priority]
</span><span class="cx">     } catch * {
</span><span class="cx">         set prefix [ui_prefix_default $priority]
</span><span class="cx">     }
</span><del>-    set phases {fetch checksum}
</del><span class="cx">     try {
</span><span class="cx">         ::ui_init $priority $prefix $channels($priority) {*}$args
</span><span class="cx">     } catch * {
</span><del>-        interp alias {} ui_$priority {} ui_message $priority $prefix {}
-        foreach phase $phases {
-            interp alias {} ui_${priority}_$phase {} ui_message $priority $prefix $phase
-        }
</del><ins>+        interp alias {} ui_$priority {} ui_message $priority $prefix
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -366,7 +351,7 @@
</span><span class="cx"> # find a binary either in a path defined at MacPorts' configuration time
</span><span class="cx"> # or in the PATH environment variable through macports::binaryInPath (fallback)
</span><span class="cx"> proc macports::findBinary {prog {autoconf_hint {}}} {
</span><del>-    if {$autoconf_hint ne {} &amp;&amp; [file executable $autoconf_hint]} {
</del><ins>+    if {$autoconf_hint ne &quot;&quot; &amp;&amp; [file executable $autoconf_hint]} {
</ins><span class="cx">         return $autoconf_hint
</span><span class="cx">     } else {
</span><span class="cx">         if {[catch {set cmd_path [macports::binaryInPath $prog]} result] == 0} {
</span><span class="lines">@@ -632,8 +617,8 @@
</span><span class="cx"> 
</span><span class="cx">     # set up platform info variables
</span><span class="cx">     set os_arch $tcl_platform(machine)
</span><del>-    if {$os_arch eq {Power Macintosh}} {set os_arch &quot;powerpc&quot;}
-    if {$os_arch eq {i586} || $os_arch eq {i686} || $os_arch eq {x86_64}} {set os_arch &quot;i386&quot;}
</del><ins>+    if {$os_arch eq &quot;Power Macintosh&quot;} {set os_arch &quot;powerpc&quot;}
+    if {$os_arch eq &quot;i586&quot; || $os_arch eq &quot;i686&quot; || $os_arch eq &quot;x86_64&quot;} {set os_arch &quot;i386&quot;}
</ins><span class="cx">     set os_version $tcl_platform(osVersion)
</span><span class="cx">     set os_major [lindex [split $os_version .] 0]
</span><span class="cx">     set os_minor [lindex [split $os_version .] 1]
</span><span class="lines">@@ -661,10 +646,10 @@
</span><span class="cx">     if {[info exists env(HOME)]} {
</span><span class="cx">         set macports::user_home $env(HOME)
</span><span class="cx">         set macports::macports_user_dir [file normalize $macports::autoconf::macports_user_dir]
</span><del>-    } elseif {[info exists env(SUDO_USER)] &amp;&amp; $os_platform eq {darwin}} {
</del><ins>+    } elseif {[info exists env(SUDO_USER)] &amp;&amp; $os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">         set macports::user_home [exec dscl -q . -read /Users/$env(SUDO_USER) NFSHomeDirectory | cut -d ' ' -f 2]
</span><span class="cx">         set macports::macports_user_dir [file join $macports::user_home [string range $macports::autoconf::macports_user_dir 2 end]]
</span><del>-    } elseif {[exec id -u] != 0 &amp;&amp; $os_platform eq {darwin}} {
</del><ins>+    } elseif {[exec id -u] != 0 &amp;&amp; $os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">         set macports::user_home [exec dscl -q . -read /Users/[exec id -un] NFSHomeDirectory | cut -d ' ' -f 2]
</span><span class="cx">         set macports::macports_user_dir [file join $macports::user_home [string range $macports::autoconf::macports_user_dir 2 end]]
</span><span class="cx">     } else {
</span><span class="lines">@@ -694,7 +679,7 @@
</span><span class="cx">             set fd [open $file r]
</span><span class="cx">             while {[gets $fd line] &gt;= 0} {
</span><span class="cx">                 if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
</span><del>-                    if {[lsearch -exact $bootstrap_options $option] &gt;= 0} {
</del><ins>+                    if {$option in $bootstrap_options} {
</ins><span class="cx">                         set macports::$option [string trim $val]
</span><span class="cx">                         global macports::$option
</span><span class="cx">                     }
</span><span class="lines">@@ -710,7 +695,7 @@
</span><span class="cx">         set fd [open $per_user r]
</span><span class="cx">         while {[gets $fd line] &gt;= 0} {
</span><span class="cx">             if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
</span><del>-                if {[lsearch -exact $user_options $option] &gt;= 0} {
</del><ins>+                if {$option in $user_options} {
</ins><span class="cx">                     set macports::$option $val
</span><span class="cx">                     global macports::$option
</span><span class="cx">                 }
</span><span class="lines">@@ -729,10 +714,10 @@
</span><span class="cx">             if {[regexp {^([\w-]+://\S+)(?:\s+\[(\w+(?:,\w+)*)\])?$} $line _ url flags]} {
</span><span class="cx">                 set flags [split $flags ,]
</span><span class="cx">                 foreach flag $flags {
</span><del>-                    if {[lsearch -exact [list nosync default] $flag] == -1} {
</del><ins>+                    if {$flag ni [list nosync default]} {
</ins><span class="cx">                         ui_warn &quot;$sources_conf source '$line' specifies invalid flag '$flag'&quot;
</span><span class="cx">                     }
</span><del>-                    if {$flag eq {default}} {
</del><ins>+                    if {$flag eq &quot;default&quot;} {
</ins><span class="cx">                         if {[info exists sources_default]} {
</span><span class="cx">                             ui_warn &quot;More than one default port source is defined.&quot;
</span><span class="cx">                         }
</span><span class="lines">@@ -820,7 +805,7 @@
</span><span class="cx"> 
</span><span class="cx">     # Format for receipts; currently only &quot;sqlite&quot; is allowed
</span><span class="cx">     # could previously be &quot;flat&quot;, so we switch that to sqlite
</span><del>-    if {![info exists portdbformat] || $portdbformat eq {flat} || $portdbformat eq {sqlite}} {
</del><ins>+    if {![info exists portdbformat] || $portdbformat eq &quot;flat&quot; || $portdbformat eq &quot;sqlite&quot;} {
</ins><span class="cx">         set registry.format receipt_sqlite
</span><span class="cx">     } else {
</span><span class="cx">         return -code error &quot;unknown registry format '$portdbformat' set in macports.conf&quot;
</span><span class="lines">@@ -858,13 +843,13 @@
</span><span class="cx">     if {![info exists macports::global_options(ports_binary_only)]
</span><span class="cx">         &amp;&amp; ![info exists macports::global_options(ports_source_only)]
</span><span class="cx">         &amp;&amp; [info exists macports::buildfromsource]} {
</span><del>-        if {$macports::buildfromsource eq {never}} {
</del><ins>+        if {$macports::buildfromsource eq &quot;never&quot;} {
</ins><span class="cx">             set macports::global_options(ports_binary_only) yes
</span><span class="cx">             set temp_options(ports_binary_only) yes
</span><del>-        } elseif {$macports::buildfromsource eq {always}} {
</del><ins>+        } elseif {$macports::buildfromsource eq &quot;always&quot;} {
</ins><span class="cx">             set macports::global_options(ports_source_only) yes
</span><span class="cx">             set temp_options(ports_source_only) yes
</span><del>-        } elseif {$macports::buildfromsource ne {ifneeded}} {
</del><ins>+        } elseif {$macports::buildfromsource ne &quot;ifneeded&quot;} {
</ins><span class="cx">             ui_warn &quot;'buildfromsource' set to unknown value '$macports::buildfromsource', using 'ifneeded' instead&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -986,7 +971,7 @@
</span><span class="cx"> 
</span><span class="cx">     # Default arch to build for
</span><span class="cx">     if {![info exists macports::build_arch]} {
</span><del>-        if {$os_platform eq {darwin}} {
</del><ins>+        if {$os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">             if {$os_major &gt;= 10} {
</span><span class="cx">                 if {[sysctl hw.cpu64bit_capable] == 1} {
</span><span class="cx">                     set macports::build_arch x86_64
</span><span class="lines">@@ -994,7 +979,7 @@
</span><span class="cx">                     set macports::build_arch i386
</span><span class="cx">                 }
</span><span class="cx">             } else {
</span><del>-                if {$os_arch eq {powerpc}} {
</del><ins>+                if {$os_arch eq &quot;powerpc&quot;} {
</ins><span class="cx">                     set macports::build_arch ppc
</span><span class="cx">                 } else {
</span><span class="cx">                     set macports::build_arch i386
</span><span class="lines">@@ -1076,7 +1061,7 @@
</span><span class="cx">     # don't keep unusable TMPDIR/TMP values
</span><span class="cx">     foreach var {TMP TMPDIR} {
</span><span class="cx">         if {[info exists env($var)] &amp;&amp; [file writable $env($var)] &amp;&amp;
</span><del>-            ([getuid] != 0 || $macportsuser eq {root} ||
</del><ins>+            ([getuid] != 0 || $macportsuser eq &quot;root&quot; ||
</ins><span class="cx">              [file attributes $env($var) -owner] eq $macportsuser)} {
</span><span class="cx">             lappend keepenvkeys $var
</span><span class="cx">         }
</span><span class="lines">@@ -1084,20 +1069,11 @@
</span><span class="cx"> 
</span><span class="cx">     set env_names [array names env]
</span><span class="cx">     foreach envkey $env_names {
</span><del>-        if {[lsearch -exact $keepenvkeys $envkey] == -1} {
</del><ins>+        if {$envkey ni $keepenvkeys} {
</ins><span class="cx">             unset env($envkey)
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    # unset environment an extra time, to work around bugs in Leopard Tcl
-    if {$macosx_version eq {10.5}} {
-        foreach envkey $env_names {
-            if {[lsearch -exact $keepenvkeys $envkey] == -1} {
-                unsetenv $envkey
-            }
-        }
-    }
-
</del><span class="cx">     if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
</span><span class="cx">         # We'll resolve these later (if needed)
</span><span class="cx">         trace add variable macports::xcodeversion read macports::setxcodeinfo
</span><span class="lines">@@ -1105,20 +1081,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if {![info exists developer_dir]} {
</span><del>-        if {$os_platform eq {darwin}} {
</del><ins>+        if {$os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">             trace add variable macports::developer_dir read macports::set_developer_dir
</span><span class="cx">         } else {
</span><span class="cx">             set macports::developer_dir {}
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        if {$os_platform eq {darwin} &amp;&amp; ![file isdirectory $developer_dir]} {
</del><ins>+        if {$os_platform eq &quot;darwin&quot; &amp;&amp; ![file isdirectory $developer_dir]} {
</ins><span class="cx">             ui_warn &quot;Your developer_dir setting in macports.conf points to a non-existing directory.\
</span><span class="cx">                 Since this is known to cause problems, please correct the setting or comment it and let\
</span><span class="cx">                 macports auto-discover the correct path.&quot;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {[getuid] == 0 &amp;&amp; $os_major &gt;= 11 &amp;&amp; $os_platform eq {darwin} &amp;&amp;
</del><ins>+    if {[getuid] == 0 &amp;&amp; $os_major &gt;= 11 &amp;&amp; $os_platform eq &quot;darwin&quot; &amp;&amp;
</ins><span class="cx">             [file isfile &quot;${macports::user_home}/Library/Preferences/com.apple.dt.Xcode.plist&quot;]} {
</span><span class="cx">         macports::copy_xcode_plist $env(HOME)
</span><span class="cx">     }
</span><span class="lines">@@ -1139,39 +1115,39 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Proxy handling (done this late since Pextlib is needed)
</span><del>-    if {![info exists proxy_override_env]} {
</del><ins>+    if {![info exists proxy_override_env] || ![string is true -strict $proxy_override_env]} {
</ins><span class="cx">         set proxy_override_env no
</span><span class="cx">     }
</span><span class="cx">     if {[catch {array set sysConfProxies [get_systemconfiguration_proxies]} result]} {
</span><span class="cx">         return -code error &quot;Unable to get proxy configuration from system: $result&quot;
</span><span class="cx">     }
</span><del>-    if {![info exists env(http_proxy)] || $proxy_override_env eq {yes}} {
</del><ins>+    if {![info exists env(http_proxy)] || $proxy_override_env} {
</ins><span class="cx">         if {[info exists proxy_http]} {
</span><span class="cx">             set env(http_proxy) $proxy_http
</span><span class="cx">         } elseif {[info exists sysConfProxies(proxy_http)]} {
</span><span class="cx">             set env(http_proxy) $sysConfProxies(proxy_http)
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {![info exists env(HTTPS_PROXY)] || $proxy_override_env eq {yes}} {
</del><ins>+    if {![info exists env(HTTPS_PROXY)] || $proxy_override_env} {
</ins><span class="cx">         if {[info exists proxy_https]} {
</span><span class="cx">             set env(HTTPS_PROXY) $proxy_https
</span><span class="cx">         } elseif {[info exists sysConfProxies(proxy_https)]} {
</span><span class="cx">             set env(HTTPS_PROXY) $sysConfProxies(proxy_https)
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {![info exists env(FTP_PROXY)] || $proxy_override_env eq {yes}} {
</del><ins>+    if {![info exists env(FTP_PROXY)] || $proxy_override_env} {
</ins><span class="cx">         if {[info exists proxy_ftp]} {
</span><span class="cx">             set env(FTP_PROXY) $proxy_ftp
</span><span class="cx">         } elseif {[info exists sysConfProxies(proxy_ftp)]} {
</span><span class="cx">             set env(FTP_PROXY) $sysConfProxies(proxy_ftp)
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {![info exists env(RSYNC_PROXY)] || $proxy_override_env eq {yes}} {
</del><ins>+    if {![info exists env(RSYNC_PROXY)] || $proxy_override_env} {
</ins><span class="cx">         if {[info exists proxy_rsync]} {
</span><span class="cx">             set env(RSYNC_PROXY) $proxy_rsync
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {![info exists env(NO_PROXY)] || $proxy_override_env eq {yes}} {
</del><ins>+    if {![info exists env(NO_PROXY)] || $proxy_override_env} {
</ins><span class="cx">         if {[info exists proxy_skip]} {
</span><span class="cx">             set env(NO_PROXY) $proxy_skip
</span><span class="cx">         } elseif {[info exists sysConfProxies(proxy_skip)]} {
</span><span class="lines">@@ -1205,7 +1181,7 @@
</span><span class="cx"> 
</span><span class="cx">     if {![info exists macports::ui_options(ports_no_old_index_warning)]} {
</span><span class="cx">         set default_source_url [lindex $sources_default 0]
</span><del>-        if {[macports::getprotocol $default_source_url] eq {file} || [macports::getprotocol $default_source_url] eq {rsync}} {
</del><ins>+        if {[macports::getprotocol $default_source_url] eq &quot;file&quot; || [macports::getprotocol $default_source_url] eq &quot;rsync&quot;} {
</ins><span class="cx">             set default_portindex [macports::getindex $default_source_url]
</span><span class="cx">             if {[file exists $default_portindex] &amp;&amp; [clock seconds] - [file mtime $default_portindex] &gt; 1209600} {
</span><span class="cx">                 ui_warn &quot;port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.&quot;
</span><span class="lines">@@ -1316,9 +1292,6 @@
</span><span class="cx">     # instantiate the UI call-backs
</span><span class="cx">     foreach priority $macports::ui_priorities {
</span><span class="cx">         $workername alias ui_$priority ui_$priority
</span><del>-        foreach phase $macports::port_phases {
-            $workername alias ui_${priority}_$phase ui_${priority}_$phase
-        }
</del><span class="cx">     }
</span><span class="cx">     # add the UI progress call-back
</span><span class="cx">     if {[info exists macports::ui_options(progress_download)]} {
</span><span class="lines">@@ -1504,7 +1477,7 @@
</span><span class="cx">         ui_msg &quot;$macports::ui_prefix Fetching port $url&quot;
</span><span class="cx">         set fetchfile [file tail $url]
</span><span class="cx">         set progressflag {}
</span><del>-        if {$macports::portverbose eq {yes}} {
</del><ins>+        if {$macports::portverbose} {
</ins><span class="cx">             set progressflag &quot;--progress builtin&quot;
</span><span class="cx">         } elseif {[info exists macports::ui_options(progress_download)]} {
</span><span class="cx">             set progressflag &quot;--progress ${macports::ui_options(progress_download)}&quot;
</span><span class="lines">@@ -1654,7 +1627,7 @@
</span><span class="cx">     # append requested path
</span><span class="cx">     set proposedpath [file join $proposedpath _resources $path]
</span><span class="cx"> 
</span><del>-    if {$fallback eq {yes} &amp;&amp; ![file exists $proposedpath]} {
</del><ins>+    if {$fallback &amp;&amp; ![file exists $proposedpath]} {
</ins><span class="cx">         return [getdefaultportresourcepath $path]
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1670,7 +1643,7 @@
</span><span class="cx">     global macports::sources_default
</span><span class="cx"> 
</span><span class="cx">     set default_source_url [lindex $sources_default 0]
</span><del>-    if {[getprotocol $default_source_url] eq {file}} {
</del><ins>+    if {[getprotocol $default_source_url] eq &quot;file&quot;} {
</ins><span class="cx">         set proposedpath [getportdir $default_source_url]
</span><span class="cx">     } else {
</span><span class="cx">         set proposedpath [getsourcepath $default_source_url]
</span><span class="lines">@@ -1709,12 +1682,12 @@
</span><span class="cx"> 
</span><span class="cx">     # Look for an already-open MPort with the same URL.
</span><span class="cx">     # if found, return the existing reference and bump the refcount.
</span><del>-    if {$nocache ne {}} {
-        set mport {}
</del><ins>+    if {$nocache ne &quot;&quot;} {
+        set mport &quot;&quot;
</ins><span class="cx">     } else {
</span><span class="cx">         set mport [dlist_match_multi $macports::open_mports [list porturl $porturl variations $variations options $options]]
</span><span class="cx">     }
</span><del>-    if {$mport ne {}} {
</del><ins>+    if {$mport ne &quot;&quot;} {
</ins><span class="cx">         # just in case more than one somehow matches
</span><span class="cx">         set mport [lindex $mport 0]
</span><span class="cx">         set refcnt [ditem_key $mport refcnt]
</span><span class="lines">@@ -1788,7 +1761,7 @@
</span><span class="cx">     foreach pg [$regref groups_used] {
</span><span class="cx">         lappend pgdirlist [file join ${registry.path} registry portgroups [$pg sha256]-[$pg size]]
</span><span class="cx">     }
</span><del>-    if {$pgdirlist ne {}} {
</del><ins>+    if {$pgdirlist ne &quot;&quot;} {
</ins><span class="cx">         set options_array(_portgroup_search_dirs) [list $pgdirlist]
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1817,7 +1790,7 @@
</span><span class="cx">     foreach category [lsort -increasing -unique [readdir $root]] {
</span><span class="cx">         set pathToCategory [file join $root $category]
</span><span class="cx">         # process the category dirs but not _resources
</span><del>-        if {[file isdirectory $pathToCategory] &amp;&amp; [string index [file tail $pathToCategory] 0] ne {_}} {
</del><ins>+        if {[file isdirectory $pathToCategory] &amp;&amp; [string index [file tail $pathToCategory] 0] ne &quot;_&quot;} {
</ins><span class="cx">             # Iterate on port directories.
</span><span class="cx">             foreach port [lsort -increasing -unique [readdir $pathToCategory]] {
</span><span class="cx">                 set pathToPort [file join $pathToCategory $port]
</span><span class="lines">@@ -1994,7 +1967,7 @@
</span><span class="cx">         ![catch {$workername eval check_supported_archs} result] &amp;&amp; $result == 0 &amp;&amp;
</span><span class="cx">         ![catch {$workername eval eval_targets $target} result] &amp;&amp; $result == 0} {
</span><span class="cx">         # If auto-clean mode, clean-up after dependency install
</span><del>-        if {$macports::portautoclean eq {yes}} {
</del><ins>+        if {$macports::portautoclean} {
</ins><span class="cx">             # Make sure we are back in the port path before clean
</span><span class="cx">             # otherwise if the current directory had been changed to
</span><span class="cx">             # inside the port,  the next port may fail when trying to
</span><span class="lines">@@ -2032,7 +2005,7 @@
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     set portname [_mportkey $mport subport]
</span><del>-    if {$target ne {clean}} {
</del><ins>+    if {$target ne &quot;clean&quot;} {
</ins><span class="cx">         macports::push_log $mport
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2110,7 +2083,7 @@
</span><span class="cx"> 
</span><span class="cx">         registry::exclusive_unlock
</span><span class="cx"> 
</span><del>-        if {$result ne {}} {
</del><ins>+        if {$result ne &quot;&quot;} {
</ins><span class="cx">             ##
</span><span class="cx">             # When this happens, the failing port usually already printed an
</span><span class="cx">             # error message. Omit this one to avoid cluttering the output and
</span><span class="lines">@@ -2133,13 +2106,13 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         # No dependencies, but we still need to check for conflicts.
</span><del>-        if {$target eq {} || $target eq {install} || $target eq {activate}} {
</del><ins>+        if {$target eq &quot;&quot; || $target eq &quot;install&quot; || $target eq &quot;activate&quot;} {
</ins><span class="cx">             _mporterrorifconflictsinstalled $mport
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     set clean 0
</span><del>-    if {$macports::portautoclean eq {yes} &amp;&amp; ($target eq {install} || $target eq {activate})} {
</del><ins>+    if {$macports::portautoclean &amp;&amp; ($target eq &quot;install&quot; || $target eq &quot;activate&quot;)} {
</ins><span class="cx">         # If we're doing an install, check if we should clean after
</span><span class="cx">         set clean 1
</span><span class="cx">     }
</span><span class="lines">@@ -2188,13 +2161,13 @@
</span><span class="cx">         }
</span><span class="cx">         foreach depspec $portinfo($deptype) {
</span><span class="cx">             set dep_portname [$workername eval _get_dep_port $depspec]
</span><del>-            if {$dep_portname ne {} &amp;&amp; ![info exists depscache(port:$dep_portname)] &amp;&amp; [$test $dep_portname]} {
</del><ins>+            if {$dep_portname ne &quot;&quot; &amp;&amp; ![info exists depscache(port:$dep_portname)] &amp;&amp; [$test $dep_portname]} {
</ins><span class="cx">                 set variants {}
</span><span class="cx"> 
</span><span class="cx">                 # check that the dep has the required archs
</span><span class="cx">                 set active_archs [_get_registry_archs $dep_portname]
</span><span class="cx">                 if {$deptype ni {depends_fetch depends_extract} &amp;&amp; $active_archs ni {{} noarch}
</span><del>-                    &amp;&amp; $required_archs ne {noarch} &amp;&amp; $dep_portname ni $depends_skip_archcheck} {
</del><ins>+                    &amp;&amp; $required_archs ne &quot;noarch&quot; &amp;&amp; $dep_portname ni $depends_skip_archcheck} {
</ins><span class="cx">                     set missing {}
</span><span class="cx">                     foreach arch $required_archs {
</span><span class="cx">                         if {$arch ni $active_archs} {
</span><span class="lines">@@ -2210,13 +2183,13 @@
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="cx">                     if {[llength $missing] &gt; 0} {
</span><del>-                        if {[info exists dep_portinfo(variants)] &amp;&amp; [lsearch -exact $dep_portinfo(variants) universal] != -1} {
</del><ins>+                        if {[info exists dep_portinfo(variants)] &amp;&amp; &quot;universal&quot; in $dep_portinfo(variants)} {
</ins><span class="cx">                             # dep offers a universal variant
</span><span class="cx">                             if {[llength $active_archs] == 1} {
</span><span class="cx">                                 # not installed universal
</span><span class="cx">                                 set missing {}
</span><span class="cx">                                 foreach arch $required_archs {
</span><del>-                                    if {[lsearch -exact $macports::universal_archs $arch] == -1} {
</del><ins>+                                    if {$arch ni $macports::universal_archs} {
</ins><span class="cx">                                         lappend missing $arch
</span><span class="cx">                                     }
</span><span class="cx">                                 }
</span><span class="lines">@@ -2325,7 +2298,7 @@
</span><span class="cx"> 
</span><span class="cx"> proc macports::getindex {source} {
</span><span class="cx">     # Special case file:// sources
</span><del>-    if {[macports::getprotocol $source] eq {file}} {
</del><ins>+    if {[macports::getprotocol $source] eq &quot;file&quot;} {
</ins><span class="cx">         return [file join [macports::getportdir $source] PortIndex]
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2426,7 +2399,7 @@
</span><span class="cx">     foreach source $sources {
</span><span class="cx">         set flags [lrange $source 1 end]
</span><span class="cx">         set source [lindex $source 0]
</span><del>-        if {[lsearch -exact $flags nosync] != -1} {
</del><ins>+        if {&quot;nosync&quot; in $flags} {
</ins><span class="cx">             ui_debug &quot;Skipping $source&quot;
</span><span class="cx">             continue
</span><span class="cx">         }
</span><span class="lines">@@ -2465,7 +2438,7 @@
</span><span class="cx">                     set destdir [file dirname $destdir]
</span><span class="cx">                 } else {
</span><span class="cx">                     # Keep rsync happy with a trailing slash
</span><del>-                    if {[string index $source end] ne {/}} {
</del><ins>+                    if {[string index $source end] ne &quot;/&quot;} {
</ins><span class="cx">                         append source /
</span><span class="cx">                     }
</span><span class="cx">                     # don't sync PortIndex yet; we grab the platform specific one afterwards
</span><span class="lines">@@ -2606,7 +2579,7 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if {(![info exists options(ports_force)] || $options(ports_force) ne {yes}) &amp;&amp; $updated &lt;= 0} {
</del><ins>+                if {(![info exists options(ports_force)] || !$options(ports_force)) &amp;&amp; $updated &lt;= 0} {
</ins><span class="cx">                     ui_info &quot;No updates for $source&quot;
</span><span class="cx">                     continue
</span><span class="cx">                 }
</span><span class="lines">@@ -2614,7 +2587,7 @@
</span><span class="cx">                 file mkdir $destdir
</span><span class="cx"> 
</span><span class="cx">                 set progressflag {}
</span><del>-                if {$macports::portverbose eq {yes}} {
</del><ins>+                if {$macports::portverbose} {
</ins><span class="cx">                     set progressflag &quot;--progress builtin&quot;
</span><span class="cx">                     set verboseflag &quot;-v&quot;
</span><span class="cx">                 } elseif {[info exists macports::ui_options(progress_download)]} {
</span><span class="lines">@@ -2629,7 +2602,7 @@
</span><span class="cx">                 } catch {{POSIX SIG SIGTERM} eCode eMessage} {
</span><span class="cx">                     throw
</span><span class="cx">                 } catch {{*} eCode eMessage} {
</span><del>-                    ui_error [msgcat::mc &quot;Fetching %s failed: %s&quot; $source $error]
</del><ins>+                    ui_error [msgcat::mc &quot;Fetching %s failed: %s&quot; $source $eMessage]
</ins><span class="cx">                     incr numfailed
</span><span class="cx">                     continue
</span><span class="cx">                 }
</span><span class="lines">@@ -2740,7 +2713,7 @@
</span><span class="cx"> proc mportsearch {pattern {case_sensitive yes} {matchstyle regexp} {field name}} {
</span><span class="cx">     global macports::sources
</span><span class="cx">     set matches [list]
</span><del>-    set easy [expr {$field eq {name}}]
</del><ins>+    set easy [expr {$field eq &quot;name&quot;}]
</ins><span class="cx"> 
</span><span class="cx">     set found 0
</span><span class="cx">     foreach source $sources {
</span><span class="lines">@@ -2769,7 +2742,7 @@
</span><span class="cx"> 
</span><span class="cx">                     switch -- $matchstyle {
</span><span class="cx">                         exact {
</span><del>-                            if {$case_sensitive eq &quot;yes&quot;} {
</del><ins>+                            if {$case_sensitive} {
</ins><span class="cx">                                 set compres [string compare $pattern $target]
</span><span class="cx">                             } else {
</span><span class="cx">                                 set compres [string compare -nocase $pattern $target]
</span><span class="lines">@@ -2777,14 +2750,14 @@
</span><span class="cx">                             set matchres [expr {0 == $compres}]
</span><span class="cx">                         }
</span><span class="cx">                         glob {
</span><del>-                            if {$case_sensitive eq &quot;yes&quot;} {
</del><ins>+                            if {$case_sensitive} {
</ins><span class="cx">                                 set matchres [string match $pattern $target]
</span><span class="cx">                             } else {
</span><span class="cx">                                 set matchres [string match -nocase $pattern $target]
</span><span class="cx">                             }
</span><span class="cx">                         }
</span><span class="cx">                         regexp {
</span><del>-                            if {$case_sensitive eq &quot;yes&quot;} {
</del><ins>+                            if {$case_sensitive} {
</ins><span class="cx">                                 set matchres [regexp -- $pattern $target]
</span><span class="cx">                             } else {
</span><span class="cx">                                 set matchres [regexp -nocase -- $pattern $target]
</span><span class="lines">@@ -3064,7 +3037,11 @@
</span><span class="cx">                 set offset [tell $indexfd]
</span><span class="cx">             }
</span><span class="cx">             puts -nonewline $quickfd $quicklist
</span><del>-        } catch * {
</del><ins>+        } catch {{POSIX SIG SIGINT} eCode eMessage} {
+            throw
+        } catch {{POSIX SIG SIGTERM} eCode eMessage} {
+            throw
+        } catch {{*} eCode eMessage} {
</ins><span class="cx">             ui_warn &quot;It looks like your PortIndex file $index may be corrupt.&quot;
</span><span class="cx">             throw
</span><span class="cx">         } finally {
</span><span class="lines">@@ -3193,7 +3170,7 @@
</span><span class="cx">                 set nrequired [llength $required_archs]
</span><span class="cx">                 foreach key $prev_seenkeys {
</span><span class="cx">                     set key_archs [lrange [split $key ,] 1 end]
</span><del>-                    if {$key_archs eq {noarch} || $required_archs eq {noarch} || [llength $key_archs] &gt; $nrequired} {
</del><ins>+                    if {$key_archs eq &quot;noarch&quot; || $required_archs eq &quot;noarch&quot; || [llength $key_archs] &gt; $nrequired} {
</ins><span class="cx">                         set seen 1
</span><span class="cx">                         set seenkey $key
</span><span class="cx">                         break
</span><span class="lines">@@ -3212,12 +3189,12 @@
</span><span class="cx">             # If we don't skip or if it is not, add it to the list.
</span><span class="cx">             set present [_mportispresent $mport $depspec]
</span><span class="cx"> 
</span><del>-            if {!$skipSatisfied &amp;&amp; $dep_portname eq {}} {
</del><ins>+            if {!$skipSatisfied &amp;&amp; $dep_portname eq &quot;&quot;} {
</ins><span class="cx">                 set dep_portname [lindex [split $depspec :] end]
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             set check_archs 0
</span><del>-            if {$dep_portname ne {} &amp;&amp; $deptype ni {depends_fetch depends_extract}
</del><ins>+            if {$dep_portname ne &quot;&quot; &amp;&amp; $deptype ni {depends_fetch depends_extract}
</ins><span class="cx">                 &amp;&amp; $dep_portname ni $depends_skip_archcheck} {
</span><span class="cx">                 set check_archs 1
</span><span class="cx">             }
</span><span class="lines">@@ -3260,7 +3237,7 @@
</span><span class="cx">                     # because mportexec only closes each open mport once.
</span><span class="cx">                     set depport [dlist_match_multi $macports::open_mports [list porturl $dep_portinfo(porturl) options $dep_options]]
</span><span class="cx"> 
</span><del>-                    if {$depport eq {}} {
</del><ins>+                    if {$depport eq &quot;&quot;} {
</ins><span class="cx">                         # We haven't opened this one yet.
</span><span class="cx">                         set depport [mportopen $dep_portinfo(porturl) $dep_options $variations]
</span><span class="cx">                     }
</span><span class="lines">@@ -3280,7 +3257,7 @@
</span><span class="cx">                 if {[info exists dep_portinfo(variants)] &amp;&amp; {universal} in $dep_portinfo(variants)} {
</span><span class="cx">                     # a universal variant is offered
</span><span class="cx">                     set has_universal 1
</span><del>-                    if {![info exists variation_array(universal)] || $variation_array(universal) ne {+}} {
</del><ins>+                    if {![info exists variation_array(universal)] || $variation_array(universal) ne &quot;+&quot;} {
</ins><span class="cx">                         set variation_array(universal) +
</span><span class="cx">                         # try again with +universal
</span><span class="cx">                         set depport [mportopen $dep_portinfo(porturl) $dep_options [array get variation_array]]
</span><span class="lines">@@ -3306,7 +3283,7 @@
</span><span class="cx">                 ditem_append_unique $mport requires $depport_provides
</span><span class="cx">                 # record actual archs we ended up getting
</span><span class="cx">                 set port_seen(${dep_portname},[join [macports::_mport_archs $depport] ,]) $depport_provides
</span><del>-            } elseif {$present &amp;&amp; $dep_portname ne {}} {
</del><ins>+            } elseif {$present &amp;&amp; $dep_portname ne &quot;&quot;} {
</ins><span class="cx">                 # record actual installed archs
</span><span class="cx">                 set port_seen(${dep_portname},[join [macports::_active_archs $dep_portname] ,]) 0
</span><span class="cx">             }
</span><span class="lines">@@ -3319,7 +3296,7 @@
</span><span class="cx">         foreach depport $depPorts {
</span><span class="cx">             # Any of these may have been closed by a previous recursive call
</span><span class="cx">             # and replaced by a universal version. This is fine, just skip.
</span><del>-            if {[ditem_key $depport] ne {}} {
</del><ins>+            if {[ditem_key $depport] ne &quot;&quot;} {
</ins><span class="cx">                 set res [mportdepends $depport {} $recurseDeps $skipSatisfied 1]
</span><span class="cx">                 if {$res != 0} {
</span><span class="cx">                     return $res
</span><span class="lines">@@ -3333,15 +3310,15 @@
</span><span class="cx"> 
</span><span class="cx"> # check if the given mport can support dependents with the given archs
</span><span class="cx"> proc macports::_mport_supports_archs {mport required_archs} {
</span><del>-    if {$required_archs eq {noarch}} {
</del><ins>+    if {$required_archs eq &quot;noarch&quot;} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     set provided_archs [_mport_archs $mport]
</span><del>-    if {$provided_archs eq {noarch}} {
</del><ins>+    if {$provided_archs eq &quot;noarch&quot;} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     foreach arch $required_archs {
</span><del>-        if {[lsearch -exact $provided_archs $arch] == -1} {
</del><ins>+        if {$arch ni $provided_archs} {
</ins><span class="cx">             return 0
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -3356,14 +3333,14 @@
</span><span class="cx"> 
</span><span class="cx"> # check if the active version of a port supports the given archs
</span><span class="cx"> proc macports::_active_supports_archs {portname required_archs} {
</span><del>-    if {$required_archs eq {noarch}} {
</del><ins>+    if {$required_archs eq &quot;noarch&quot;} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     if {[catch {registry::active $portname}]} {
</span><span class="cx">         return 0
</span><span class="cx">     }
</span><span class="cx">     set provided_archs [_active_archs $portname]
</span><del>-    if {$provided_archs eq {noarch} || $provided_archs eq {} || $provided_archs == 0} {
</del><ins>+    if {$provided_archs eq &quot;noarch&quot; || $provided_archs eq &quot;&quot; || $provided_archs == 0} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     foreach arch $required_archs {
</span><span class="lines">@@ -3394,10 +3371,10 @@
</span><span class="cx">     set s [expr {[llength $required_archs] == 1 ? &quot;&quot; : &quot;s&quot;}]
</span><span class="cx"> 
</span><span class="cx">     ui_error &quot;Cannot install $port for the arch${s} '$required_archs' because&quot;
</span><del>-    if {$supported_archs ne {}} {
</del><ins>+    if {$supported_archs ne &quot;&quot;} {
</ins><span class="cx">         set ss [expr {[llength $supported_archs] == 1 ? &quot;&quot; : &quot;s&quot;}]
</span><span class="cx">         foreach arch $required_archs {
</span><del>-            if {[lsearch -exact $supported_archs $arch] == -1} {
</del><ins>+            if {$arch ni $supported_archs} {
</ins><span class="cx">                 ui_error &quot;its dependency $dep only supports the arch${ss} '$supported_archs'.&quot;
</span><span class="cx">                 return
</span><span class="cx">             }
</span><span class="lines">@@ -3405,7 +3382,7 @@
</span><span class="cx">     }
</span><span class="cx">     if {$has_universal} {
</span><span class="cx">         foreach arch $required_archs {
</span><del>-            if {[lsearch -exact $universal_archs $arch] == -1} {
</del><ins>+            if {$arch ni $universal_archs} {
</ins><span class="cx">                 ui_error &quot;its dependency $dep does not build for the required arch${s} by default&quot;
</span><span class="cx">                 ui_error &quot;and the configured universal_archs '$universal_archs' are not sufficient.&quot;
</span><span class="cx">                 return
</span><span class="lines">@@ -3422,7 +3399,7 @@
</span><span class="cx"> proc macports::_mport_has_deptypes {mport deptypes} {
</span><span class="cx">     array set portinfo [mportinfo $mport]
</span><span class="cx">     foreach type $deptypes {
</span><del>-        if {[info exists portinfo($type)] &amp;&amp; $portinfo($type) ne {}} {
</del><ins>+        if {[info exists portinfo($type)] &amp;&amp; $portinfo($type) ne &quot;&quot;} {
</ins><span class="cx">             return 1
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -3497,18 +3474,18 @@
</span><span class="cx">     array set options $optionslist
</span><span class="cx"> 
</span><span class="cx">     # variable that indicates whether we actually updated base
</span><del>-    if {$updatestatusvar ne {}} {
</del><ins>+    if {$updatestatusvar ne &quot;&quot;} {
</ins><span class="cx">         upvar $updatestatusvar updatestatus
</span><span class="cx">         set updatestatus no
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # are we syncing a tarball? (implies detached signature)
</span><span class="cx">     set is_tarball 0
</span><del>-    if {[string range $rsync_dir end-3 end] eq {.tar}} {
</del><ins>+    if {[string range $rsync_dir end-3 end] eq &quot;.tar&quot;} {
</ins><span class="cx">         set is_tarball 1
</span><span class="cx">         set mp_source_path [file join $portdbpath sources $rsync_server [file dirname $rsync_dir]]
</span><span class="cx">     } else {
</span><del>-        if {[string index $rsync_dir end] ne {/}} {
</del><ins>+        if {[string index $rsync_dir end] ne &quot;/&quot;} {
</ins><span class="cx">             append rsync_dir /
</span><span class="cx">         }
</span><span class="cx">         set mp_source_path [file join $portdbpath sources $rsync_server $rsync_dir]
</span><span class="lines">@@ -3567,7 +3544,7 @@
</span><span class="cx">     # echo current MacPorts version
</span><span class="cx">     ui_msg &quot;MacPorts base version $macports::autoconf::macports_version installed,&quot;
</span><span class="cx"> 
</span><del>-    if {[info exists options(ports_force)] &amp;&amp; $options(ports_force) eq {yes}} {
</del><ins>+    if {[info exists options(ports_force)] &amp;&amp; $options(ports_force)} {
</ins><span class="cx">         set use_the_force_luke yes
</span><span class="cx">         ui_debug &quot;Forcing a rebuild and reinstallation of MacPorts&quot;
</span><span class="cx">     } else {
</span><span class="lines">@@ -3592,7 +3569,7 @@
</span><span class="cx">     set comp [vercmp $macports_version_new $macports::autoconf::macports_version]
</span><span class="cx"> 
</span><span class="cx">     # syncing ports tree.
</span><del>-    if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne {yes}} {
</del><ins>+    if {![info exists options(ports_selfupdate_nosync)] || !$options(ports_selfupdate_nosync)} {
</ins><span class="cx">         if {$comp &gt; 0} {
</span><span class="cx">             # updated portfiles potentially need new base to parse - tell sync to try to
</span><span class="cx">             # use prefabricated PortIndex files and signal if it couldn't
</span><span class="lines">@@ -3603,8 +3580,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {$use_the_force_luke eq {yes} || $comp &gt; 0} {
-        if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun) eq {yes}} {
</del><ins>+    if {$use_the_force_luke || $comp &gt; 0} {
+        if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun)} {
</ins><span class="cx">             ui_msg &quot;$macports::ui_prefix MacPorts base is outdated, selfupdate would install $macports_version_new (dry run)&quot;
</span><span class="cx">         } else {
</span><span class="cx">             ui_msg &quot;$macports::ui_prefix MacPorts base is outdated, installing new version $macports_version_new&quot;
</span><span class="lines">@@ -3613,27 +3590,27 @@
</span><span class="cx">             set owner [file attributes $prefix -owner]
</span><span class="cx">             set group [file attributes $prefix -group]
</span><span class="cx">             set perms [string range [file attributes $prefix -permissions] end-3 end]
</span><del>-            if {$tcl_platform(user) ne {root} &amp;&amp; $tcl_platform(user) ne $owner} {
</del><ins>+            if {$tcl_platform(user) ne &quot;root&quot; &amp;&amp; $tcl_platform(user) ne $owner} {
</ins><span class="cx">                 return -code error &quot;User $tcl_platform(user) does not own $prefix - try using sudo&quot;
</span><span class="cx">             }
</span><span class="cx">             ui_debug &quot;Permissions OK&quot;
</span><span class="cx"> 
</span><span class="cx">             set configure_args &quot;--prefix=[macports::shellescape $prefix] --with-install-user=[macports::shellescape $owner] --with-install-group=[macports::shellescape $group] --with-directory-mode=[macports::shellescape $perms]&quot;
</span><span class="cx">             # too many users have an incompatible readline in /usr/local, see ticket #10651
</span><del>-            if {$tcl_platform(os) ne {Darwin} || $prefix eq {/usr/local}
-                || ([glob -nocomplain /usr/local/lib/lib{readline,history}*] eq {} &amp;&amp; [glob -nocomplain /usr/local/include/readline/*.h] eq {})} {
</del><ins>+            if {$tcl_platform(os) ne &quot;Darwin&quot; || $prefix eq &quot;/usr/local&quot;
+                || ([glob -nocomplain /usr/local/lib/lib{readline,history}*] eq &quot;&quot; &amp;&amp; [glob -nocomplain /usr/local/include/readline/*.h] eq &quot;&quot;)} {
</ins><span class="cx">                 append configure_args &quot; --enable-readline&quot;
</span><span class="cx">             } else {
</span><span class="cx">                 ui_warn &quot;Disabling readline support due to readline in /usr/local&quot;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if {$prefix eq {/usr/local} || $prefix eq {/usr}} {
</del><ins>+            if {$prefix eq &quot;/usr/local&quot; || $prefix eq &quot;/usr&quot;} {
</ins><span class="cx">                 append configure_args &quot; --with-unsupported-prefix&quot;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             # Choose a sane compiler
</span><span class="cx">             set cc_arg {}
</span><del>-            if {$::macports::os_platform eq {darwin}} {
</del><ins>+            if {$::macports::os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">                 set cc_arg &quot;CC=/usr/bin/cc OBJC=/usr/bin/cc &quot;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -3659,7 +3636,7 @@
</span><span class="cx">         return -code error &quot;Couldn't change permissions of the MacPorts sources at $mp_source_path to ${sources_owner}: $result&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {![info exists options(ports_selfupdate_nosync)] || $options(ports_selfupdate_nosync) ne {yes}} {
</del><ins>+    if {![info exists options(ports_selfupdate_nosync)] || !$options(ports_selfupdate_nosync)} {
</ins><span class="cx">         if {[info exists needed_portindex]} {
</span><span class="cx">             ui_msg &quot;Not all sources could be fully synced using the old version of MacPorts.&quot;
</span><span class="cx">             ui_msg &quot;Please run selfupdate again now that MacPorts base has been updated.&quot;
</span><span class="lines">@@ -3684,7 +3661,7 @@
</span><span class="cx">         ui_error &quot;$portname is not installed&quot;
</span><span class="cx">         return 3
</span><span class="cx">     }
</span><del>-    if {$depscachename ne {}} {
</del><ins>+    if {$depscachename ne &quot;&quot;} {
</ins><span class="cx">         upvar $depscachename depscache
</span><span class="cx">     } else {
</span><span class="cx">         array set depscache {}
</span><span class="lines">@@ -3711,13 +3688,13 @@
</span><span class="cx">     global macports::global_variations
</span><span class="cx">     array set options $optionslist
</span><span class="cx"> 
</span><del>-    if {$depscachename ne {}} {
</del><ins>+    if {$depscachename ne &quot;&quot;} {
</ins><span class="cx">         upvar $depscachename depscache
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # Is this a dry run?
</span><span class="cx">     set is_dryrun no
</span><del>-    if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun) eq {yes}} {
</del><ins>+    if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun)} {
</ins><span class="cx">         set is_dryrun yes
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3745,7 +3722,7 @@
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     # argh! port doesnt exist!
</span><del>-    if {$result eq {}} {
</del><ins>+    if {$result eq &quot;&quot;} {
</ins><span class="cx">         ui_warn &quot;No port $portname found in the index.&quot;
</span><span class="cx">         return 2
</span><span class="cx">     }
</span><span class="lines">@@ -3840,7 +3817,7 @@
</span><span class="cx">         set version [lindex $i 1]
</span><span class="cx">         set revision [lindex $i 2]
</span><span class="cx">         set epoch [lindex $i 5]
</span><del>-        if {$version_installed eq {} || ($epoch &gt; $epoch_installed &amp;&amp; $version ne $version_installed) ||
</del><ins>+        if {$version_installed eq &quot;&quot; || ($epoch &gt; $epoch_installed &amp;&amp; $version ne $version_installed) ||
</ins><span class="cx">                 ($epoch &gt;= $epoch_installed &amp;&amp; [vercmp $version $version_installed] &gt; 0)
</span><span class="cx">                 || ($epoch &gt;= $epoch_installed
</span><span class="cx">                     &amp;&amp; [vercmp $version $version_installed] == 0
</span><span class="lines">@@ -3937,7 +3914,7 @@
</span><span class="cx">             ui_error &quot;port lookup failed: $result&quot;
</span><span class="cx">             return 1
</span><span class="cx">         }
</span><del>-        if {$result eq {}} {
</del><ins>+        if {$result eq &quot;&quot;} {
</ins><span class="cx">             ui_error &quot;No port $portinfo(replaced_by) found.&quot;
</span><span class="cx">             return 1
</span><span class="cx">         }
</span><span class="lines">@@ -3989,10 +3966,10 @@
</span><span class="cx">         } elseif {$epoch_installed &lt; $epoch_in_tree &amp;&amp; $version_installed ne $version_in_tree} {
</span><span class="cx">             set build_override 1
</span><span class="cx">             ui_debug &quot;epoch override ... upgrading!&quot;
</span><del>-        } elseif {[info exists options(ports_upgrade_enforce-variants)] &amp;&amp; $options(ports_upgrade_enforce-variants) eq {yes}
</del><ins>+        } elseif {[info exists options(ports_upgrade_enforce-variants)] &amp;&amp; $options(ports_upgrade_enforce-variants)
</ins><span class="cx">                   &amp;&amp; [info exists portinfo(canonical_active_variants)] &amp;&amp; $portinfo(canonical_active_variants) ne $oldvariant} {
</span><span class="cx">             ui_debug &quot;variant override ... upgrading!&quot;
</span><del>-        } elseif {$os_platform_installed ne {} &amp;&amp; $os_major_installed ne {} &amp;&amp; $os_platform_installed != 0
</del><ins>+        } elseif {$os_platform_installed ne &quot;&quot; &amp;&amp; $os_major_installed ne &quot;&quot; &amp;&amp; $os_platform_installed != 0
</ins><span class="cx">                   &amp;&amp; ([_mportkey $mport {{os.platform}}] ne $os_platform_installed
</span><span class="cx">                   || [_mportkey $mport {{os.major}}] != $os_major_installed)} {
</span><span class="cx">             ui_debug &quot;platform mismatch ... upgrading!&quot;
</span><span class="lines">@@ -4121,7 +4098,7 @@
</span><span class="cx">         set options(ports_force) yes
</span><span class="cx">         set existing_epoch [lindex [registry::installed $newname ${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants)] 0 5]
</span><span class="cx">         set newregref [registry::open_entry $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) $existing_epoch]
</span><del>-        if {$is_dryrun eq {yes}} {
</del><ins>+        if {$is_dryrun} {
</ins><span class="cx">             ui_msg &quot;Skipping uninstall $newname @${version_in_tree}_${revision_in_tree}$portinfo(canonical_active_variants) (dry run)&quot;
</span><span class="cx">         } elseif {![registry::run_target $newregref uninstall [array get options]]
</span><span class="cx">                   &amp;&amp; [catch {registry_uninstall::uninstall $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) [array get options]} result]} {
</span><span class="lines">@@ -4144,7 +4121,7 @@
</span><span class="cx">         # we have to force the deactivate in case of dependents
</span><span class="cx">         set force_cur [info exists options(ports_force)]
</span><span class="cx">         set options(ports_force) yes
</span><del>-        if {$is_dryrun eq {yes}} {
</del><ins>+        if {$is_dryrun} {
</ins><span class="cx">             ui_msg &quot;Skipping deactivate $portname @${version_active}_${revision_active}$variant_active (dry run)&quot;
</span><span class="cx">         } elseif {![catch {registry::active $portname}] &amp;&amp;
</span><span class="cx">                   ![registry::run_target $regref deactivate [array get options]]
</span><span class="lines">@@ -4166,7 +4143,7 @@
</span><span class="cx">         set uninstall_later yes
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {$is_dryrun eq {yes}} {
</del><ins>+    if {$is_dryrun} {
</ins><span class="cx">         if {$anyactive} {
</span><span class="cx">             ui_msg &quot;Skipping deactivate $portname @${version_active}_${revision_active}$variant_active (dry run)&quot;
</span><span class="cx">         }
</span><span class="lines">@@ -4210,7 +4187,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if {[info exists uninstall_later] &amp;&amp; $uninstall_later eq &quot;yes&quot;} {
</del><ins>+    if {[info exists uninstall_later] &amp;&amp; $uninstall_later} {
</ins><span class="cx">         foreach i $ilist {
</span><span class="cx">             set version [lindex $i 1]
</span><span class="cx">             set revision [lindex $i 2]
</span><span class="lines">@@ -4221,7 +4198,7 @@
</span><span class="cx">             set epoch [lindex $i 5]
</span><span class="cx">             ui_debug &quot;Uninstalling $portname ${version}_${revision}$variant&quot;
</span><span class="cx">             set regref [registry::open_entry $portname $version $revision $variant $epoch]
</span><del>-            if {$is_dryrun eq {yes}} {
</del><ins>+            if {$is_dryrun} {
</ins><span class="cx">                 ui_msg &quot;Skipping uninstall $portname @${version}_${revision}$variant (dry run)&quot;
</span><span class="cx">             } elseif {![registry::run_target $regref uninstall $optionslist]
</span><span class="cx">                       &amp;&amp; [catch {registry_uninstall::uninstall $portname $version $revision $variant $optionslist} result]} {
</span><span class="lines">@@ -4277,7 +4254,7 @@
</span><span class="cx">             foreach i $portinfo($dtype) {
</span><span class="cx">                 set d [$parentworker eval _get_dep_port $i]
</span><span class="cx">                 if {![llength [array get depscache port:$d]] &amp;&amp; ![llength [array get depscache $i]]} {
</span><del>-                    if {$d ne {}} {
</del><ins>+                    if {$d ne &quot;&quot;} {
</ins><span class="cx">                         set dspec port:$d
</span><span class="cx">                     } else {
</span><span class="cx">                         set dspec $i
</span><span class="lines">@@ -4325,7 +4302,7 @@
</span><span class="cx">             foreach v $versions {
</span><span class="cx">                 # Only the file name corresponds to the version name.
</span><span class="cx">                 set v [file tail $v]
</span><del>-                if {$v eq {base} || $v eq {current}} {
</del><ins>+                if {$v eq &quot;base&quot; || $v eq &quot;current&quot;} {
</ins><span class="cx">                     continue
</span><span class="cx">                 }
</span><span class="cx">                 lappend lversions [file tail $v]
</span><span class="lines">@@ -4344,7 +4321,7 @@
</span><span class="cx">         }
</span><span class="cx">         set {
</span><span class="cx">             # Use ${conf_path}/$version to read in sources.
</span><del>-            if {$version eq {} || $version eq {base} || $version eq {current}
</del><ins>+            if {$version eq &quot;&quot; || $version eq &quot;base&quot; || $version eq &quot;current&quot;
</ins><span class="cx">                     || [catch {set src_file [open &quot;${conf_path}/$version&quot;]} result]} {
</span><span class="cx">                 global errorInfo
</span><span class="cx">                 ui_debug &quot;${result}: $errorInfo&quot;
</span><span class="lines">@@ -4407,7 +4384,10 @@
</span><span class="cx">         show {
</span><span class="cx">             set selected_version ${conf_path}/current
</span><span class="cx"> 
</span><del>-            if {![file exists $selected_version]} {
</del><ins>+            if {[catch {file type $selected_version} err]} {
+                # this might be okay if nothing was selected yet,
+                # just log the error for debugging purposes
+                ui_debug &quot;cannot determine selected version for $group: $err&quot;
</ins><span class="cx">                 return none
</span><span class="cx">             } else {
</span><span class="cx">                 return [file readlink $selected_version]
</span><span class="lines">@@ -4432,12 +4412,12 @@
</span><span class="cx"> # check if the system we're on can run code of the given architecture
</span><span class="cx"> proc macports::arch_runnable {arch} {
</span><span class="cx">     global macports::os_major macports::os_arch macports::os_platform
</span><del>-    if {$macports::os_platform eq {darwin}} {
</del><ins>+    if {$macports::os_platform eq &quot;darwin&quot;} {
</ins><span class="cx">         if {$macports::os_major &gt;= 11 &amp;&amp; [string first ppc $arch] == 0} {
</span><span class="cx">             return no
</span><del>-        } elseif {$macports::os_arch eq {i386} &amp;&amp; $arch eq {ppc64}} {
</del><ins>+        } elseif {$macports::os_arch eq &quot;i386&quot; &amp;&amp; $arch eq &quot;ppc64&quot;} {
</ins><span class="cx">             return no
</span><del>-        } elseif {$macports::os_major &lt;= 8 &amp;&amp; $arch eq {x86_64}} {
</del><ins>+        } elseif {$macports::os_major &lt;= 8 &amp;&amp; $arch eq &quot;x86_64&quot;} {
</ins><span class="cx">             return no
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -4578,7 +4558,7 @@
</span><span class="cx">     if {$binary_count &gt; 0} {
</span><span class="cx">         ui_msg &quot;$macports::ui_prefix Scanning binaries for linking errors&quot;
</span><span class="cx">         set handle [machista::create_handle]
</span><del>-        if {$handle eq {NULL}} {
</del><ins>+        if {$handle eq &quot;NULL&quot;} {
</ins><span class="cx">             error &quot;Error creating libmachista handle&quot;
</span><span class="cx">         }
</span><span class="cx">         array unset files_warned_about
</span><span class="lines">@@ -4619,15 +4599,15 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 set architecture [$result cget -mt_archs]
</span><del>-                while {$architecture ne {NULL}} {
-                    if {[info exists options(ports_rev-upgrade_id-loadcmd-check)] &amp;&amp; $options(ports_rev-upgrade_id-loadcmd-check) eq {yes}} {
-                        if {[$architecture cget -mat_install_name] ne {NULL} &amp;&amp; [$architecture cget -mat_install_name] ne {}} {
</del><ins>+                while {$architecture ne &quot;NULL&quot;} {
+                    if {[info exists options(ports_rev-upgrade_id-loadcmd-check)] &amp;&amp; $options(ports_rev-upgrade_id-loadcmd-check)} {
+                        if {[$architecture cget -mat_install_name] ne &quot;NULL&quot; &amp;&amp; [$architecture cget -mat_install_name] ne &quot;&quot;} {
</ins><span class="cx">                             # check if this lib's install name actually refers to this file itself
</span><span class="cx">                             # if this is not the case software linking against this library might have erroneous load commands
</span><span class="cx">                             if {0 == [catch {set idloadcmdpath [revupgrade_handle_special_paths $bpath [$architecture cget -mat_install_name]]}]} {
</span><del>-                                if {[string index $idloadcmdpath 0] ne {/}} {
</del><ins>+                                if {[string index $idloadcmdpath 0] ne &quot;/&quot;} {
</ins><span class="cx">                                     set port [registry::entry owner $bpath]
</span><del>-                                    if {$port ne {}} {
</del><ins>+                                    if {$port ne &quot;&quot;} {
</ins><span class="cx">                                         set portname [$port name]
</span><span class="cx">                                     } else {
</span><span class="cx">                                         set portname &lt;unknown-port&gt;
</span><span class="lines">@@ -4638,7 +4618,7 @@
</span><span class="cx">                                     ui_warn &quot;ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] (belonging to port $portname) contains relative path&quot;
</span><span class="cx">                                 } elseif {![file exists $idloadcmdpath]} {
</span><span class="cx">                                     set port [registry::entry owner $bpath]
</span><del>-                                    if {$port ne {}} {
</del><ins>+                                    if {$port ne &quot;&quot;} {
</ins><span class="cx">                                         set portname [$port name]
</span><span class="cx">                                     } else {
</span><span class="cx">                                         set portname &lt;unknown-port&gt;
</span><span class="lines">@@ -4646,7 +4626,7 @@
</span><span class="cx">                                     if {$fancy_output} {
</span><span class="cx">                                         $revupgrade_progress intermission
</span><span class="cx">                                     }
</span><del>-                                    ui_warn &quot;ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] refers to non-existant file $idloadcmdpath&quot;
</del><ins>+                                    ui_warn &quot;ID load command in ${bpath}, arch [machista::get_arch_name [$architecture cget -mat_arch]] refers to non-existent file $idloadcmdpath&quot;
</ins><span class="cx">                                     ui_warn &quot;This is probably a bug in the $portname port and might cause problems in libraries linking against this file&quot;
</span><span class="cx">                                 } else {
</span><span class="cx">                                     set hash_this [sha256 file $bpath]
</span><span class="lines">@@ -4654,7 +4634,7 @@
</span><span class="cx"> 
</span><span class="cx">                                     if {$hash_this ne $hash_idloadcmd} {
</span><span class="cx">                                         set port [registry::entry owner $bpath]
</span><del>-                                        if {$port ne {}} {
</del><ins>+                                        if {$port ne &quot;&quot;} {
</ins><span class="cx">                                             set portname [$port name]
</span><span class="cx">                                         } else {
</span><span class="cx">                                             set portname &lt;unknown-port&gt;
</span><span class="lines">@@ -4679,7 +4659,7 @@
</span><span class="cx"> 
</span><span class="cx">                     set loadcommand [$architecture cget -mat_loadcmds]
</span><span class="cx"> 
</span><del>-                    while {$loadcommand ne {NULL}} {
</del><ins>+                    while {$loadcommand ne &quot;NULL&quot;} {
</ins><span class="cx">                         if {0 != [catch {set filepath [revupgrade_handle_special_paths $bpath [$loadcommand cget -mlt_install_name]]}]} {
</span><span class="cx">                             set loadcommand [$loadcommand cget -next]
</span><span class="cx">                             continue;
</span><span class="lines">@@ -4710,7 +4690,7 @@
</span><span class="cx"> 
</span><span class="cx">                         set libarchitecture [$libresult cget -mt_archs]
</span><span class="cx">                         set libarch_found false;
</span><del>-                        while {$libarchitecture ne {NULL}} {
</del><ins>+                        while {$libarchitecture ne &quot;NULL&quot;} {
</ins><span class="cx">                             if {[$architecture cget -mat_arch] ne [$libarchitecture cget -mat_arch]} {
</span><span class="cx">                                 set libarchitecture [$libarchitecture cget -next]
</span><span class="cx">                                 continue;
</span><span class="lines">@@ -4729,7 +4709,7 @@
</span><span class="cx">                             break;
</span><span class="cx">                         }
</span><span class="cx"> 
</span><del>-                        if {$libarch_found eq &quot;false&quot;} {
</del><ins>+                        if {!$libarch_found} {
</ins><span class="cx">                             ui_debug &quot;Missing architecture [machista::get_arch_name [$architecture cget -mat_arch]] in file $filepath&quot;
</span><span class="cx">                             if {[path_is_in_prefix $filepath]} {
</span><span class="cx">                                 ui_debug &quot;Marking $bpath as broken&quot;
</span><span class="lines">@@ -4769,7 +4749,7 @@
</span><span class="cx">         set broken_files [lsort -unique $broken_files]
</span><span class="cx">         foreach file $broken_files {
</span><span class="cx">             set port [registry::entry owner $file]
</span><del>-            if {$port ne {}} {
</del><ins>+            if {$port ne &quot;&quot;} {
</ins><span class="cx">                 lappend broken_ports $port
</span><span class="cx">                 lappend broken_files_by_port($port) $file
</span><span class="cx">             } else {
</span><span class="lines">@@ -4778,7 +4758,7 @@
</span><span class="cx">         }
</span><span class="cx">         set broken_ports [lsort -unique $broken_ports]
</span><span class="cx"> 
</span><del>-        if {$macports::revupgrade_mode eq {rebuild}} {
</del><ins>+        if {$macports::revupgrade_mode eq &quot;rebuild&quot;} {
</ins><span class="cx">             # don't try to rebuild ports that don't exist in the tree
</span><span class="cx">             set temp_broken_ports {}
</span><span class="cx">             foreach port $broken_ports {
</span><span class="lines">@@ -4829,7 +4809,7 @@
</span><span class="cx">         set num_broken_ports [llength $broken_ports]
</span><span class="cx">         set s [expr {$num_broken_ports == 1 ? &quot;&quot; : &quot;s&quot;}]
</span><span class="cx"> 
</span><del>-        if {$macports::revupgrade_mode ne {rebuild}} {
</del><ins>+        if {$macports::revupgrade_mode ne &quot;rebuild&quot;} {
</ins><span class="cx">             ui_msg &quot;$macports::ui_prefix Found $num_broken_ports broken port${s}:&quot;
</span><span class="cx">             foreach port $broken_ports {
</span><span class="cx">                 ui_msg &quot;     [$port name] @[$port version] [$port variants][$port negated_variants]&quot;
</span><span class="lines">@@ -4962,7 +4942,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun) eq {yes}} {
</del><ins>+        if {[info exists options(ports_dryrun)] &amp;&amp; $options(ports_dryrun)} {
</ins><span class="cx">             ui_warn &quot;If this was no dry run, rev-upgrade would now run the checks again to find unresolved and newly created problems&quot;
</span><span class="cx">             return 0
</span><span class="cx">         }
</span><span class="lines">@@ -5088,13 +5068,13 @@
</span><span class="cx">             set fd [open $conf_file r]
</span><span class="cx">             while {[gets $fd line] &gt;= 0} {
</span><span class="cx">                 if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
</span><del>-                    if {[lsearch -exact $conf_options $option] &gt;= 0} {
-                        if {$option eq {name}} {
</del><ins>+                    if {$option in $conf_options} {
+                        if {$option eq &quot;name&quot;} {
</ins><span class="cx">                             set cur_name $val
</span><span class="cx">                             lappend all_names $val
</span><span class="cx">                         } elseif {[info exists cur_name]} {
</span><span class="cx">                             set trimmedval [string trim $val]
</span><del>-                            if {$option eq {urls}} {
</del><ins>+                            if {$option eq &quot;urls&quot;} {
</ins><span class="cx">                                 set processed_urls {}
</span><span class="cx">                                 foreach url $trimmedval {
</span><span class="cx">                                     lappend processed_urls ${url}:nosubdir
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmacports10macports_dlisttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/macports1.0/macports_dlist.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/macports1.0/macports_dlist.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/macports1.0/macports_dlist.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -415,7 +415,7 @@
</span><span class="cx">                 return [info exists [set ditem]($key)]
</span><span class="cx">         } else {
</span><span class="cx">                 set x [lindex [array get $ditem $key] 1]
</span><del>-                if {[llength $x] &gt; 0 &amp;&amp; [lsearch -exact $x [lindex $args 0]] != -1} {
</del><ins>+                if {[llength $x] &gt; 0 &amp;&amp; [lindex $args 0] in $x} {
</ins><span class="cx">                         return 1
</span><span class="cx">                 } else {
</span><span class="cx">                         return 0
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmacports10macports_utiltcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/macports1.0/macports_util.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/macports1.0/macports_util.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/macports1.0/macports_util.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><del>-# macports.tcl
</del><ins>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# macports_util.tcl
</ins><span class="cx"> # $Id$
</span><span class="cx"> #
</span><span class="cx"> # Copyright (c) 2007 Kevin Ballard &lt;eridius@macports.org&gt;
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmacports10testsmacportstest"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/macports1.0/tests/macports.test (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/macports1.0/tests/macports.test        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/macports1.0/tests/macports.test        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -246,33 +246,46 @@
</span><span class="cx"> test ui_message {
</span><span class="cx">     UI message unit test.
</span><span class="cx"> } -setup {
</span><del>-    set fd [open $pwd/message w+]
-    set fd2 [open $pwd/log w+]
</del><ins>+    set fd [open $pwd/message w]
+    set fd2 [open $pwd/log w]
</ins><span class="cx">     set macports::channels(0) $fd
</span><del>-    set macports::channels(debuglog) $fd2
</del><span class="cx">     set macports::current_phase test
</span><span class="cx">     set ::debuglog $fd2
</span><span class="cx"> } -body {
</span><del>-    set res [ui_message 0 prefix phase args]
</del><ins>+    set res [ui_message 0 prefix args]
</ins><span class="cx">     close $fd
</span><span class="cx">     close $fd2
</span><del>-    set fd2 [open $pwd/message r]
-    set line [read $fd2]
</del><ins>+
+    set fd [open $pwd/message r]
+    set fd2 [open $pwd/log r]
+    set line [read $fd]
</ins><span class="cx">     if {$line ne &quot;prefixargs\n&quot;} {
</span><del>-        return &quot;FAIL: wrong message&quot;
</del><ins>+        return &quot;FAIL: wrong message: $line&quot;
</ins><span class="cx">     }
</span><ins>+    set line [read $fd2]
+    if {$line ne &quot;:0:test args\n&quot;} {
+        return &quot;FAIL: wrong log: $line&quot;
+    }
+    close $fd
</ins><span class="cx">     close $fd2
</span><span class="cx"> 
</span><del>-    set fd [open $pwd/message w+]
-    set fd2 [open $pwd/log w+]
-    set res [ui_message debuglog prefix phase -nonewline arg]
</del><ins>+    set fd [open $pwd/message w]
+    set fd2 [open $pwd/log w]
+    set res [ui_message 0 prefix -nonewline arg]
</ins><span class="cx">     close $fd
</span><span class="cx">     close $fd2
</span><ins>+
+    set fd [open $pwd/message r]
</ins><span class="cx">     set fd2 [open $pwd/log r]
</span><del>-    set line [read $fd2]
</del><ins>+    set line [read $fd]
</ins><span class="cx">     if {$line ne &quot;prefixarg&quot;} {
</span><del>-        return &quot;FAIL: wrong message&quot;
</del><ins>+        return &quot;FAIL: wrong message: $line&quot;
</ins><span class="cx">     }
</span><ins>+    set line [read $fd2]
+    if {$line ne &quot;:0:test arg&quot;} {
+        return &quot;FAIL: wrong log: $line&quot;
+    }
+    close $fd
</ins><span class="cx">     close $fd2
</span><span class="cx"> 
</span><span class="cx">     return &quot;UI message successful.&quot;
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcmacports10teststesttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/macports1.0/tests/test.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/macports1.0/tests/test.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/macports1.0/tests/test.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc print_help {arg} {
</span><del>-    if { $arg eq &quot;tests&quot; } {
</del><ins>+    if {$arg eq &quot;tests&quot;} {
</ins><span class="cx">         puts &quot;The list of available tests is:&quot;
</span><span class="cx">         cd tests
</span><span class="cx">         set test_suite [glob *.test]
</span><span class="lines">@@ -34,19 +34,19 @@
</span><span class="cx"> 
</span><span class="cx"> # Process args
</span><span class="cx"> foreach arg $argv {
</span><del>-    if { $arg eq &quot;-h&quot; || $arg eq &quot;-help&quot; } {
</del><ins>+    if {$arg eq &quot;-h&quot; || $arg eq &quot;-help&quot;} {
</ins><span class="cx">         print_help &quot;&quot;
</span><span class="cx">         exit 0
</span><del>-    } elseif { $arg eq &quot;-debug&quot; } {
</del><ins>+    } elseif {$arg eq &quot;-debug&quot;} {
</ins><span class="cx">         set index [expr {[lsearch $argv $arg] + 1}]
</span><span class="cx">         set level [lindex $argv $index]
</span><del>-        if { $level &gt;= 0 &amp;&amp; $level &lt;= 3 } {
-            lappend arguments -debug $level
</del><ins>+        if {$level &gt;= 0 &amp;&amp; $level &lt;= 3} {
+            lappend arguments &quot;-debug&quot; $level
</ins><span class="cx">         } else {
</span><span class="cx">             puts &quot;Invalid debug level.&quot;
</span><span class="cx">             exit 1
</span><span class="cx">         }
</span><del>-    } elseif { $arg eq &quot;-t&quot; } {
</del><ins>+    } elseif {$arg eq &quot;-t&quot;} {
</ins><span class="cx">         set index [expr {[lsearch $argv $arg] + 1}]
</span><span class="cx">         set test_name [lindex $argv $index]
</span><span class="cx">         set no 0
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx"> if {$test_name ne &quot;&quot;} {
</span><span class="cx">     set result [exec -ignorestderr $tcl $test_name {*}$arguments]
</span><span class="cx">     puts $result
</span><del>-
</del><span class="cx"> } else {
</span><span class="cx">     cd tests
</span><span class="cx">     set test_suite [glob *.test]
</span><span class="lines">@@ -84,8 +83,13 @@
</span><span class="cx">         set lastline [lindex [split $result &quot;\n&quot;] end]
</span><span class="cx"> 
</span><span class="cx">         if {[lrange [split $lastline &quot;\t&quot;] 1 1] ne &quot;Total&quot;} {
</span><del>-            set lastline [lindex [split $result &quot;\n&quot;] end-2]
-            set errmsg [lindex [split $result &quot;\n&quot;] end]
</del><ins>+            if {[lrange [split $lastline &quot;\t&quot;] 1 1] eq &quot;&quot;} {
+                set lastline [lindex [split $result &quot;\n&quot;] 0]
+                set errmsg [lindex [split $result &quot;\n&quot;] 2]
+            } else {
+                set lastline [lindex [split $result &quot;\n&quot;] end-2]
+                set errmsg [lindex [split $result &quot;\n&quot;] end]
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         set splitresult [split $lastline &quot;\t&quot;]
</span><span class="lines">@@ -95,10 +99,18 @@
</span><span class="cx">         set fail [lindex $splitresult 8]
</span><span class="cx"> 
</span><span class="cx">         # Format output
</span><del>-        if {$total &lt; 10} { set total &quot;0${total}&quot;}
-        if {$pass &lt; 10} { set pass &quot;0${pass}&quot;}
-        if {$skip &lt; 10} { set skip &quot;0${skip}&quot;}
-        if {$fail &lt; 10} { set fail &quot;0${fail}&quot;}
</del><ins>+        if {$total &lt; 10} {
+            set total &quot;0${total}&quot;
+        }
+        if {$pass &lt; 10} {
+            set pass &quot;0${pass}&quot;
+        }
+        if {$skip &lt; 10} {
+            set skip &quot;0${skip}&quot;
+        }
+        if {$fail &lt; 10} {
+            set fail &quot;0${fail}&quot;
+        }
</ins><span class="cx"> 
</span><span class="cx">         # Check for errors.
</span><span class="cx">         if {$fail != 0} {
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpackage10portarchivefetchtcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/package1.0/portarchivefetch.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/package1.0/portarchivefetch.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/package1.0/portarchivefetch.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">         }
</span><span class="cx">         return 0
</span><span class="cx">     }
</span><del>-    if {[info exists ports_binary_only] &amp;&amp; $ports_binary_only eq &quot;yes&quot;} {
</del><ins>+    if {([info exists ports_binary_only] &amp;&amp; $ports_binary_only eq &quot;yes&quot;) || [_archive_available]} {
</ins><span class="cx">         if {[info exists lastError] &amp;&amp; $lastError ne &quot;&quot;} {
</span><span class="cx">             error [msgcat::mc &quot;version @[option version]_[option revision][option portvariants]: %s&quot; $lastError]
</span><span class="cx">         } else {
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpackage10teststesttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/package1.0/tests/test.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/package1.0/tests/test.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/package1.0/tests/test.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> proc print_help {arg} {
</span><del>-    if { $arg eq &quot;tests&quot; } {
</del><ins>+    if {$arg eq &quot;tests&quot;} {
</ins><span class="cx">         puts &quot;The list of available tests is:&quot;
</span><span class="cx">         cd tests
</span><span class="cx">         set test_suite [glob *.test]
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         set test_suite [glob *.test]
</span><span class="cx">         foreach test $test_suite {
</span><span class="cx">             if {$test_name ne $test} {
</span><del>-                set no [expr {$no + 1}]
</del><ins>+                incr no
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         if {$no == [llength $test_suite]} {
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10Makefilein"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -7,20 +7,20 @@
</span><span class="cx">         Pextlib.o strsed.o fgetln.o md5cmd.o setmode.o xinstall.o \
</span><span class="cx">         fs-traverse.o strcasecmp.o vercomp.o filemap.o base32cmd.o \
</span><span class="cx">         sha1cmd.o curl.o rmd160cmd.o sha256cmd.o readline.o uid.o \
</span><del>-        tracelib.o tty.o readdir.o pipe.o flock.o system.o \
</del><ins>+        tracelib.o tty.o readdir.o pipe.o adv-flock.o system.o \
</ins><span class="cx">         mktemp.o realpath.o
</span><span class="cx"> ifneq (@ac_cv_func_strlcat@,yes)
</span><span class="cx"> OBJS+=strlcat.o
</span><span class="cx"> endif
</span><span class="cx"> 
</span><del>-# tracelib.o has an additional dependency
-tracelib.o: ../darwintracelib1.0/sandbox_actions.h
-
</del><span class="cx"> SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
</span><span class="cx"> INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_PATH}/pextlib1.0
</span><span class="cx"> 
</span><span class="cx"> include $(srcdir)/../../Mk/macports.tea.mk
</span><span class="cx"> 
</span><ins>+# tracelib.o has an additional dependency
+tracelib.o: ../darwintracelib1.0/sandbox_actions.h
+
</ins><span class="cx"> CFLAGS+= ${CURL_CFLAGS} ${MD5_CFLAGS} ${READLINE_CFLAGS}
</span><span class="cx"> LIBS+= ${CURL_LIBS} ${MD5_LIBS} ${READLINE_LIBS}
</span><span class="cx"> ifeq ($(shell uname), Darwin)
</span><span class="cx">Property changes on: branches/gsoc15-portfile/base/src/pextlib1.0/Makefile.in
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/branches/gsoc08-privileges/base/src/pextlib1.0/Makefile.in:37343-46937
</span><span class="cx">/branches/gsoc09-logging/base/src/pextlib1.0/Makefile:51231-60371
</span><span class="cx">/branches/gsoc09-logging/base/src/pextlib1.0/Makefile.in:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile:78828-88375
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile.in:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/Makefile.in:106692-111324
</span><span class="cx">/branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in:119516-124240
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/Makefile:51872-52323
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/Makefile.in:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/Makefile:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/Makefile.in:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/Makefile.in:49341-104698
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile:45682-46060
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile.in:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/Makefile:44044-44692
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/Makefile.in:44044-44692
</span><span class="cx">   + /branches/gsoc08-privileges/base/src/pextlib1.0/Makefile:37343-46937
</span><span class="cx">/branches/gsoc08-privileges/base/src/pextlib1.0/Makefile.in:37343-46937
</span><span class="cx">/branches/gsoc09-logging/base/src/pextlib1.0/Makefile:51231-60371
</span><span class="cx">/branches/gsoc09-logging/base/src/pextlib1.0/Makefile.in:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile:78828-88375
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Makefile.in:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/Makefile.in:106692-111324
</span><span class="cx">/branches/gsoc14-interactive/base/src/pextlib1.0/Makefile.in:119516-124240
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/Makefile:51872-52323
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/Makefile.in:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/Makefile:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/Makefile.in:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/Makefile.in:49341-104698,137076-139405
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile:45682-46060
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/Makefile.in:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/Makefile:44044-44692
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/Makefile.in:44044-44692
</span><a id="branchesgsoc15portfilebasesrcpextlib10Pextlibc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -43,6 +43,8 @@
</span><span class="cx"> #define _BSD_SOURCE
</span><span class="cx"> /* required for clearenv(3)/setenv(3)/unsetenv(3) on OS X */
</span><span class="cx"> #define _DARWIN_C_SOURCE
</span><ins>+/* required for vasprintf(3) on Linux */
+#define _GNU_SOURCE
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;sys/types.h&gt;
</span><span class="cx"> #include &lt;sys/socket.h&gt;
</span><span class="lines">@@ -89,7 +91,7 @@
</span><span class="cx"> #include &quot;strsed.h&quot;
</span><span class="cx"> #include &quot;readdir.h&quot;
</span><span class="cx"> #include &quot;pipe.h&quot;
</span><del>-#include &quot;flock.h&quot;
</del><ins>+#include &quot;adv-flock.h&quot;
</ins><span class="cx"> #include &quot;system.h&quot;
</span><span class="cx"> #include &quot;mktemp.h&quot;
</span><span class="cx"> #include &quot;realpath.h&quot;
</span><span class="lines">@@ -105,74 +107,78 @@
</span><span class="cx"> #include &quot;setmode.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static char *
-ui_escape(const char *source)
-{
-    char *d, *dest;
-    const char *s;
-    size_t dlen;
</del><ins>+__attribute__((format(printf, 3, 0)))
+static void ui_message(Tcl_Interp *interp, const char *severity, const char *format, va_list va) {
+    char tclcmd[32];
+    char *buf;
</ins><span class="cx"> 
</span><del>-    s = source;
-    dlen = strlen(source) * 2 + 1;
-    d = dest = malloc(dlen);
-    if (dest == NULL) {
-        return NULL;
</del><ins>+    if (vasprintf(&amp;buf, format, va) &lt; 0) {
+        perror(&quot;vasprintf&quot;);
+        return;
</ins><span class="cx">     }
</span><del>-    while(*s != '\0') {
-        switch(*s) {
-            case '\\':
-            case '}':
-            case '{':
-                *d = '\\';
-                d++;
-                *d = *s;
-                d++;
-                s++;
-                break;
-            case '\n':
-                s++;
-                break;
-            default:
-                *d = *s;
-                d++;
-                s++;
-                break;
-        }
</del><ins>+
+    snprintf(tclcmd, sizeof(tclcmd), &quot;ui_%s $warn&quot;, severity);
+
+    Tcl_SetVar(interp, &quot;warn&quot;, buf, 0);
+    if (TCL_OK != Tcl_Eval(interp, tclcmd)) {
+        fprintf(stderr, &quot;Error evaluating tcl statement `%s': %s\n&quot;, tclcmd, Tcl_GetStringResult(interp));
</ins><span class="cx">     }
</span><del>-    *d = '\0';
-    return dest;
</del><ins>+    Tcl_UnsetVar(interp, &quot;warn&quot;, 0);
+    free(buf);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-int
-ui_info(Tcl_Interp *interp, char *mesg)
-{
-    const char ui_proc_start[] = &quot;ui_info [subst -nocommands -novariables {&quot;;
-    const char ui_proc_end[] = &quot;}]&quot;;
-    char *script, *string;
-    size_t scriptlen, len, remaining;
-    int rval;
</del><ins>+__attribute__((format(printf, 2, 3)))
+void ui_error(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
+    va_start(va, format);
+    ui_message(interp, &quot;error&quot;, format, va);
+    va_end(va);
+}
</ins><span class="cx"> 
</span><del>-    string = ui_escape(mesg);
-    if (string == NULL)
-        return TCL_ERROR;
</del><ins>+__attribute__((format(printf, 2, 3)))
+void ui_warn(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
</ins><span class="cx"> 
</span><del>-    len = strlen(string);
-    scriptlen = sizeof(ui_proc_start) + len + sizeof(ui_proc_end) - 1;
-    script = malloc(scriptlen);
-    if (script == NULL)
-        return TCL_ERROR;
</del><ins>+    va_start(va, format);
+    ui_message(interp, &quot;warn&quot;, format, va);
+    va_end(va);
+}
</ins><span class="cx"> 
</span><del>-    memcpy(script, ui_proc_start, sizeof(ui_proc_start));
-    remaining = scriptlen - sizeof(ui_proc_start);
-    strncat(script, string, remaining);
-    remaining -= len;
-    strncat(script, ui_proc_end, remaining);
-    free(string);
-    rval = Tcl_EvalEx(interp, script, -1, 0);
-    free(script);
-    return rval;
</del><ins>+__attribute__((format(printf, 2, 3)))
+void ui_msg(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
+    va_start(va, format);
+    ui_message(interp, &quot;msg&quot;, format, va);
+    va_end(va);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+__attribute__((format(printf, 2, 3)))
+void ui_notice(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
+
+    va_start(va, format);
+    ui_message(interp, &quot;notice&quot;, format, va);
+    va_end(va);
+}
+
+__attribute__((format(printf, 2, 3)))
+void ui_info(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
+
+    va_start(va, format);
+    ui_message(interp, &quot;info&quot;, format, va);
+    va_end(va);
+}
+
+__attribute__((format(printf, 2, 3)))
+void ui_debug(Tcl_Interp *interp, const char *format, ...) {
+    va_list va;
+
+    va_start(va, format);
+    ui_message(interp, &quot;debug&quot;, format, va);
+    va_end(va);
+}
+
</ins><span class="cx"> int StrsedCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
</span><span class="cx"> {
</span><span class="cx">     char *pattern, *string, *res;
</span><span class="lines">@@ -608,7 +614,7 @@
</span><span class="cx">         return TCL_ERROR;
</span><span class="cx"> 
</span><span class="cx">         Tcl_CreateObjCommand(interp, &quot;system&quot;, SystemCmd, NULL, NULL);
</span><del>-        Tcl_CreateObjCommand(interp, &quot;flock&quot;, FlockCmd, NULL, NULL);
</del><ins>+        Tcl_CreateObjCommand(interp, &quot;adv-flock&quot;, AdvFlockCmd, NULL, NULL);
</ins><span class="cx">         Tcl_CreateObjCommand(interp, &quot;readdir&quot;, ReaddirCmd, NULL, NULL);
</span><span class="cx">         Tcl_CreateObjCommand(interp, &quot;strsed&quot;, StrsedCmd, NULL, NULL);
</span><span class="cx">         Tcl_CreateObjCommand(interp, &quot;mkstemp&quot;, MkstempCmd, NULL, NULL);
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10Pextlibh"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.h (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.h        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/Pextlib.h        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -30,4 +30,9 @@
</span><span class="cx">  * POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-int ui_info(Tcl_Interp *, char *);
</del><ins>+void ui_error(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
+void ui_warn(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
+void ui_msg(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
+void ui_notice(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
+void ui_info(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
+void ui_debug(Tcl_Interp *interp, const char *format, ...) __attribute__((format(printf, 2, 3)));
</ins></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10advflockcfromrev139405trunkbasesrcpextlib10advflockc"></a>
<div class="copfile"><h4>Copied: branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.c (from rev 139405, trunk/base/src/pextlib1.0/adv-flock.c) (0 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.c                                (rev 0)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -0,0 +1,256 @@
</span><ins>+/*
+ * adv-flock.c
+ * $Id$
+ *
+ * Copyright (c) 2009 The MacPorts Project
+ * 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 The MacPorts Project 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.
+ */
+
+#if HAVE_CONFIG_H
+#include &lt;config.h&gt;
+#endif
+
+/* needed to get struct sigaction on some platforms */
+#define _XOPEN_SOURCE 500L
+/* the above hides flock on OS X without _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
+
+#if HAVE_SYS_FILE_H
+#include &lt;sys/file.h&gt;
+#endif
+
+#include &lt;errno.h&gt;
+#include &lt;inttypes.h&gt;
+#include &lt;signal.h&gt;
+#include &lt;string.h&gt;
+#include &lt;unistd.h&gt;
+
+#include &lt;tcl.h&gt;
+
+#include &quot;adv-flock.h&quot;
+
+static volatile int alarmReceived = 0;
+
+static void alarmHandler(int sig UNUSED) {
+    alarmReceived = 1;
+}
+
+int
+AdvFlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
+    static const char errorstr[] = &quot;use one of \&quot;-shared\&quot;, \&quot;-exclusive\&quot;, or \&quot;-unlock\&quot;, and optionally \&quot;-noblock\&quot;&quot;;
+    int operation = 0, fd, i, ret, sigret = TCL_OK;
+    int errnoval = 0;
+    int oshared = 0, oexclusive = 0, ounlock = 0, onoblock = 0, retry = 0;
+#if defined(HAVE_LOCKF) &amp;&amp; !defined(HAVE_FLOCK)
+    off_t curpos;
+#endif
+    char *res;
+    Tcl_Channel channel;
+    ClientData handle;
+    struct sigaction sa_oldalarm, sa_alarm;
+
+    if (objc &lt; 3 || objc &gt; 4) {
+        Tcl_WrongNumArgs(interp, 1, objv, &quot;channelId switches&quot;);
+        return TCL_ERROR;
+    }
+
+    if ((channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL)) == NULL) {
+        Tcl_SetResult(interp, &quot;error getting channel, result was NULL&quot;, TCL_STATIC);
+        return TCL_ERROR;
+    }
+
+    if (Tcl_GetChannelHandle(channel, TCL_READABLE | TCL_WRITABLE, &amp;handle) != TCL_OK) {
+        Tcl_SetResult(interp, &quot;error getting channel handle&quot;, TCL_STATIC);
+        return TCL_ERROR;
+    }
+    fd = (int)(intptr_t)handle;
+
+    for (i = 2; i &lt; objc; i++) {
+        char *arg = Tcl_GetString(objv[i]);
+        if (!strcmp(arg, &quot;-shared&quot;)) {
+            oshared = 1;
+        }
+        else if (!strcmp(arg, &quot;-exclusive&quot;)) {
+            oexclusive = 1;
+        }
+        else if (!strcmp(arg, &quot;-unlock&quot;)) {
+            ounlock = 1;
+        }
+        else if (!strcmp(arg, &quot;-noblock&quot;)) {
+            onoblock = 1;
+        }
+    }
+
+    /* verify the arguments */
+
+    if ((oshared + oexclusive + ounlock) != 1) {
+        /* only one of the options should have been specified */
+        Tcl_SetResult(interp, (void *) &amp;errorstr, TCL_STATIC);
+        return TCL_ERROR;
+    }
+
+    if (onoblock &amp;&amp; ounlock) {
+        /* should not be specified together */
+        Tcl_SetResult(interp, &quot;-noblock cannot be used with -unlock&quot;, TCL_STATIC);
+        return TCL_ERROR;
+    }
+
+    /* (re-)enable SIGALRM so we can use alarm(3) to specify a timeout for the
+     * locking, do some Tcl signal processing and restart the locking to solve
+     * #43388. */
+    memset(&amp;sa_alarm, 0, sizeof(struct sigaction));
+    sigemptyset(&amp;sa_alarm.sa_mask);
+    sa_alarm.sa_flags = 0; /* explicitly don't specify SA_RESTART, we want the
+                              following alarm(3) to interrupt the locking. */
+    sa_alarm.sa_handler = alarmHandler;
+    sigaction(SIGALRM, &amp;sa_alarm, &amp;sa_oldalarm);
+
+    do {
+        /* use a delay of one second */
+        retry = 0;
+        alarmReceived = 0;
+        alarm(1);
+#if HAVE_FLOCK
+        /* prefer flock if present */
+        if (oshared) {
+            operation |= LOCK_SH;
+        }
+
+        if (oexclusive) {
+            operation |= LOCK_EX;
+        }
+
+        if (ounlock) {
+            operation |= LOCK_UN;
+        }
+
+        if (onoblock) {
+            operation |= LOCK_NB;
+        }
+
+        ret = flock(fd, operation);
+        if (ret == -1) {
+            errnoval = errno;
+        }
+#else
+#if HAVE_LOCKF
+        if (ounlock) {
+            operation = F_ULOCK;
+        }
+
+        /* lockf semantics don't map to shared locks. */
+        if (oshared || oexclusive) {
+            if (onoblock) {
+                operation = F_TLOCK;
+            }
+            else {
+                operation = F_LOCK;
+            }
+        }
+
+        curpos = lseek(fd, 0, SEEK_CUR);
+        if (curpos == -1) {
+            Tcl_SetResult(interp, (void *) &quot;Seek error&quot;, TCL_STATIC);
+            return TCL_ERROR;
+        }
+
+        ret = lockf(fd, operation, 0); /* lock entire file */
+        if (ret == -1) {
+            errnoval = errno;
+        }
+
+        curpos = lseek(fd, curpos, SEEK_SET);
+        if (curpos == -1) {
+            Tcl_SetResult(interp, (void *) &quot;Seek error&quot;, TCL_STATIC);
+            return TCL_ERROR;
+        }
+#else
+#error no available locking implementation
+#endif /* HAVE_LOCKF */
+#endif /* HAVE_FLOCK */
+        /* disable the alarm timer */
+        alarm(0);
+
+        if (ret == -1) {
+            if (oshared || oexclusive) {
+                if (!onoblock &amp;&amp; alarmReceived &amp;&amp; errnoval == EINTR) {
+                    /* We were trying to lock, the lock was supposed to block,
+                     * it failed with EINTR and we processed a SIGALRM. This
+                     * probably means the call was interrupted by the timer.
+                     * Call Tcl signal processing functions and try again. */
+                    if (Tcl_AsyncReady()) {
+                        sigret = Tcl_AsyncInvoke(interp, TCL_OK);
+                        if (sigret != TCL_OK) {
+                            break;
+                        }
+                    }
+                    retry = 1;
+                    continue;
+                }
+
+                if (onoblock &amp;&amp; errnoval == EAGAIN) {
+                    /* The lock wasn't supposed to block, and the lock wasn't
+                     * successful because the lock is taken. On some systems
+                     * EAGAIN == EWOULDBLOCK, but let's play it safe. */
+                    errnoval = EWOULDBLOCK;
+                }
+            }
+        }
+    } while (retry);
+
+    /* Restore the previous handler for SIGALRM */
+    sigaction(SIGALRM, &amp;sa_oldalarm, NULL);
+
+    if (sigret != TCL_OK) {
+        /* We received a signal that raised an error. The file hasn't been
+         * locked. */
+        return sigret;
+    }
+
+    if (ret != 0) {
+        switch (errnoval) {
+            case EAGAIN:
+                res = &quot;EAGAIN&quot;;
+                break;
+            case EBADF:
+                res = &quot;EBADF&quot;;
+                break;
+            case EINVAL:
+                res = &quot;EINVAL&quot;;
+                break;
+            case EOPNOTSUPP:
+                res = &quot;EOPNOTSUPP&quot;;
+                break;
+            default:
+                res = strerror(errno);
+                break;
+        }
+        Tcl_SetResult(interp, (void *) res, TCL_STATIC);
+        return TCL_ERROR;
+    }
+    return TCL_OK;
+}
</ins></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10advflockhfromrev139405trunkbasesrcpextlib10advflockh"></a>
<div class="copfile"><h4>Copied: branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.h (from rev 139405, trunk/base/src/pextlib1.0/adv-flock.h) (0 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.h                                (rev 0)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/adv-flock.h        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * adv-flock.h
+ * $Id$
+ *
+ * Copyright (c) 2009 The MacPorts Project
+ * 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 The MacPorts Project 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.
+ */
+
+int AdvFlockCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
</ins></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10flockc"></a>
<div class="delfile"><h4>Deleted: branches/gsoc15-portfile/base/src/pextlib1.0/flock.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/flock.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/flock.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -1,256 +0,0 @@
</span><del>-/*
- * flock.c
- * $Id$
- *
- * Copyright (c) 2009 The MacPorts Project
- * 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 The MacPorts Project 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.
- */
-
-#if HAVE_CONFIG_H
-#include &lt;config.h&gt;
-#endif
-
-/* needed to get struct sigaction on some platforms */
-#define _XOPEN_SOURCE 500L
-/* the above hides flock on OS X without _DARWIN_C_SOURCE */
-#define _DARWIN_C_SOURCE
-
-#if HAVE_SYS_FILE_H
-#include &lt;sys/file.h&gt;
-#endif
-
-#include &lt;errno.h&gt;
-#include &lt;inttypes.h&gt;
-#include &lt;signal.h&gt;
-#include &lt;string.h&gt;
-#include &lt;unistd.h&gt;
-
-#include &lt;tcl.h&gt;
-
-#include &quot;flock.h&quot;
-
-static volatile int alarmReceived = 0;
-
-static void alarmHandler(int sig UNUSED) {
-    alarmReceived = 1;
-}
-
-int
-FlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
-    static const char errorstr[] = &quot;use one of \&quot;-shared\&quot;, \&quot;-exclusive\&quot;, or \&quot;-unlock\&quot;, and optionally \&quot;-noblock\&quot;&quot;;
-    int operation = 0, fd, i, ret, sigret = TCL_OK;
-    int errnoval = 0;
-    int oshared = 0, oexclusive = 0, ounlock = 0, onoblock = 0, retry = 0;
-#if defined(HAVE_LOCKF) &amp;&amp; !defined(HAVE_FLOCK)
-    off_t curpos;
-#endif
-    char *res;
-    Tcl_Channel channel;
-    ClientData handle;
-    struct sigaction sa_oldalarm, sa_alarm;
-
-    if (objc &lt; 3 || objc &gt; 4) {
-        Tcl_WrongNumArgs(interp, 1, objv, &quot;channelId switches&quot;);
-        return TCL_ERROR;
-    }
-
-    if ((channel = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL)) == NULL) {
-        Tcl_SetResult(interp, &quot;error getting channel, result was NULL&quot;, TCL_STATIC);
-        return TCL_ERROR;
-    }
-
-    if (Tcl_GetChannelHandle(channel, TCL_READABLE | TCL_WRITABLE, &amp;handle) != TCL_OK) {
-        Tcl_SetResult(interp, &quot;error getting channel handle&quot;, TCL_STATIC);
-        return TCL_ERROR;
-    }
-    fd = (int)(intptr_t)handle;
-
-    for (i = 2; i &lt; objc; i++) {
-        char *arg = Tcl_GetString(objv[i]);
-        if (!strcmp(arg, &quot;-shared&quot;)) {
-            oshared = 1;
-        }
-        else if (!strcmp(arg, &quot;-exclusive&quot;)) {
-            oexclusive = 1;
-        }
-        else if (!strcmp(arg, &quot;-unlock&quot;)) {
-            ounlock = 1;
-        }
-        else if (!strcmp(arg, &quot;-noblock&quot;)) {
-            onoblock = 1;
-        }
-    }
-
-    /* verify the arguments */
-
-    if ((oshared + oexclusive + ounlock) != 1) {
-        /* only one of the options should have been specified */
-        Tcl_SetResult(interp, (void *) &amp;errorstr, TCL_STATIC);
-        return TCL_ERROR;
-    }
-
-    if (onoblock &amp;&amp; ounlock) {
-        /* should not be specified together */
-        Tcl_SetResult(interp, &quot;-noblock cannot be used with -unlock&quot;, TCL_STATIC);
-        return TCL_ERROR;
-    }
-
-    /* (re-)enable SIGALRM so we can use alarm(3) to specify a timeout for the
-     * locking, do some Tcl signal processing and restart the locking to solve
-     * #43388. */
-    memset(&amp;sa_alarm, 0, sizeof(struct sigaction));
-    sigemptyset(&amp;sa_alarm.sa_mask);
-    sa_alarm.sa_flags = 0; /* explicitly don't specify SA_RESTART, we want the
-                              following alarm(3) to interrupt the locking. */
-    sa_alarm.sa_handler = alarmHandler;
-    sigaction(SIGALRM, &amp;sa_alarm, &amp;sa_oldalarm);
-
-    do {
-        /* use a delay of one second */
-        retry = 0;
-        alarmReceived = 0;
-        alarm(1);
-#if HAVE_FLOCK
-        /* prefer flock if present */
-        if (oshared) {
-            operation |= LOCK_SH;
-        }
-
-        if (oexclusive) {
-            operation |= LOCK_EX;
-        }
-
-        if (ounlock) {
-            operation |= LOCK_UN;
-        }
-
-        if (onoblock) {
-            operation |= LOCK_NB;
-        }
-
-        ret = flock(fd, operation);
-        if (ret == -1) {
-            errnoval = errno;
-        }
-#else
-#if HAVE_LOCKF
-        if (ounlock) {
-            operation = F_ULOCK;
-        }
-
-        /* lockf semantics don't map to shared locks. */
-        if (oshared || oexclusive) {
-            if (onoblock) {
-                operation = F_TLOCK;
-            }
-            else {
-                operation = F_LOCK;
-            }
-        }
-
-        curpos = lseek(fd, 0, SEEK_CUR);
-        if (curpos == -1) {
-            Tcl_SetResult(interp, (void *) &quot;Seek error&quot;, TCL_STATIC);
-            return TCL_ERROR;
-        }
-
-        ret = lockf(fd, operation, 0); /* lock entire file */
-        if (ret == -1) {
-            errnoval = errno;
-        }
-
-        curpos = lseek(fd, curpos, SEEK_SET);
-        if (curpos == -1) {
-            Tcl_SetResult(interp, (void *) &quot;Seek error&quot;, TCL_STATIC);
-            return TCL_ERROR;
-        }
-#else
-#error no available locking implementation
-#endif /* HAVE_LOCKF */
-#endif /* HAVE_FLOCK */
-        /* disable the alarm timer */
-        alarm(0);
-
-        if (ret == -1) {
-            if (oshared || oexclusive) {
-                if (!onoblock &amp;&amp; alarmReceived &amp;&amp; errnoval == EINTR) {
-                    /* We were trying to lock, the lock was supposed to block,
-                     * it failed with EINTR and we processed a SIGALRM. This
-                     * probably means the call was interrupted by the timer.
-                     * Call Tcl signal processing functions and try again. */
-                    if (Tcl_AsyncReady()) {
-                        sigret = Tcl_AsyncInvoke(interp, TCL_OK);
-                        if (sigret != TCL_OK) {
-                            break;
-                        }
-                    }
-                    retry = 1;
-                    continue;
-                }
-
-                if (onoblock &amp;&amp; errnoval == EAGAIN) {
-                    /* The lock wasn't supposed to block, and the lock wasn't
-                     * successful because the lock is taken. On some systems
-                     * EAGAIN == EWOULDBLOCK, but let's play it safe. */
-                    errnoval = EWOULDBLOCK;
-                }
-            }
-        }
-    } while (retry);
-
-    /* Restore the previous handler for SIGALRM */
-    sigaction(SIGALRM, &amp;sa_oldalarm, NULL);
-
-    if (sigret != TCL_OK) {
-        /* We received a signal that raised an error. The file hasn't been
-         * locked. */
-        return sigret;
-    }
-
-    if (ret != 0) {
-        switch (errnoval) {
-            case EAGAIN:
-                res = &quot;EAGAIN&quot;;
-                break;
-            case EBADF:
-                res = &quot;EBADF&quot;;
-                break;
-            case EINVAL:
-                res = &quot;EINVAL&quot;;
-                break;
-            case EOPNOTSUPP:
-                res = &quot;EOPNOTSUPP&quot;;
-                break;
-            default:
-                res = strerror(errno);
-                break;
-        }
-        Tcl_SetResult(interp, (void *) res, TCL_STATIC);
-        return TCL_ERROR;
-    }
-    return TCL_OK;
-}
</del></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10flockh"></a>
<div class="delfile"><h4>Deleted: branches/gsoc15-portfile/base/src/pextlib1.0/flock.h (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/flock.h        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/flock.h        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -1,33 +0,0 @@
</span><del>-/*
- * flock.h
- * $Id$
- *
- * Copyright (c) 2009 The MacPorts Project
- * 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 The MacPorts Project 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.
- */
-
-int FlockCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
</del></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10systemc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/system.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/system.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/system.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -165,6 +165,13 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    /* print debug command info */
+    if (path) {
+        ui_debug(interp, &quot;system -W %s: %s&quot;, path, cmdstring);
+    } else {
+        ui_debug(interp, &quot;system: %s&quot;, cmdstring);
+    }
+
</ins><span class="cx">     /* check if and how we should use sandbox-exec */
</span><span class="cx">     sandbox = check_sandboxing(interp, &amp;sandbox_exec_path, &amp;profilestr);
</span><span class="cx"> 
</span><span class="lines">@@ -288,10 +295,7 @@
</span><span class="cx">                     pos = 0;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (ui_info(interp, sbuf) != TCL_OK) {
-                    read_failed = 1;
-                    break;
-                }
</del><ins>+                ui_info(interp, &quot;%s&quot;, sbuf);
</ins><span class="cx">             }
</span><span class="cx">             fclose(pdes);
</span><span class="cx">         } else {
</span><span class="lines">@@ -307,21 +311,11 @@
</span><span class="cx">         if (WEXITSTATUS(ret) == 0) {
</span><span class="cx">             status = TCL_OK;
</span><span class="cx">         } else {
</span><del>-            char *errorstr;
-            size_t errorstrlen;
</del><span class="cx">             Tcl_Obj* errorCode;
</span><span class="cx"> 
</span><span class="cx">             /* print error */
</span><del>-            /* get buffer large enough for additional message or the error code */
-            errorstrlen = strlen(cmdstring) + strlen(&quot;Command failed: &quot;) + 12;
-            errorstr = malloc(errorstrlen);
-            if (errorstr) {
-                snprintf(errorstr, errorstrlen, &quot;Command failed: %s&quot;, cmdstring);
-                ui_info(interp, errorstr);
-                snprintf(errorstr, errorstrlen, &quot;Exit code: %d&quot;, WEXITSTATUS(ret));
-                ui_info(interp, errorstr);
-                free(errorstr);
-            }
</del><ins>+            ui_info(interp, &quot;Command failed: %s&quot;, cmdstring);
+            ui_info(interp, &quot;Exit code: %d&quot;, WEXITSTATUS(ret));
</ins><span class="cx"> 
</span><span class="cx">             /* set errorCode [list CHILDSTATUS &lt;pid&gt; &lt;code&gt;] */
</span><span class="cx">             errorCode = Tcl_NewListObj(0, NULL);
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10tracelibc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/tracelib.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/tracelib.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/tracelib.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;tracelib.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;Pextlib.h&quot;
+
</ins><span class="cx"> #include &quot;strlcat.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #ifdef HAVE_TRACEMODE_SUPPORT
</span><span class="lines">@@ -106,12 +108,6 @@
</span><span class="cx"> } sandbox_violation_t;
</span><span class="cx"> static void sandbox_violation(int sock, const char *path, sandbox_violation_t type);
</span><span class="cx"> 
</span><del>-static void ui_warn(const char *format, ...) __printflike(1, 2);
-#if 0
-static void ui_info(const char *format, ...) __printflike(1, 2);
-#endif
-static void ui_error(const char *format, ...) __printflike(1, 2);
-
</del><span class="cx"> #define MAX_SOCKETS (1024)
</span><span class="cx"> #define BUFSIZE     (4096)
</span><span class="cx"> 
</span><span class="lines">@@ -420,7 +416,7 @@
</span><span class="cx">     reg_error error;
</span><span class="cx"> 
</span><span class="cx">     if (NULL == (reg = registry_for(interp, reg_attached))) {
</span><del>-        ui_error(&quot;%s&quot;, Tcl_GetStringResult(interp));
</del><ins>+        ui_error(interp, &quot;%s&quot;, Tcl_GetStringResult(interp));
</ins><span class="cx">         /* send unexpected output to make the build fail */
</span><span class="cx">         answer(sock, &quot;#&quot;);
</span><span class="cx">     }
</span><span class="lines">@@ -438,7 +434,7 @@
</span><span class="cx">     /* find the port's name to compare with out list */
</span><span class="cx">     if (!reg_entry_propget(&amp;entry, &quot;name&quot;, &amp;port, &amp;error)) {
</span><span class="cx">         /* send unexpected output to make the build fail */
</span><del>-        ui_error(&quot;%s&quot;, error.description);
</del><ins>+        ui_error(interp, &quot;%s&quot;, error.description);
</ins><span class="cx">         answer(sock, &quot;#&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -455,50 +451,6 @@
</span><span class="cx">     answer(sock, &quot;!&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-__printflike(2, 0)
-static void ui_msg(const char *severity, const char *format, va_list va) {
-    char buf[1024], tclcmd[32];
-
-    vsnprintf(buf, sizeof(buf), format, va);
-
-    snprintf(tclcmd, sizeof(tclcmd), &quot;ui_%s $warn&quot;, severity);
-
-    Tcl_SetVar(interp, &quot;warn&quot;, buf, 0);
-    if (TCL_OK != Tcl_Eval(interp, tclcmd)) {
-        fprintf(stderr, &quot;Error evaluating tcl statement `%s': %s\n&quot;, tclcmd, Tcl_GetStringResult(interp));
-    }
-    Tcl_UnsetVar(interp, &quot;warn&quot;, 0);
-
-}
-
-__printflike(1, 2)
-static void ui_warn(const char *format, ...) {
-    va_list va;
-
-    va_start(va, format);
-    ui_msg(&quot;warn&quot;, format, va);
-    va_end(va);
-}
-
-#if 0
-__printflike(1, 2)
-static void ui_info(const char *format, ...) {
-    va_list va;
-
-    va_start(va, format);
-    ui_msg(&quot;info&quot;, format, va);
-    va_end(va);
-}
-#endif
-
-__printflike(1, 2)
-static void ui_error(const char *format, ...) {
-    va_list va;
-    va_start(va, format);
-    ui_msg(&quot;error&quot;, format, va);
-    va_end(va);
-}
-
</del><span class="cx"> static int TracelibOpenSocketCmd(Tcl_Interp *in) {
</span><span class="cx">     struct sockaddr_un sun;
</span><span class="cx">     struct rlimit rl;
</span><span class="lines">@@ -520,7 +472,7 @@
</span><span class="cx">     /* raise the limit of open files to the maximum from the default soft limit
</span><span class="cx">      * of 256 */
</span><span class="cx">     if (getrlimit(RLIMIT_NOFILE, &amp;rl) == -1) {
</span><del>-        ui_warn(&quot;getrlimit failed (%d), skipping setrlimit&quot;, errno);
</del><ins>+        ui_warn(interp, &quot;getrlimit failed (%d), skipping setrlimit&quot;, errno);
</ins><span class="cx">     } else {
</span><span class="cx"> #ifdef OPEN_MAX
</span><span class="cx">         if (rl.rlim_max &gt; OPEN_MAX) {
</span><span class="lines">@@ -529,7 +481,7 @@
</span><span class="cx"> #endif
</span><span class="cx">         rl.rlim_cur = rl.rlim_max;
</span><span class="cx">         if (setrlimit(RLIMIT_NOFILE, &amp;rl) == -1) {
</span><del>-            ui_warn(&quot;setrlimit failed (%d)&quot;, errno);
</del><ins>+            ui_warn(interp, &quot;setrlimit failed (%d)&quot;, errno);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -720,7 +672,7 @@
</span><span class="cx"> 
</span><span class="cx">                     flags = fcntl(s, F_GETFL, 0);
</span><span class="cx">                     if (-1 == fcntl(s, F_SETFL, flags &amp; ~O_NONBLOCK)) {
</span><del>-                        ui_warn(&quot;tracelib: couldn't mark socket as blocking&quot;);
</del><ins>+                        ui_warn(interp, &quot;tracelib: couldn't mark socket as blocking&quot;);
</ins><span class="cx">                         close(s);
</span><span class="cx">                         continue;
</span><span class="cx">                     }
</span><span class="lines">@@ -728,7 +680,7 @@
</span><span class="cx">                     /* register the new socket in the kqueue */
</span><span class="cx">                     EV_SET(&amp;kev, s, EVFILT_READ, EV_ADD | EV_RECEIPT, 0, 0, NULL);
</span><span class="cx">                     if (1 != kevent(kq, &amp;kev, 1, &amp;kev, 1, NULL)) {
</span><del>-                        ui_warn(&quot;tracelib: error adding socket to kqueue&quot;);
</del><ins>+                        ui_warn(interp, &quot;tracelib: error adding socket to kqueue&quot;);
</ins><span class="cx">                         close(s);
</span><span class="cx">                         continue;
</span><span class="cx">                     }
</span><span class="lines">@@ -736,7 +688,7 @@
</span><span class="cx">                      * always be returned. When a filter is successfully added, the data field
</span><span class="cx">                      * will be zero. */
</span><span class="cx">                     if ((kev.flags &amp; EV_ERROR) == 0 || ((kev.flags &amp; EV_ERROR) &gt; 0 &amp;&amp; kev.data != 0)) {
</span><del>-                        ui_warn(&quot;tracelib: error adding socket to kqueue&quot;);
</del><ins>+                        ui_warn(interp, &quot;tracelib: error adding socket to kqueue&quot;);
</ins><span class="cx">                         close(s);
</span><span class="cx">                         continue;
</span><span class="cx">                     }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcpextlib10xinstallc"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/pextlib1.0/xinstall.c (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/pextlib1.0/xinstall.c        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/pextlib1.0/xinstall.c        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -310,10 +310,7 @@
</span><span class="cx">                         return TCL_ERROR;
</span><span class="cx">                 }
</span><span class="cx">                 else {
</span><del>-                        char msg[255];
-
-                        snprintf(msg, sizeof msg, &quot;%s: chdir(%s)\n&quot;, funcname, curdir);
-                        ui_info(interp, msg);
</del><ins>+                        ui_info(interp, &quot;%s: chdir(%s)\n&quot;, funcname, curdir);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -443,9 +440,6 @@
</span><span class="cx">         int tempcopy, temp_fd, to_fd = 0;
</span><span class="cx">         char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN];
</span><span class="cx"> 
</span><del>-        /* message contains function name, two paths and a little bit extra formatting */
-        char msg[MAXPATHLEN * 2 + 32];
-
</del><span class="cx">         files_match = 0;
</span><span class="cx"> 
</span><span class="cx">         /* If try to install NULL file to a directory, fails. */
</span><span class="lines">@@ -547,8 +541,7 @@
</span><span class="cx">                                 Tcl_SetResult(interp, errmsg, TCL_VOLATILE);
</span><span class="cx">                                 return TCL_ERROR;
</span><span class="cx">                         }
</span><del>-                        snprintf(msg, sizeof msg, &quot;%s: %s -&gt; %s\n&quot;, funcname, from_name, to_name);
-                        ui_info(interp, msg);
</del><ins>+                        ui_info(interp, &quot;%s: %s -&gt; %s\n&quot;, funcname, from_name, to_name);
</ins><span class="cx">                 }
</span><span class="cx">                 if (!devnull) {
</span><span class="cx">                         if (copy(interp, from_fd, from_name, to_fd,
</span><span class="lines">@@ -650,8 +643,7 @@
</span><span class="cx">                                 Tcl_SetResult(interp, errmsg, TCL_VOLATILE);
</span><span class="cx">                                 return TCL_ERROR;
</span><span class="cx">                         }
</span><del>-                        snprintf(msg, sizeof msg, &quot;%s: %s -&gt; %s\n&quot;, funcname, to_name, backup);
-                        ui_info(interp, msg);
</del><ins>+                        ui_info(interp, &quot;%s: %s -&gt; %s\n&quot;, funcname, to_name, backup);
</ins><span class="cx">                         if (rename(to_name, backup) &lt; 0) {
</span><span class="cx">                                 char errmsg[255];
</span><span class="cx"> 
</span><span class="lines">@@ -664,8 +656,7 @@
</span><span class="cx">                                 return TCL_ERROR;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                snprintf(msg, sizeof msg, &quot;%s: %s -&gt; %s\n&quot;, funcname, from_name, to_name);
-                ui_info(interp, msg);
</del><ins>+                ui_info(interp, &quot;%s: %s -&gt; %s\n&quot;, funcname, from_name, to_name);
</ins><span class="cx">                 if (rename(tempfile, to_name) &lt; 0) {
</span><span class="cx">                         char errmsg[255];
</span><span class="cx"> 
</span><span class="lines">@@ -885,7 +876,6 @@
</span><span class="cx">         char backup[MAXPATHLEN];
</span><span class="cx">         int saved_errno = 0;
</span><span class="cx">         int newfd;
</span><del>-        char msg[256];
</del><span class="cx"> 
</span><span class="cx">         if (target) {
</span><span class="cx">                 /*
</span><span class="lines">@@ -909,8 +899,7 @@
</span><span class="cx">                                 return -1;
</span><span class="cx">                         }
</span><span class="cx">                         (void)snprintf(backup, MAXPATHLEN, &quot;%s%s&quot;, path, suffix);
</span><del>-                        snprintf(msg, sizeof msg, &quot;%s: %s -&gt; %s\n&quot;, funcname, path, backup);
-                        ui_info(interp, msg);
</del><ins>+                        ui_info(interp, &quot;%s: %s -&gt; %s\n&quot;, funcname, path, backup);
</ins><span class="cx">                         if (rename(path, backup) &lt; 0) {
</span><span class="cx">                                 char errmsg[255];
</span><span class="cx"> 
</span><span class="lines">@@ -1068,10 +1057,7 @@
</span><span class="cx">                                         return TCL_ERROR;
</span><span class="cx">                                 }
</span><span class="cx">                                 else {
</span><del>-                                        char msg[255];
-
-                                        snprintf(msg, sizeof msg, &quot;%s: mkdir %s\n&quot;, funcname, path);
-                                        ui_info(interp, msg);
</del><ins>+                                        ui_info(interp, &quot;%s: mkdir %s\n&quot;, funcname, path);
</ins><span class="cx">                                 }
</span><span class="cx">                         } else if (!S_ISDIR(sb.st_mode)) {
</span><span class="cx">                                 char errmsg[255];
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcportporttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port/port.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port/port.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port/port.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -1870,9 +1870,6 @@
</span><span class="cx">         global env boot_env
</span><span class="cx">         array unset env_save; array set env_save [array get env]
</span><span class="cx">         array unset env *
</span><del>-        if {${macports::macosx_version} == &quot;10.5&quot;} {
-            unsetenv *
-        }
</del><span class="cx">         array set env [array get boot_env]
</span><span class="cx"> 
</span><span class="cx">         if [catch {system -nodup [list ${macports::autoconf::man_path} $pagepath]} result] {
</span><span class="lines">@@ -1883,9 +1880,6 @@
</span><span class="cx"> 
</span><span class="cx">         # Restore internal MacPorts environment
</span><span class="cx">         array unset env *
</span><del>-        if {${macports::macosx_version} == &quot;10.5&quot;} {
-            unsetenv *
-        }
</del><span class="cx">         array set env [array get env_save]
</span><span class="cx">     } else {
</span><span class="cx">         ui_error &quot;Sorry, no help for this topic is available.&quot;
</span><span class="lines">@@ -2761,7 +2755,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> proc action_upgrade { action portlist opts } {
</span><del>-    if {[require_portlist portlist &quot;yes&quot;] || ([prefix_unwritable] &amp;&amp; ![macports::global_option_isset ports_dryrun])} {
</del><ins>+    if {[require_portlist portlist &quot;yes&quot;] || (![macports::global_option_isset ports_dryrun] &amp;&amp; [prefix_unwritable])} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3172,7 +3166,7 @@
</span><span class="cx">             return 1
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {[prefix_unwritable]} {
</del><ins>+    if {![macports::global_option_isset ports_dryrun] &amp;&amp; [prefix_unwritable]} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3713,7 +3707,7 @@
</span><span class="cx"> 
</span><span class="cx">         set res {}
</span><span class="cx">         set portfound 0
</span><del>-        foreach { opt } [array get filters] {
</del><ins>+        foreach { opt } [array names filters] {
</ins><span class="cx">             # Map from friendly name
</span><span class="cx">             set opt [map_friendly_field_names $opt]
</span><span class="cx"> 
</span><span class="lines">@@ -3940,9 +3934,6 @@
</span><span class="cx">                     # may want stuff from it as well, like TERM.
</span><span class="cx">                     array unset env_save; array set env_save [array get env]
</span><span class="cx">                     array unset env *
</span><del>-                    if {${macports::macosx_version} eq &quot;10.5&quot;} {
-                        unsetenv *
-                    }
</del><span class="cx">                     array set env [array get boot_env]
</span><span class="cx">                     
</span><span class="cx">                     # Find an editor to edit the portfile
</span><span class="lines">@@ -3971,9 +3962,6 @@
</span><span class="cx">                     
</span><span class="cx">                     # Restore internal MacPorts environment
</span><span class="cx">                     array unset env *
</span><del>-                    if {${macports::macosx_version} eq &quot;10.5&quot;} {
-                        unsetenv *
-                    }
</del><span class="cx">                     array set env [array get env_save]
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -4074,7 +4062,7 @@
</span><span class="cx">     if {[require_portlist portlist]} {
</span><span class="cx">         return 1
</span><span class="cx">     }
</span><del>-    if {($action eq &quot;install&quot; || $action eq &quot;archive&quot;) &amp;&amp; [prefix_unwritable] &amp;&amp; ![macports::global_option_isset ports_dryrun]} {
</del><ins>+    if {($action eq &quot;install&quot; || $action eq &quot;archive&quot;) &amp;&amp; ![macports::global_option_isset ports_dryrun] &amp;&amp; [prefix_unwritable]} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx">     foreachport $portlist {
</span><span class="lines">@@ -4171,6 +4159,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+proc action_mirror { action portlist opts } {
+    global macports::portdbpath
+    # handle --new option here so we only delete the db once
+    array set options $opts
+    set mirror_filemap_path [file join $macports::portdbpath distfiles_mirror.db]
+    if {[info exists options(ports_mirror_new)]
+        &amp;&amp; [string is true -strict $options(ports_mirror_new)]
+        &amp;&amp; [file exists $mirror_filemap_path]} {
+            # Trash the map file if it existed.
+            file delete -force $mirror_filemap_path
+    }
+
+    action_target $action $portlist $opts
+}
+
</ins><span class="cx"> proc action_exit { action portlist opts } {
</span><span class="cx">     # Return a semaphore telling the main loop to quit
</span><span class="cx">     return -999
</span><span class="lines">@@ -4258,6 +4261,8 @@
</span><span class="cx">     \
</span><span class="cx">     uninstall   [list action_uninstall      [ACTION_ARGS_PORTS]] \
</span><span class="cx">     \
</span><ins>+    mirror      [list action_mirror         [ACTION_ARGS_PORTS]] \
+    \
</ins><span class="cx">     installed   [list action_installed      [ACTION_ARGS_PORTS]] \
</span><span class="cx">     outdated    [list action_outdated       [ACTION_ARGS_PORTS]] \
</span><span class="cx">     contents    [list action_contents       [ACTION_ARGS_PORTS]] \
</span><span class="lines">@@ -4296,7 +4301,6 @@
</span><span class="cx">     lint        [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     livecheck   [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     distcheck   [list action_target         [ACTION_ARGS_PORTS]] \
</span><del>-    mirror      [list action_target         [ACTION_ARGS_PORTS]] \
</del><span class="cx">     load        [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     unload      [list action_target         [ACTION_ARGS_PORTS]] \
</span><span class="cx">     reload      [list action_target         [ACTION_ARGS_PORTS]] \
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portchecksumtcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portchecksum.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portchecksum.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portchecksum.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">     if {[llength $all_dist_files] == 1
</span><span class="cx">         &amp;&amp; [expr {$nb_checksum % 2}] == 0
</span><span class="cx">         &amp;&amp; [expr {$nb_checksum / 2}] &lt;= $checksum_types_count
</span><del>-        &amp;&amp; [lsearch -exact $checksum_types [lindex $checksums_str 0]] &gt;= 0} {
</del><ins>+        &amp;&amp; [lindex $checksums_str 0] in $checksum_types} {
</ins><span class="cx">         # Convert to format #2
</span><span class="cx">         set checksums_str [linsert $checksums_str 0 [lindex $all_dist_files 0]]
</span><span class="cx">         # We increased the size.
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">             incr ix_checksum
</span><span class="cx">             while {1} {
</span><span class="cx">                 set checksum_type [lindex $checksums_str $ix_checksum]
</span><del>-                if {[lsearch -exact $checksum_types $checksum_type] &gt;= 0} {
</del><ins>+                if {$checksum_type in $checksum_types} {
</ins><span class="cx">                     # append the type and the value.
</span><span class="cx">                     incr ix_checksum
</span><span class="cx">                     set checksum_value [lindex $checksums_str $ix_checksum]
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">                         ui_debug &quot;[format [msgcat::mc &quot;Correct (%s) checksum for %s&quot;] $type $distfile]&quot;
</span><span class="cx">                     } else {
</span><span class="cx">                         ui_error &quot;[format [msgcat::mc &quot;Checksum (%s) mismatch for %s&quot;] $type $distfile]&quot;
</span><del>-                        ui_info_fetch &quot;[format [msgcat::mc &quot;Portfile checksum: %s %s %s&quot;] $distfile $type $sum]&quot;
</del><ins>+                        ui_info &quot;[format [msgcat::mc &quot;Portfile checksum: %s %s %s&quot;] $distfile $type $sum]&quot;
</ins><span class="cx">                         ui_info &quot;[format [msgcat::mc &quot;Distfile checksum: %s %s %s&quot;] $distfile $type $calculated_sum]&quot;
</span><span class="cx"> 
</span><span class="cx">                         # Raise the failure flag
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portconfiguretcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portconfigure.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portconfigure.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portconfigure.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -325,16 +325,16 @@
</span><span class="cx">     }
</span><span class="cx">     set ret {}
</span><span class="cx">     foreach arch $archs {
</span><del>-        if {[lsearch -exact $supported_archs $arch] != -1} {
</del><ins>+        if {$arch in $supported_archs} {
</ins><span class="cx">             set add_arch $arch
</span><del>-        } elseif {$arch eq &quot;x86_64&quot; &amp;&amp; [lsearch -exact $supported_archs &quot;i386&quot;] != -1} {
</del><ins>+        } elseif {$arch eq &quot;x86_64&quot; &amp;&amp; &quot;i386&quot; in $supported_archs} {
</ins><span class="cx">             set add_arch &quot;i386&quot;
</span><del>-        } elseif {$arch eq &quot;ppc64&quot; &amp;&amp; [lsearch -exact $supported_archs &quot;ppc&quot;] != -1} {
</del><ins>+        } elseif {$arch eq &quot;ppc64&quot; &amp;&amp; &quot;ppc&quot; in $supported_archs} {
</ins><span class="cx">             set add_arch &quot;ppc&quot;
</span><span class="cx">         } else {
</span><span class="cx">             continue
</span><span class="cx">         }
</span><del>-        if {[lsearch -exact $ret $add_arch] == -1} {
</del><ins>+        if {$add_arch ni $ret} {
</ins><span class="cx">             lappend ret $add_arch
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -759,7 +759,7 @@
</span><span class="cx">         # add SDK flags if cross-compiling (or universal on ppc tiger)
</span><span class="cx">         if {${configure.sdkroot} ne &quot;&quot;} {
</span><span class="cx">             foreach env_var {CPPFLAGS CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS} {
</span><del>-                append_to_environment_value configure $env_var -isysroot ${configure.sdkroot}
</del><ins>+                append_to_environment_value configure $env_var -isysroot${configure.sdkroot}
</ins><span class="cx">             }
</span><span class="cx">             append_to_environment_value configure &quot;LDFLAGS&quot; -Wl,-syslibroot,${configure.sdkroot}
</span><span class="cx">         }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portdestroottcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portdestroot.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portdestroot.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portdestroot.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx">                         if {$pfile eq &quot;.&quot; || $pfile eq &quot;..&quot;} {
</span><span class="cx">                             continue
</span><span class="cx">                         }
</span><del>-                        if {[lsearch -exact $prefixPaths $pfile] == -1} {
</del><ins>+                        if {$pfile ni $prefixPaths} {
</ins><span class="cx">                             ui_warn &quot;violation by [file join $dfile $pfile]&quot;
</span><span class="cx">                             set mtree_violation &quot;yes&quot;
</span><span class="cx">                         }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portlinttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portlint.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portlint.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portlint.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -341,7 +341,7 @@
</span><span class="cx">            maintainers license homepage master_sites checksums patchfiles \
</span><span class="cx">            depends_fetch depends_extract depends_lib depends_build \
</span><span class="cx">            depends_run distfiles fetch.type lint_portsystem lint_platforms \
</span><del>-           lint_required lint_optional
</del><ins>+           lint_required lint_optional replaced_by conflicts
</ins><span class="cx">     set portarch [get_canonical_archs]
</span><span class="cx"> 
</span><span class="cx">     if (!$seen_portsystem) {
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx"> 
</span><span class="cx">     if {[info exists platforms]} {
</span><span class="cx">         foreach platform $platforms {
</span><del>-            if {[lsearch -exact $lint_platforms $platform] == -1} {
</del><ins>+            if {$platform ni $lint_platforms} {
</ins><span class="cx">                 ui_error &quot;Unknown platform: $platform&quot;
</span><span class="cx">                 incr errors
</span><span class="cx">             } else {
</span><span class="lines">@@ -450,7 +450,7 @@
</span><span class="cx"> 
</span><span class="cx">             if {![info exists variantdesc] || $variantdesc eq &quot;&quot;} {
</span><span class="cx">                 # don't warn about missing descriptions for global variants
</span><del>-                if {[lsearch -exact $local_variants $variantname] != -1 &amp;&amp;
</del><ins>+                if {$variantname in $local_variants &amp;&amp;
</ins><span class="cx">                     [variant_desc $porturl $variantname] eq &quot;&quot;} {
</span><span class="cx">                     ui_warn &quot;Variant $variantname does not have a description&quot;
</span><span class="cx">                     incr warnings
</span><span class="lines">@@ -538,6 +538,45 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if {[info exists replaced_by]} {
+        if {[regexp {[^[:alnum:]_.-]} $replaced_by]} {
+            ui_error &quot;replaced_by should be a single port name, invalid value: $replaced_by&quot;
+            incr errors
+        } else {
+            if {[catch {set res [mport_lookup $replaced_by]} error]} {
+                global errorInfo
+                ui_debug &quot;$errorInfo&quot;
+            }
+            if {$res eq &quot;&quot;} {
+                ui_error &quot;replaced_by references unknown port: $replaced_by&quot;
+                incr errors
+            } else {
+                ui_info &quot;OK: replaced_by $replaced_by&quot;
+            }
+        }
+    }
+
+    if {[info exists conflicts]} {
+        foreach cport $conflicts {
+            if {[regexp {[^[:alnum:]_.-]} $cport]} {
+                ui_error &quot;conflicts lists invalid value, should be port name: $cport&quot;
+                incr errors
+                continue
+            }
+            if {[catch {set res [mport_lookup $cport]} error]} {
+                global errorInfo
+                ui_debug &quot;$errorInfo&quot;
+                continue
+            }
+            if {$res eq &quot;&quot;} {
+                ui_error &quot;conflicts references unknown port: $cport&quot;
+                incr errors
+            } else {
+                ui_info &quot;OK: conflicts $cport&quot;
+            }
+        }
+    }
+
</ins><span class="cx">     if {[regexp &quot;^(.+)nomaintainer(@macports.org)?(.+)$&quot; $maintainers] } {
</span><span class="cx">         ui_error &quot;Using nomaintainer together with other maintainer&quot;
</span><span class="cx">         incr errors
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portlivechecktcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portlivecheck.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portlivecheck.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portlivecheck.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if {[lsearch -exact [split $available_types &quot;|&quot;] ${livecheck.type}] != -1} {
</del><ins>+    if {${livecheck.type} in [split $available_types &quot;|&quot;]} {
</ins><span class="cx">         # Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
</span><span class="cx">         set defaults_file &quot;$types_dir/${livecheck.type}.tcl&quot;
</span><span class="cx">         ui_debug &quot;Loading the defaults from '$defaults_file'&quot;
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portmirrortcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portmirror.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portmirror.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portmirror.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -53,28 +53,19 @@
</span><span class="cx"> # It also records the path in a database.
</span><span class="cx"> 
</span><span class="cx"> proc portmirror::mirror_main {args} {
</span><del>-    global fetch.type mirror_filemap ports_mirror_new portdbpath
</del><ins>+    global fetch.type mirror_filemap portdbpath
</ins><span class="cx"> 
</span><span class="cx">     set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
</span><del>-    if {![info exists mirror_filemap]
-        &amp;&amp; [info exists ports_mirror_new]
-        &amp;&amp; $ports_mirror_new eq &quot;yes&quot;
-        &amp;&amp; [file exists $mirror_filemap_path]} {
-        # Trash the map file if it existed.
-        file delete -force $mirror_filemap_path
-    }
-
</del><span class="cx">     filemap open mirror_filemap $mirror_filemap_path
</span><span class="cx"> 
</span><span class="cx">     # Check the distfiles if it's a regular fetch phase.
</span><del>-    if {&quot;${fetch.type}&quot; == &quot;standard&quot;} {
</del><ins>+    if {${fetch.type} eq &quot;standard&quot;} {
</ins><span class="cx">         # fetch the files.
</span><span class="cx">         portfetch::fetch_init $args
</span><span class="cx">         portfetch::fetch_start $args
</span><span class="cx">         portfetch::fetch_main $args
</span><span class="cx"> 
</span><span class="cx">         # checksum the files.
</span><del>-        #checksum_start
</del><span class="cx">         if {[catch {portchecksum::checksum_main $args}]} {
</span><span class="cx">             # delete the files.
</span><span class="cx">             portfetch::fetch_deletefiles $args
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10porttracetcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/porttrace.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/porttrace.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/porttrace.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -197,9 +197,7 @@
</span><span class="cx">                 allow trace_sandbox &quot;/Library&quot;
</span><span class="cx"> 
</span><span class="cx">                 # Allow a few configuration files
</span><del>-                allow trace_sandbox &quot;/etc/passwd&quot;
-                allow trace_sandbox &quot;/etc/groups&quot;
-                allow trace_sandbox &quot;/etc/localtime&quot;
</del><ins>+                allow trace_sandbox &quot;/etc&quot;
</ins><span class="cx"> 
</span><span class="cx">                 # Allow temporary locations
</span><span class="cx">                 allow trace_sandbox &quot;/tmp&quot;
</span><span class="lines">@@ -265,9 +263,6 @@
</span><span class="cx"> 
</span><span class="cx">                 foreach var {DYLD_INSERT_LIBRARIES DARWINTRACE_LOG} {
</span><span class="cx">                         array unset env $var
</span><del>-                        if {$macosx_version eq &quot;10.5&quot;} {
-                                unsetenv $var
-                        }
</del><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 # Kill socket
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portuninstalltcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portuninstall.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portuninstall.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portuninstall.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -49,8 +49,8 @@
</span><span class="cx"> default uninstall.asroot no
</span><span class="cx"> 
</span><span class="cx"> proc portuninstall::uninstall_start {args} {
</span><del>-    global prefix
-    if {![file writable $prefix] || ([getuid] == 0 &amp;&amp; [geteuid] != 0)} {
</del><ins>+    global prefix ports_dryrun
+    if {(![file writable $prefix] &amp;&amp; ![tbool ports_dryrun]) || ([getuid] == 0 &amp;&amp; [geteuid] != 0)} {
</ins><span class="cx">         # if install location is not writable, need root privileges
</span><span class="cx">         elevateToRoot &quot;uninstall&quot;
</span><span class="cx">     }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10portutiltcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/portutil.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/portutil.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/portutil.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -367,7 +367,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ui_debug &quot;Assembled command: '$cmdstring'&quot;
</del><span class="cx">     return $cmdstring
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -450,7 +449,6 @@
</span><span class="cx">     array set env [array get ${varprefix}.env_array]
</span><span class="cx">     # Call the command.
</span><span class="cx">     set fullcmdstring &quot;$command_prefix $cmdstring $command_suffix&quot;
</span><del>-    ui_debug &quot;Executing command line: $fullcmdstring&quot;
</del><span class="cx">     set code [catch {system {*}$notty {*}$nice $fullcmdstring} result]
</span><span class="cx">     # Save variables in order to re-throw the same error code.
</span><span class="cx">     set errcode $::errorCode
</span><span class="lines">@@ -461,9 +459,6 @@
</span><span class="cx"> 
</span><span class="cx">     # Restore the environment.
</span><span class="cx">     array unset env *
</span><del>-    if {$macosx_version eq &quot;10.5&quot;} {
-        unsetenv *
-    }
</del><span class="cx">     array set env [array get saved_env]
</span><span class="cx"> 
</span><span class="cx">     # Return as if system had been called directly.
</span><span class="lines">@@ -702,8 +697,7 @@
</span><span class="cx"> # determine if a variant exists.
</span><span class="cx"> proc variant_exists {name} {
</span><span class="cx">     global PortInfo
</span><del>-    if {[info exists PortInfo(variants)] &amp;&amp;
-      [lsearch -exact $PortInfo(variants) $name] &gt;= 0} {
</del><ins>+    if {[info exists PortInfo(variants)] &amp;&amp; $name in $PortInfo(variants)} {
</ins><span class="cx">         return 1
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -814,7 +808,7 @@
</span><span class="cx"> proc subport {subname body} {
</span><span class="cx">     global subport name PortInfo
</span><span class="cx">     if {$subport eq $name &amp;&amp; $subname ne $name &amp;&amp; 
</span><del>-        (![info exists PortInfo(subports)] || [lsearch -exact $PortInfo(subports) $subname] == -1)} {
</del><ins>+        (![info exists PortInfo(subports)] || $subname ni $PortInfo(subports))} {
</ins><span class="cx">         lappend PortInfo(subports) $subname
</span><span class="cx">     }
</span><span class="cx">     if {[string equal -nocase $subname $subport]} {
</span><span class="lines">@@ -893,13 +887,11 @@
</span><span class="cx"> 
</span><span class="cx"> # tbool (testbool)
</span><span class="cx"> # If the variable exists in the calling procedure's namespace
</span><del>-# and is set to &quot;yes&quot;, return 1. Otherwise, return 0
</del><ins>+# and is set to a boolean true value, return 1. Otherwise, return 0
</ins><span class="cx"> proc tbool {key} {
</span><span class="cx">     upvar $key $key
</span><span class="cx">     if {[info exists $key]} {
</span><del>-        if {[string equal -nocase [set $key] &quot;yes&quot;]} {
-            return 1
-        }
</del><ins>+        return [string is true -strict [set $key]]
</ins><span class="cx">     }
</span><span class="cx">     return 0
</span><span class="cx"> }
</span><span class="lines">@@ -1023,9 +1015,6 @@
</span><span class="cx">                     set env(LC_CTYPE) $oldlocale
</span><span class="cx">                 } else {
</span><span class="cx">                     unset env(LC_CTYPE)
</span><del>-                    if {$macosx_version eq &quot;10.5&quot;} {
-                        unsetenv LC_CTYPE
-                    }
</del><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             close $tmpfd
</span><span class="lines">@@ -1037,9 +1026,6 @@
</span><span class="cx">                 set env(LC_CTYPE) $oldlocale
</span><span class="cx">             } else {
</span><span class="cx">                 unset env(LC_CTYPE)
</span><del>-                if {$macosx_version eq &quot;10.5&quot;} {
-                    unsetenv LC_CTYPE
-                }
</del><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         close $tmpfd
</span><span class="lines">@@ -1397,7 +1383,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             # Of course, if this is a dry run, don't do the task:
</span><del>-            if {[info exists ports_dryrun] &amp;&amp; $ports_dryrun eq &quot;yes&quot; &amp;&amp; [lsearch -exact $dryrun_allow_targets $targetname] == -1} {
</del><ins>+            if {[tbool ports_dryrun] &amp;&amp; $targetname ni $dryrun_allow_targets} {
</ins><span class="cx">                 # only one message per portname
</span><span class="cx">                 if {$portname != $ports_dry_last_skipped} {
</span><span class="cx">                     ui_notice &quot;For $portname: skipping $targetname (dry run)&quot;
</span><span class="lines">@@ -1428,8 +1414,7 @@
</span><span class="cx"> 
</span><span class="cx">                 #start tracelib
</span><span class="cx">                 if {($result ==0
</span><del>-                  &amp;&amp; [info exists ports_trace]
-                  &amp;&amp; $ports_trace eq &quot;yes&quot;
</del><ins>+                  &amp;&amp; [tbool ports_trace]
</ins><span class="cx">                   &amp;&amp; $target ne &quot;clean&quot;
</span><span class="cx">                   &amp;&amp; $target ne &quot;uninstall&quot;)} {
</span><span class="cx">                     # uninstall will open a portfile from registry and call
</span><span class="lines">@@ -1492,11 +1477,9 @@
</span><span class="cx"> 
</span><span class="cx">                         # If portname is empty, the dependency is already satisfied by other means,
</span><span class="cx">                         # for example a bin: dependency on a file not installed by MacPorts
</span><del>-                        if {$name ne &quot;&quot;} {
-                            if {[lsearch -exact $deplist $name] == -1} {
-                                lappend deplist $name
-                                set deplist [recursive_collect_deps $name $deplist]
-                            }
</del><ins>+                        if {$name ne &quot;&quot; &amp;&amp; $name ni $deplist} {
+                            lappend deplist $name
+                            set deplist [recursive_collect_deps $name $deplist]
</ins><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="cx"> 
</span><span class="lines">@@ -1541,8 +1524,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 # Check dependencies &amp; file creations outside workpath.
</span><del>-                if {[info exists ports_trace]
-                  &amp;&amp; $ports_trace eq &quot;yes&quot;
</del><ins>+                if {[tbool ports_trace]
</ins><span class="cx">                   &amp;&amp; $target ne &quot;clean&quot;
</span><span class="cx">                   &amp;&amp; $target ne &quot;uninstall&quot;} {
</span><span class="cx"> 
</span><span class="lines">@@ -1614,9 +1596,6 @@
</span><span class="cx">     set env(HOME) $savedhome
</span><span class="cx">     if {[info exists env(TMPDIR)]} {
</span><span class="cx">         unset env(TMPDIR)
</span><del>-        if {$macosx_version eq &quot;10.5&quot;} {
-            unsetenv TMPDIR
-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return $result
</span><span class="lines">@@ -1633,7 +1612,7 @@
</span><span class="cx"> 
</span><span class="cx">     foreach item $deplist {
</span><span class="cx">         set name [lindex $item 0]
</span><del>-        if {[lsearch -exact $depsfound $name] == -1} {
</del><ins>+        if {$name ni $depsfound} {
</ins><span class="cx">             lappend depsfound $name
</span><span class="cx">             set depsfound [recursive_collect_deps $name $depsfound]
</span><span class="cx">         }
</span><span class="lines">@@ -1836,10 +1815,10 @@
</span><span class="cx"> 
</span><span class="cx">     set fd [open $statefile a+]
</span><span class="cx">     if {![tbool ports_dryrun]} {
</span><del>-        if {[catch {flock $fd -exclusive -noblock} result]} {
</del><ins>+        if {[catch {adv-flock $fd -exclusive -noblock} result]} {
</ins><span class="cx">             if {&quot;$result&quot; == &quot;EAGAIN&quot;} {
</span><span class="cx">                 ui_notice &quot;Waiting for lock on $statefile&quot;
</span><del>-                flock $fd -exclusive
</del><ins>+                adv-flock $fd -exclusive
</ins><span class="cx">             } elseif {&quot;$result&quot; == &quot;EOPNOTSUPP&quot;} {
</span><span class="cx">                 # Locking not supported, just return
</span><span class="cx">                 return $fd
</span><span class="lines">@@ -2052,7 +2031,7 @@
</span><span class="cx">     array set requested_variations [array get upvariations]
</span><span class="cx">     foreach key [array names upvariations *] {
</span><span class="cx">         if {![info exists PortInfo(variants)] ||
</span><del>-            [lsearch $PortInfo(variants) $key] == -1} {
</del><ins>+            $key ni $PortInfo(variants)} {
</ins><span class="cx">             ui_debug &quot;Requested variant $upvariations($key)$key is not provided by port $portname.&quot;
</span><span class="cx">             array unset upvariations $key
</span><span class="cx">         }
</span><span class="lines">@@ -2139,17 +2118,16 @@
</span><span class="cx">             break
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if { $statereq &amp;&amp;
-        !([info exists ports_force] &amp;&amp; $ports_force eq &quot;yes&quot;)} {
</del><ins>+    if {$statereq &amp;&amp; ![tbool ports_force]} {
</ins><span class="cx"> 
</span><span class="cx">         set state_fd [open_statefile]
</span><span class="cx"> 
</span><span class="cx">         array set oldvariations {}
</span><span class="cx">         if {[check_statefile_variants variations oldvariations $state_fd]} {
</span><del>-            ui_error &quot;Requested variants \&quot;[canonicalize_variants [array get variations]]\&quot; do not match original selection \&quot;[canonicalize_variants [array get oldvariations]]\&quot;.&quot;
-            ui_error &quot;Please use the same variants again, perform 'port clean [option subport]' or specify the force option (-f).&quot;
</del><ins>+            ui_error &quot;Requested variants \&quot;[canonicalize_variants [array get variations]]\&quot; do not match those the build was started with: \&quot;[canonicalize_variants [array get oldvariations]]\&quot;.&quot;
+            ui_error &quot;Please use the same variants again, or run 'port clean [option subport]' first to remove the existing partially completed build.&quot;
</ins><span class="cx">             set result 1
</span><del>-        } elseif {!([info exists ports_dryrun] &amp;&amp; $ports_dryrun eq &quot;yes&quot;)} {
</del><ins>+        } elseif {![tbool ports_dryrun]} {
</ins><span class="cx">             # Write variations out to the statefile
</span><span class="cx">             foreach key [array names variations *] {
</span><span class="cx">                 write_statefile variant $variations($key)$key $state_fd
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcport10teststesttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/port1.0/tests/test.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/port1.0/tests/test.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/port1.0/tests/test.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         set test_suite [glob *.test]
</span><span class="cx">         foreach test $test_suite {
</span><span class="cx">             if {$test_name ne $test} {
</span><del>-                set no [expr {$no + 1}]
</del><ins>+                incr no
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         if {$no == [llength $test_suite]} {
</span><span class="lines">@@ -83,8 +83,13 @@
</span><span class="cx">         set lastline [lindex [split $result &quot;\n&quot;] end]
</span><span class="cx"> 
</span><span class="cx">         if {[lrange [split $lastline &quot;\t&quot;] 1 1] ne &quot;Total&quot;} {
</span><del>-            set lastline [lindex [split $result &quot;\n&quot;] end-2]
-            set errmsg [lindex [split $result &quot;\n&quot;] end]
</del><ins>+            if {[lrange [split $lastline &quot;\t&quot;] 1 1] eq &quot;&quot;} {
+                set lastline [lindex [split $result &quot;\n&quot;] 0]
+                set errmsg [lindex [split $result &quot;\n&quot;] 2]
+            } else {
+                set lastline [lindex [split $result &quot;\n&quot;] end-2]
+                set errmsg [lindex [split $result &quot;\n&quot;] end]
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         set splitresult [split $lastline &quot;\t&quot;]
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcregistry20portimagetcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/registry2.0/portimage.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/registry2.0/portimage.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/registry2.0/portimage.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -534,7 +534,7 @@
</span><span class="cx">                 # we'll set the directory attributes properly for all
</span><span class="cx">                 # directories.
</span><span class="cx">                 set directory [::file dirname $file]
</span><del>-                while { [lsearch -exact $files $directory] == -1 } {
</del><ins>+                while {$directory ni $files} {
</ins><span class="cx">                     lappend files $directory
</span><span class="cx">                     set directory [::file dirname $directory]
</span><span class="cx">                 }
</span><span class="lines">@@ -688,7 +688,7 @@
</span><span class="cx"> 
</span><span class="cx">             # Split out the filename's subpaths and add them to the image list
</span><span class="cx">             # as well.
</span><del>-            while { [lsearch -exact $files $directory] == -1 } {
</del><ins>+            while {$directory ni $files} {
</ins><span class="cx">                 lappend files $directory
</span><span class="cx">                 set directory [::file dirname $directory]
</span><span class="cx">             }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcregistry20portuninstalltcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/registry2.0/portuninstall.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/registry2.0/portuninstall.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/registry2.0/portuninstall.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">         ui_msg &quot;For $portname @${composite_spec}: skipping uninstall (dry run)&quot;
</span><span class="cx">         # allow deps to not be excluded from the list below just because this port is still a dependent
</span><span class="cx">         if {[info exists options(ports_uninstall_follow-dependencies)] &amp;&amp; [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
</span><del>-            set uports [list $portname]
</del><ins>+            set uports [list [list $portname $version $revision $variants]]
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Uninstalling %s @%s&quot;] $portname $composite_spec]&quot;
</span><span class="lines">@@ -307,25 +307,21 @@
</span><span class="cx">             set uninstalling_this_dep 0
</span><span class="cx">             if {![catch {set ilist [registry::installed $dep]}]} {
</span><span class="cx">                 foreach i $ilist {
</span><del>-                    set iversion [lindex $i 1]
-                    set irevision [lindex $i 2]
-                    set ivariants [lindex $i 3]
</del><ins>+                    lassign $i dep iversion irevision ivariants
+                    if {[list $dep $iversion $irevision $ivariants] in $uports} {
+                        continue
+                    }
</ins><span class="cx">                     set regref [registry::open_entry $dep $iversion $irevision $ivariants [lindex $i 5]]
</span><span class="cx">                     if {![registry::property_retrieve $regref requested]} {
</span><del>-                        set dependentlist [registry::list_dependents $dep $iversion $irevision $ivariants]
-                        set dependents {}
-                        foreach depdt $dependentlist {
-                            lappend dependents [lindex $depdt 2]
-                        }
</del><span class="cx">                         set all_dependents_uninstalling 1
</span><del>-                        foreach depdt $dependents {
-                            if {[lsearch -exact $uports $depdt] == -1} {
</del><ins>+                        foreach depdt [$regref dependents] {
+                            if {[list [$depdt name] [$depdt version] [$depdt revision] [$depdt variants]] ni $uports} {
</ins><span class="cx">                                 set all_dependents_uninstalling 0
</span><span class="cx">                                 break
</span><span class="cx">                             }
</span><span class="cx">                         }
</span><span class="cx">                         if {$all_dependents_uninstalling} {
</span><del>-                            lappend uports $dep
</del><ins>+                            lappend uports [list $dep $iversion $irevision $ivariants]
</ins><span class="cx">                             lappend portilist $dep@${iversion}_${irevision}${ivariants}
</span><span class="cx">                             set uninstalling_this_dep 1
</span><span class="cx">                         }
</span><span class="lines">@@ -337,7 +333,7 @@
</span><span class="cx">                 foreach depref $deprefs {
</span><span class="cx">                     set depdeps [registry_uninstall::generate_deplist $depref $optionslist]
</span><span class="cx">                     foreach d $depdeps {
</span><del>-                        if {[lsearch -exact $alldeps $d] == -1} {
</del><ins>+                        if {$d ni [lrange $alldeps $j+1 end]} {
</ins><span class="cx">                             lappend alldeps $d 
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="lines">@@ -354,21 +350,16 @@
</span><span class="cx"> 
</span><span class="cx">     # uninstall all dependencies in order from uports
</span><span class="cx">     foreach dp $uports {
</span><del>-        if {![catch {set ilist [registry::installed $dp]}]} {
-            foreach i $ilist {
-                set iversion [lindex $i 1]
-                set irevision [lindex $i 2]
-                set ivariants [lindex $i 3]
-                set regref [registry::open_entry $dp $iversion $irevision $ivariants [lindex $i 5]]
-                if {[info exists options(ports_dryrun)] &amp;&amp; [string is true -strict $options(ports_dryrun)]} {
-                    if {$dp ne $portname} {
-                        ui_msg &quot;For $dp @${iversion}_${irevision}${ivariants}: skipping uninstall (dry run)&quot;
-                    }
-                } else {
-                    if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall [array get options]]} {
-                        registry_uninstall::uninstall $dp $iversion $irevision $ivariants [array get options]
-                    }
</del><ins>+        lassign $dp iname iversion irevision ivariants
+        if {![catch {registry::open_entry $iname $iversion $irevision $ivariants &quot;&quot;} regref]} {
+            if {[info exists options(ports_dryrun)] &amp;&amp; [string is true -strict $options(ports_dryrun)]} {
+                if {$iname ne $portname} {
+                    ui_msg &quot;For $iname @${iversion}_${irevision}${ivariants}: skipping uninstall (dry run)&quot;
</ins><span class="cx">                 }
</span><ins>+            } else {
+                if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall [array get options]]} {
+                    registry_uninstall::uninstall $iname $iversion $irevision $ivariants [array get options]
+                }
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="branchesgsoc15portfilebasesrcregistry20registrytcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc15-portfile/base/src/registry2.0/registry.tcl (139405 => 139406)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc15-portfile/base/src/registry2.0/registry.tcl        2015-08-16 03:47:02 UTC (rev 139405)
+++ branches/gsoc15-portfile/base/src/registry2.0/registry.tcl        2015-08-16 08:27:33 UTC (rev 139406)
</span><span class="lines">@@ -395,10 +395,10 @@
</span><span class="cx">         }
</span><span class="cx">         set lockfd [::open $lockpath w]
</span><span class="cx">     }
</span><del>-    if {[catch {flock $lockfd -exclusive -noblock} result]} {
</del><ins>+    if {[catch {adv-flock $lockfd -exclusive -noblock} result]} {
</ins><span class="cx">         if {$result eq &quot;EAGAIN&quot;} {
</span><span class="cx">             ui_msg &quot;Waiting for lock on $lockpath&quot;
</span><del>-            flock $lockfd -exclusive
</del><ins>+            adv-flock $lockfd -exclusive
</ins><span class="cx">         } elseif {$result eq &quot;EOPNOTSUPP&quot;} {
</span><span class="cx">             # Locking not supported, just return
</span><span class="cx">             ui_debug &quot;flock not supported, not locking registry&quot;
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx">     }
</span><span class="cx">     if {[info exists lockfd]} {
</span><span class="cx">         # not much point trying to handle errors
</span><del>-        catch {flock $lockfd -unlock}
</del><ins>+        catch {adv-flock $lockfd -unlock}
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>