<!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>[124243] trunk/base</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Merge of Interactive Port Command project. Details: http://trac.macports.org/wiki/SummerOfCode2014_interactive</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasedocport1">trunk/base/doc/port.1</a></li>
<li><a href="#trunkbasedocport1txt">trunk/base/doc/port.1.txt</a></li>
<li><a href="#trunkbasesrcmacports10macportstcl">trunk/base/src/macports1.0/macports.tcl</a></li>
<li><a href="#trunkbasesrcportporttcl">trunk/base/src/port/port.tcl</a></li>
<li><a href="#trunkbasesrcregistry20portimagetcl">trunk/base/src/registry2.0/portimage.tcl</a></li>
<li><a href="#trunkbasesrcregistry20portuninstalltcl">trunk/base/src/registry2.0/portuninstall.tcl</a></li>
<li><a href="#trunkbasesrcregistry20registry_utiltcl">trunk/base/src/registry2.0/registry_util.tcl</a></li>
<li><a href="#trunkbaseteststestlibrarytclin">trunk/base/tests/test/library.tcl.in</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkbase">trunk/base/</a></li>
<li><a href="#trunkbasesrcpextlib10Makefilein">trunk/base/src/pextlib1.0/Makefile.in</a></li>
<li><a href="#trunkbasesrcpextlib10sha2c">trunk/base/src/pextlib1.0/sha2.c</a></li>
<li><a href="#trunkbasesrcpextlib10sha2h">trunk/base/src/pextlib1.0/sha2.h</a></li>
<li><a href="#trunkbasesrcregistry20receipt_sqlitetcl">trunk/base/src/registry2.0/receipt_sqlite.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbase"></a>
<div class="propset"><h4>Property changes: trunk/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/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">/users/perry/base-bugs_and_notes:45682-46060
</span><span class="cx">/users/perry/base-select:44044-44692
</span><a id="trunkbasedocport1"></a>
<div class="modfile"><h4>Modified: trunk/base/doc/port.1 (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/doc/port.1        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/doc/port.1        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> .SH &quot;SYNOPSIS&quot;
</span><span class="cx"> .sp
</span><span class="cx"> .nf
</span><del>-\fBport\fR [\fB\-bcdfknopqRstuvy\fR] [\fB\-D\fR \fIportdir\fR] [\fB\-F\fR \fIcmdfile\fR] [\fIaction\fR] [\fIactionflags\fR]
</del><ins>+\fBport\fR [\fB\-bcdfknNopqRstuvy\fR] [\fB\-D\fR \fIportdir\fR] [\fB\-F\fR \fIcmdfile\fR] [\fIaction\fR] [\fIactionflags\fR]
</ins><span class="cx">      [[\fIportname\fR | \fIpseudo\-portname\fR | \fIport\-expressions\fR | \fIport\-url\fR]]
</span><span class="cx">      [[\fI@version\fR] [+/\-variant \&amp;...] \&amp;... [option=value \&amp;...]]
</span><span class="cx"> .fi
</span><span class="lines">@@ -464,9 +464,14 @@
</span><span class="cx"> .PP
</span><span class="cx"> \-q
</span><span class="cx"> .RS 4
</span><del>-Quiet mode, suppress informational messages to a minimum
</del><ins>+Quiet mode, suppress informational messages to a minimum, implies \-N
</ins><span class="cx"> .RE
</span><span class="cx"> .PP
</span><ins>+\-N
+.RS 4
+Non-Interactive mode, no interactive questions asked
+.RE
+.PP
</ins><span class="cx"> \fBInstallation and upgrade\fR
</span><span class="cx"> .PP
</span><span class="cx"> \-n
</span></span></pre></div>
<a id="trunkbasedocport1txt"></a>
<div class="modfile"><h4>Modified: trunk/base/doc/port.1.txt (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/doc/port.1.txt        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/doc/port.1.txt        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> SYNOPSIS
</span><span class="cx"> --------
</span><span class="cx"> [cmdsynopsis]
</span><del>-*port* [*-bcdfknopqRstuvy*] [*-D* 'portdir'] [*-F* 'cmdfile'] ['action'] ['actionflags']
</del><ins>+*port* [*-bcdfknNopqRstuvy*] [*-D* 'portdir'] [*-F* 'cmdfile'] ['action'] ['actionflags']
</ins><span class="cx">      [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
</span><span class="cx">      [['@version'] [+/-variant ...] ... [option=value ...]]
</span><span class="cx"> 
</span><span class="lines">@@ -130,8 +130,11 @@
</span><span class="cx">     Debug mode, generate debugging messages, implies -v
</span><span class="cx"> 
</span><span class="cx"> -q::
</span><del>-    Quiet mode, suppress informational messages to a minimum
</del><ins>+    Quiet mode, suppress informational messages to a minimum, implies -N
</ins><span class="cx"> 
</span><ins>+-N::
+    Non-interactive mode, interactive questions are not asked 
+
</ins><span class="cx"> .Installation and upgrade
</span><span class="cx"> -n::
</span><span class="cx">     Don't follow dependencies in upgrade (affects 'upgrade' and 'install')
</span></span></pre></div>
<a id="trunkbasesrcmacports10macportstcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/macports1.0/macports.tcl (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/macports1.0/macports.tcl        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/src/macports1.0/macports.tcl        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -2057,13 +2057,27 @@
</span><span class="cx"> 
</span><span class="cx">         # print the dep list
</span><span class="cx">         if {[llength $dlist] &gt; 0} {
</span><del>-            set depstring &quot;$macports::ui_prefix Dependencies to be installed:&quot;
-            foreach ditem $dlist {
-                append depstring &quot; [ditem_key $ditem provides]&quot;
</del><ins>+            ##
+            # User Interaction Question
+            # Asking before installing dependencies
+            if {[info exists macports::ui_options(questions_yesno)]} {
+                set deplist {}
+                foreach ditem $dlist {
+                    lappend deplist [ditem_key $ditem provides]
+                }
+                set retvalue [$macports::ui_options(questions_yesno) &quot;The following dependencies will be installed: &quot; &quot;TestCase#2&quot; [lsort $deplist] {y} 0]
+                if {$retvalue == 1} {
+                    return 0
+                } 
+            } else {
+                set depstring &quot;$macports::ui_prefix Dependencies to be installed:&quot;
+                foreach ditem $dlist {
+                    append depstring &quot; [ditem_key $ditem provides]&quot;
+                }
+                ui_msg $depstring
</ins><span class="cx">             }
</span><del>-            ui_msg $depstring
</del><span class="cx">         }
</span><del>-
</del><ins>+                
</ins><span class="cx">         # install them
</span><span class="cx">         set result [dlist_eval $dlist _mportactive [list _mportexec activate]]
</span><span class="cx"> 
</span><span class="lines">@@ -4870,11 +4884,30 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ui_msg &quot;$macports::ui_prefix Rebuilding in order&quot;
</del><ins>+        set broken_portnames {}
+        if {![info exists macports::ui_options(questions_yesno)]} {
+            ui_msg &quot;$macports::ui_prefix Rebuilding in order&quot;
+        }
</ins><span class="cx">         foreach port $topsort_ports {
</span><del>-            ui_msg &quot;     [$port name] @[$port version] [$port variants][$port negated_variants]&quot;
</del><ins>+            lappend broken_portnames [$port name]@[$port version][$port variants]
+            if {![info exists macports::ui_options(questions_yesno)]} {
+                ui_msg &quot;     [$port name] @[$port version] [$port variants][$port negated_variants]&quot;
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        ##
+        # User Interaction Question
+        # Asking before rebuilding in rev-upgrade
+        if {[info exists macports::ui_options(questions_yesno)]} {
+            ui_msg &quot;You can always run 'port rev-upgrade' again to fix errors.&quot;
+            set retvalue [$macports::ui_options(questions_yesno) &quot;The following ports will be rebuilt:&quot; &quot;TestCase#1&quot; $broken_portnames {y} 0]
+            if {$retvalue == 1} {
+                # quit as user answered 'no'
+                return 0
+            }
+            unset macports::ui_options(questions_yesno)
+        }
+
</ins><span class="cx">         # shared depscache for all ports that are going to be rebuilt
</span><span class="cx">         array set depscache {}
</span><span class="cx">         set status 0
</span></span></pre></div>
<a id="trunkbasesrcpextlib10Makefilein"></a>
<div class="propset"><h4>Property changes: trunk/base/src/pextlib1.0/Makefile.in</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/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/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
</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="trunkbasesrcpextlib10sha2c"></a>
<div class="propset"><h4>Property changes: trunk/base/src/pextlib1.0/sha2.c</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/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.c:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/sha2.c:106692-111324
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/sha2.c:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/sha2.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/sha2.c:57914-66452
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.c:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/sha2.c:44044-44692
</span><span class="cx">   + /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.c:37343-46937
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.c:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/sha2.c:106692-111324
</span><span class="cx">/branches/gsoc14-interactive/base/src/pextlib1.0/sha2.c:119516-124240
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/sha2.c:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/sha2.c:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/sha2.c:57914-66452
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.c:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/sha2.c:44044-44692
</span><a id="trunkbasesrcpextlib10sha2h"></a>
<div class="propset"><h4>Property changes: trunk/base/src/pextlib1.0/sha2.h</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/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.h:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/sha2.h:106692-111324
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/sha2.h:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/sha2.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/sha2.h:57914-66452
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.h:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/sha2.h:44044-44692
</span><span class="cx">   + /branches/gsoc08-privileges/base/src/pextlib1.0/sha2.h:37343-46937
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/pextlib1.0/sha2.h:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/pextlib1.0/sha2.h:106692-111324
</span><span class="cx">/branches/gsoc14-interactive/base/src/pextlib1.0/sha2.h:119516-124240
</span><span class="cx">/branches/universal-sanity/base/src/pextlib1.0/sha2.h:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/pextlib1.0/sha2.h:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/pextlib1.0/sha2.h:57914-66452
</span><span class="cx">/users/perry/base-bugs_and_notes/src/pextlib1.0/sha2.h:45682-46060
</span><span class="cx">/users/perry/base-select/src/pextlib1.0/sha2.h:44044-44692
</span><a id="trunkbasesrcportporttcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/port/port.tcl (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/port/port.tcl        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/src/port/port.tcl        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">         # set portname again since the one we were passed may not have had the correct case
</span><span class="cx">         set portname [lindex $ilist 0 0]
</span><span class="cx">         ui_notice &quot;The following versions of $portname are currently installed:&quot;
</span><del>-        foreach i [portlist_sortint $ilist] { 
</del><ins>+        foreach i [portlist_sortint $ilist] {
</ins><span class="cx">             set iname [lindex $i 0]
</span><span class="cx">             set iversion [lindex $i 1]
</span><span class="cx">             set irevision [lindex $i 2]
</span><span class="lines">@@ -333,7 +333,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> proc entry_for_portlist {portentry} {
</span><span class="cx">     global global_options global_variations
</span><span class="cx"> 
</span><span class="lines">@@ -4493,11 +4492,17 @@
</span><span class="cx">                     }
</span><span class="cx">                     q {
</span><span class="cx">                         set ui_options(ports_quiet) yes
</span><ins>+                        # quiet implies noninteractive
+                        set ui_options(ports_noninteractive) yes
</ins><span class="cx">                     }
</span><span class="cx">                     p {
</span><span class="cx">                         # Ignore errors while processing within a command
</span><span class="cx">                         set ui_options(ports_processall) yes
</span><span class="cx">                     }
</span><ins>+                    N { 
+                        # Interactive mode is available or not
+                        set ui_options(ports_noninteractive) yes
+                    }
</ins><span class="cx">                     f {
</span><span class="cx">                         set global_options(ports_force) yes
</span><span class="cx">                     }
</span><span class="lines">@@ -5285,7 +5290,207 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+# Create namespace for questions
+namespace eval portclient::questions {
+        
+        package require Tclx
+        ##
+        # Function that handles printing of a timeout.
+        #
+        # @param time
+        #        The amount of time for which a timeout is to occur.
+        # @param def
+        #        The default action to be taken in the occurence of a timeout.
+        proc ui_timeout {def timeout} {
+                fconfigure stdin -blocking 0
</ins><span class="cx"> 
</span><ins>+                signal error {TERM INT}
+                while {$timeout &gt;= 0} {
+                        if {[catch {set inp [read stdin]} err]} {
+                                return -code error &quot;Ctrl-C&quot;
+                        }
+                        if {$inp eq &quot;\n&quot;} {
+                                return $def
+                        }
+                        puts -nonewline &quot;\r&quot;
+                        puts -nonewline [format &quot;Continuing in %02d s. Press Ctrl-C to exit: &quot; $timeout]
+                        flush stdout
+                        after 1000
+                        incr timeout -1
+                }
+                puts &quot;&quot;
+                fconfigure stdin -blocking 1
+                signal -restart error {TERM INT}
+                return $def
+        }
+        
+        ##
+        # Main function that displays numbered choices for a multiple choice question.
+        #
+        # @param msg
+        #        The question specific message that is to be printed before asking the question.
+        # @param ???name???
+        #        May be a qid will be of better use instead as the client does not do anything port specific.
+        # @param ports
+        #        The list of ports for which the question is being asked.
+        proc ui_choice {msg name ports} {
+                # Print the main message
+                puts $msg
+                
+                # Print portname or port list suitably
+                set i 1
+                foreach port $ports {
+                        puts -nonewline &quot; $i) &quot;
+                        puts [string map {@ &quot; @&quot; ( &quot; (&quot;} $port]
+                        incr i
+                }
+        }
+        
+        ##
+        # Displays a question with 'yes' and 'no' as options. 
+        # Waits for user input indefinitely unless a timeout is specified.
+        # Shows the list of port passed to it without any numbers.
+        #
+        # @param msg
+        #        The question specific message that is to be printed before asking the question.
+        # @param ???name???
+        #        May be a qid will be of better use instead as the client does not do anything port specific.
+        # @param ports
+        #        The port/list of ports for which the question is being asked.
+        # @param def
+        #        The default answer to the question.
+        # @param time
+        #                  The amount of time for which a timeout is to occur.
+        proc ui_ask_yesno {msg name ports def {timeout 0}} {
+                # Set number default to the given letter default
+                if {$def == {y}} {
+                        set default 0
+                } else {
+                        set default 1
+                }
+                
+                puts -nonewline $msg
+                set leftmargin &quot; &quot;
+                
+                # Print portname or port list suitably
+                if {[llength $ports] == 1} {
+                        puts -nonewline &quot; &quot;
+                        puts [string map {@ &quot; @&quot;} $ports]
+                } else {
+                        puts &quot;&quot;
+                        foreach port $ports {
+                                puts -nonewline $leftmargin  
+                                puts [string map {@ &quot; @&quot;} $port]
+                        }
+                }
+                
+                # Check if timeout is set or not
+                if {$timeout &gt; 0} {
+                        # Run ui_timeout and skip the rest of the stuff here
+                        return [ui_timeout $default $timeout] 
+                }
+                                
+                # Check for the default and print accordingly
+                if {$def == {y}} {
+                        puts -nonewline &quot;Continue? \[Y/n\]: &quot;
+                        flush stdout
+                } else {
+                        puts -nonewline &quot;Continue? \[y/N\]: &quot;
+                        flush stdout
+                }
+                
+                # User input (probably requires some input error checking code) 
+                while 1 {
+                        signal error {TERM INT}
+                        if {[catch {set input [gets stdin]} err]} {
+                                return -code error &quot;Ctrl-C&quot;
+                        }
+                        signal -restart error {TERM INT}
+                        if {$input in {y Y}} {
+                                return 0
+                        } elseif {$input in {n N}} {
+                                return 1
+                        } elseif {$input == &quot;&quot;} {
+                                return $default
+                        } else {
+                                puts &quot;Please enter either 'y' or 'n'.&quot;
+                        }
+                }
+        }
+        
+        ##
+        # Displays a question with a list of numbered choices and asks the user to enter a number to specify their choice.
+        # Waits for user input indefinitely.
+        #
+        # @param msg
+        #        The question specific message that is to be printed before asking the question.
+        # @param ???name???
+        #        May be a qid will be of better use instead as the client does not do anything port specific.
+        # @param ports
+        #        The port/list of ports for which the question is being asked.
+        proc ui_ask_singlechoice {msg name ports} {
+                ui_choice $msg $name $ports
+                                
+                # User Input (single input restriction)
+                while 1 {
+                        puts -nonewline &quot;Enter a number to select an option: &quot;
+                        flush stdout
+                        signal error {TERM INT}
+                        if {[catch {set input [gets stdin]} err]} {
+                                return -code error &quot;Ctrl-C&quot;
+                        }
+                        signal -restart error {TERM INT}
+                        if {($input &lt;= [llength $ports] &amp;&amp; [string is integer -strict $input])} {
+                                return $input
+                        } else {
+                                puts &quot;Please enter an index from the above list.&quot;
+                        }
+                }
+        }
+        
+        ##
+        # Displays a question with a list of numbered choices and asks the user to enter a space separated string of numbers to specify their choice.
+        # Waits for user input indefinitely.
+        #
+        # @param msg
+        #        The question specific message that is to be printed before asking the question.
+        # @param ???name???
+        #        May be a qid will be of better use instead as the client does not do anything port specific.
+        # @param ports
+        #        The list of ports for which the question is being asked.
+        proc ui_ask_multichoice {msg name ports} {
+                
+                ui_choice $msg $name $ports
+                                
+                # User Input (with Multiple input parsing) 
+                while 1 {
+                        puts -nonewline &quot;Enter the numbers to select the options: &quot;
+                        flush stdout
+                        signal error {TERM INT}
+                        if {[catch {set input [gets stdin]} err]} {
+                                return -code error &quot;Ctrl-C&quot;
+                        }
+                        signal -restart error {TERM INT}
+                        set count 0
+                        # check if input is non-empty and otherwise fine
+                        if {$input == &quot;&quot;} {
+                                continue
+                        }
+                        foreach num $input {
+                                if {($num &lt;= [llength $ports] &amp;&amp; [string is integer -strict $num])} {
+                                        incr count
+                                } else {
+                                        puts &quot;Please enter numbers separated by a space which are indices from the above list.&quot;
+                                        break
+                                }
+                        }
+                        if {$count == [llength $input]} {
+                                return $input
+                        }
+                }
+        }
+}
+
</ins><span class="cx"> ##########################################
</span><span class="cx"> # Main
</span><span class="cx"> ##########################################
</span><span class="lines">@@ -5340,6 +5545,15 @@
</span><span class="cx">     set ui_options(progress_generic)  portclient::progress::generic
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+if {[isatty stdin]
+        &amp;&amp; [isatty stdout]
+        &amp;&amp; (![info exists ui_options(ports_quiet)] || $ui_options(ports_quiet) ne &quot;yes&quot;)
+        &amp;&amp; (![info exists ui_options(ports_noninteractive)] || $ui_options(ports_noninteractive) ne &quot;yes&quot;)} {
+        set ui_options(questions_yesno) portclient::questions::ui_ask_yesno
+        set ui_options(questions_singlechoice) portclient::questions::ui_ask_singlechoice
+        set ui_options(questions_multichoice) portclient::questions::ui_ask_multichoice
+}
+
</ins><span class="cx"> set ui_options(notifications_append) portclient::notifications::append
</span><span class="cx"> 
</span><span class="cx"> # Get arguments remaining after option processing
</span></span></pre></div>
<a id="trunkbasesrcregistry20portimagetcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/portimage.tcl (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/portimage.tcl        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/src/registry2.0/portimage.tcl        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -185,8 +185,6 @@
</span><span class="cx">         return -code error &quot;Active version of $name is not $v but ${specifier}.&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Deactivating %s @%s&quot;] $name $specifier]&quot;
-
</del><span class="cx">     if { [$requested installtype] ne &quot;image&quot; } {
</span><span class="cx">         return -code error &quot;Image error: ${name} @${specifier} not installed as an image.&quot;
</span><span class="cx">     }
</span><span class="lines">@@ -194,11 +192,16 @@
</span><span class="cx">     if { [$requested state] ne &quot;installed&quot; } {
</span><span class="cx">         return -code error &quot;Image error: ${name} @${specifier} is not active.&quot;
</span><span class="cx">     }
</span><del>-
</del><ins>+        
</ins><span class="cx">     if {![info exists options(ports_nodepcheck)] || ![string is true -strict $options(ports_nodepcheck)]} {
</span><del>-        registry::check_dependents $requested $force &quot;deactivate&quot;
</del><ins>+        set retvalue [registry::check_dependents $requested $force &quot;deactivate&quot;]
+        if {$retvalue eq &quot;quit&quot;} {
+            return
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Deactivating %s @%s&quot;] $name $specifier]&quot;
+        
</ins><span class="cx">     _deactivate_contents $requested [$requested files] $force
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -220,18 +223,38 @@
</span><span class="cx">     set ilist [registry::entry imaged {*}$searchkeys]
</span><span class="cx"> 
</span><span class="cx">     if { [llength $ilist] &gt; 1 } {
</span><del>-        ui_msg &quot;$UI_PREFIX [msgcat::mc &quot;The following versions of $name are currently installed:&quot;]&quot;
</del><ins>+        set portilist {}
+        set msg &quot;The following versions of $name are currently installed:&quot;
+        if {[macports::ui_isset ports_noninteractive]} {
+            ui_msg &quot;$UI_PREFIX [msgcat::mc $msg]&quot;
+        }
</ins><span class="cx">         foreach i $ilist {
</span><span class="cx">             set iname [$i name]
</span><span class="cx">             set iversion [$i version]
</span><span class="cx">             set irevision [$i revision]
</span><span class="cx">             set ivariants [$i variants]
</span><del>-            if { [$i state] eq &quot;installed&quot; } {
-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s (active)&quot;] $iname $iversion $irevision $ivariants]&quot;
</del><ins>+            ##
+            # User Interaction Question
+            # Asking choice to select option in case of ambiguous activate
+            if {[info exists macports::ui_options(questions_singlechoice)]} {
+                if { [$i state] eq &quot;installed&quot; } {
+                    lappend portilist $iname@${iversion}_${irevision}${ivariants}(active)
+                } else {
+                    lappend portilist $iname@${iversion}_${irevision}${ivariants}
+                }
</ins><span class="cx">             } else {
</span><del>-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s&quot;] $iname $iversion $irevision $ivariants]&quot;
</del><ins>+                if { [$i state] eq &quot;installed&quot; } {
+                    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s (active)&quot;] $iname $iversion $irevision $ivariants]&quot;
+                } else {
+                    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s_%s%s&quot;] $iname $iversion $irevision $ivariants]&quot;
+                }
</ins><span class="cx">             }
</span><span class="cx">         }
</span><ins>+        if {[info exists macports::ui_options(questions_singlechoice)]} {
+            set retvalue [$macports::ui_options(questions_singlechoice) $msg &quot;Choice_Q1&quot; $portilist]
+            set index [expr { $retvalue - 1 }]
+            return [lindex $ilist $index]
+        }
</ins><span class="cx">         throw registry::invalid &quot;Registry error: Please specify the full version as recorded in the port registry.&quot;
</span><span class="cx">     } elseif { [llength $ilist] == 1 } {
</span><span class="cx">         return [lindex $ilist 0]
</span></span></pre></div>
<a id="trunkbasesrcregistry20portuninstalltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/portuninstall.tcl (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/portuninstall.tcl        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/src/registry2.0/portuninstall.tcl        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -41,6 +41,69 @@
</span><span class="cx"> 
</span><span class="cx"> namespace eval registry_uninstall {
</span><span class="cx"> 
</span><ins>+# generate list of all dependencies of the port
+proc generate_deplist {port {optslist &quot;&quot;}} {
+    array set options $optslist
+    # note deps before we uninstall if we're going to uninstall them too
+    if {[info exists options(ports_uninstall_follow-dependencies)] &amp;&amp; [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
+        set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
+        set all_dependencies {}
+        # look up deps from the saved portfile if possible
+        if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optslist]}]} {
+            array set depportinfo [mportinfo $mport]
+            mportclose $mport
+            foreach type $deptypes {
+                if {[info exists depportinfo($type)]} {
+                    foreach dep $depportinfo($type) {
+                        lappend all_dependencies [lindex [split $dep :] end]
+                    }
+                }
+            }
+            # append those from the registry (could be different because of path deps)
+            foreach dep [$port dependencies] {
+                lappend all_dependencies [$dep name]
+            }
+        } else {
+            # grab the deps from the dep map
+            set portname [$port name]
+            set depmaplist [registry::list_depends $portname [$port version] [$port revision] [$port variants]]
+            foreach dep $depmaplist {
+                lappend all_dependencies [lindex $dep 0]
+            }
+            # and the ones from the current portfile
+            if {![catch {mportlookup $portname} result] &amp;&amp; [llength $result] &gt;= 2} {
+                array set depportinfo [lindex $result 1]
+                set porturl $depportinfo(porturl)
+                set variations {}
+                set minusvariant [lrange [split [registry::property_retrieve $port negated_variants] -] 1 end]
+                set plusvariant [lrange [split [$port variants] +] 1 end]
+                foreach v $plusvariant {
+                    lappend variations $v &quot;+&quot;
+                }
+                foreach v $minusvariant {
+                    lappend variations $v &quot;-&quot;
+                            }
+                if {![catch {set mport [mportopen $porturl [concat $optionslist subport $portname] [array get variations]]} result]} {
+                    array unset depportinfo
+                    array set depportinfo [mportinfo $mport]
+                    mportclose $mport
+                }
+                foreach type $deptypes {
+                    if {[info exists depportinfo($type)]} {
+                        foreach dep $depportinfo($type) {
+                            lappend all_dependencies [lindex [split $dep :] end]
+                        }
+                    }
+                }
+            }
+        }
+        array unset depportinfo
+        set all_dependencies [lsort -unique $all_dependencies]
+        return $all_dependencies
+    }
+    return {}
+}
+
</ins><span class="cx"> # takes a composite version spec rather than separate version,revision,variants
</span><span class="cx"> proc uninstall_composite {portname {v &quot;&quot;} {optionslist &quot;&quot;}} {
</span><span class="cx">     if {$v eq &quot;&quot;} {
</span><span class="lines">@@ -89,15 +152,38 @@
</span><span class="cx">     if { [llength $ilist] &gt; 1 } {
</span><span class="cx">         # set portname again since the one we were passed may not have had the correct case
</span><span class="cx">         set portname [[lindex $ilist 0] name]
</span><del>-        ui_msg &quot;$UI_PREFIX [msgcat::mc &quot;The following versions of $portname are currently installed:&quot;]&quot;
-        foreach i [portlist_sortint $ilist] {
</del><ins>+        set msg &quot;The following versions of $portname are currently installed:&quot;
+        if {[macports::ui_isset ports_noninteractive]} {
+            ui_msg &quot;$UI_PREFIX [msgcat::mc $msg]&quot;
+        }
+        set sortedlist [portlist_sortint $ilist]
+        foreach i $sortedlist {
</ins><span class="cx">             set ispec &quot;[$i version]_[$i revision][$i variants]&quot;
</span><del>-            if {[$i state] eq &quot;installed&quot;} {
-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s (active)&quot;] [$i name] $ispec]&quot;
</del><ins>+            ##
+            # User Interaction Question
+            # Asking choice to select option in case of ambiguous uninstall
+            if {[info exists macports::ui_options(questions_multichoice)]} {
+                if { [$i state] eq &quot;installed&quot; } {
+                    lappend portilist [$i name]@[$i version]_[$i revision][$i variants](active)
+                } else {
+                    lappend portilist [$i name]@[$i version]_[$i revision][$i variants]
+                }
</ins><span class="cx">             } else {
</span><del>-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s&quot;] [$i name] $ispec]&quot;
</del><ins>+                if {[$i state] eq &quot;installed&quot;} {
+                    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s (active)&quot;] [$i name] $ispec]&quot;
+                } else {
+                    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;    %s @%s&quot;] [$i name] $ispec]&quot;
+                }
</ins><span class="cx">             }
</span><span class="cx">         }
</span><ins>+        if {[info exists macports::ui_options(questions_multichoice)]} {
+            set retstring [$macports::ui_options(questions_multichoice) $msg &quot;Choice_Q2&quot; $portilist]
+            foreach index $retstring {
+                set uport [lindex $sortedlist [expr { $index - 1 }]]
+                uninstall [$uport name] [$uport version] [$uport revision] [$uport variants]
+            }
+            return 0
+        }
</ins><span class="cx">         throw registry::invalid &quot;Registry error: Please specify the full version as recorded in the port registry.&quot;
</span><span class="cx">     } elseif { [llength $ilist] == 1 } {
</span><span class="cx">         set port [lindex $ilist 0]
</span><span class="lines">@@ -112,6 +198,7 @@
</span><span class="cx">         throw registry::invalid &quot;Registry error: ${portname}${composite_spec} not registered as installed&quot;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    set userinput {}
</ins><span class="cx">     # uninstall dependents if requested
</span><span class="cx">     if {[info exists options(ports_uninstall_follow-dependents)] &amp;&amp; $options(ports_uninstall_follow-dependents) eq &quot;yes&quot;} {
</span><span class="cx">         # don't uninstall dependents' dependencies
</span><span class="lines">@@ -134,75 +221,34 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         # check its dependents
</span><del>-        registry::check_dependents $port ${uninstall.force} &quot;uninstall&quot;
</del><ins>+        set userinput [registry::check_dependents $port ${uninstall.force} &quot;uninstall&quot;]
+        if {$userinput eq &quot;quit&quot;} {
+            return 0
+        }
</ins><span class="cx">     }
</span><span class="cx">     # if it's active, deactivate it
</span><span class="cx">     if {[$port state] eq &quot;installed&quot;} {
</span><span class="cx">         if {[info exists options(ports_dryrun)] &amp;&amp; [string is true -strict $options(ports_dryrun)]} {
</span><span class="cx">             ui_msg &quot;For $portname @${composite_spec}: skipping deactivate (dry run)&quot;
</span><span class="cx">         } else {
</span><del>-            if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate $optionslist]} {
-                portimage::deactivate $portname $version $revision $variants [array get options]
</del><ins>+            if {$userinput eq &quot;forcedbyuser&quot;} {
+                set options(ports_nodepcheck) &quot;yes&quot;
</ins><span class="cx">             }
</span><ins>+            if {[info exists options(ports_uninstall_no-exec)] || ![registry::run_target $port deactivate [array get options]]} {
+                if {$userinput eq &quot;forcedbyuser&quot;} {
+                    portimage::deactivate $portname $version $revision $variants [array get options]
+                    unset options(ports_nodepcheck) 
+                } else {
+                    portimage::deactivate $portname $version $revision $variants [array get options]
+                }
+            }
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     set ref $port
</span><del>-
-    # note deps before we uninstall if we're going to uninstall them too
-    if {[info exists options(ports_uninstall_follow-dependencies)] &amp;&amp; [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
-        set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
-        set all_dependencies {}
-        # look up deps from the saved portfile if possible
-        if {![catch {set mport [mportopen_installed [$port name] [$port version] [$port revision] [$port variants] $optionslist]}]} {
-            array set depportinfo [mportinfo $mport]
-            mportclose $mport
-            foreach type $deptypes {
-                if {[info exists depportinfo($type)]} {
-                    foreach dep $depportinfo($type) {
-                        lappend all_dependencies [lindex [split $dep :] end]
-                    }
-                }
-            }
-            # append those from the registry (could be different because of path deps)
-            foreach dep [$port dependencies] {
-                lappend all_dependencies [$dep name]
-            }
-        } else {
-            # grab the deps from the dep map
-            set depmaplist [registry::list_depends $portname $version $revision $variants]
-            foreach dep $depmaplist {
-                lappend all_dependencies [lindex $dep 0]
-            }
-            # and the ones from the current portfile
-            if {![catch {mportlookup $portname} result] &amp;&amp; [llength $result] &gt;= 2} {
-                array set depportinfo [lindex $result 1]
-                set porturl $depportinfo(porturl)
-                set variations {}
-                set minusvariant [lrange [split [registry::property_retrieve $ref negated_variants] -] 1 end]
-                set plusvariant [lrange [split $variants +] 1 end]
-                foreach v $plusvariant {
-                    lappend variations $v &quot;+&quot;
-                }
-                foreach v $minusvariant {
-                    lappend variations $v &quot;-&quot;
-                }
-                if {![catch {set mport [mportopen $porturl [concat $optionslist subport $portname] [array get variations]]} result]} {
-                    array unset depportinfo
-                    array set depportinfo [mportinfo $mport]
-                    mportclose $mport
-                }
-                foreach type $deptypes {
-                    if {[info exists depportinfo($type)]} {
-                        foreach dep $depportinfo($type) {
-                            lappend all_dependencies [lindex [split $dep :] end]
-                        }
-                    }
-                }
-            }
-        }
-        array unset depportinfo
-        set all_dependencies [lsort -unique $all_dependencies]
</del><ins>+    # save list of dependencies if --follow-dependencies specified
+    if {[info exists options(ports_uninstall_follow-dependencies)]} {
+        set all_dependencies [registry_uninstall::generate_deplist $port $optionslist]
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if {[info exists options(ports_dryrun)] &amp;&amp; [string is true -strict $options(ports_dryrun)]} {
</span><span class="lines">@@ -250,43 +296,82 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    # uninstall dependencies if requested
</del><ins>+    set uports {}
+    # create list of all dependencies that will be uninstalled, if requested
</ins><span class="cx">     if {[info exists options(ports_uninstall_follow-dependencies)] &amp;&amp; [string is true -strict $options(ports_uninstall_follow-dependencies)]} {
</span><span class="cx">         # don't uninstall dependencies' dependents
</span><span class="cx">         if {[info exists options(ports_uninstall_follow-dependents)]} {
</span><span class="cx">             unset options(ports_uninstall_follow-dependents)
</span><span class="cx">             set optionslist [array get options]
</span><span class="cx">         }
</span><del>-        while 1 {
-            set remaining_list {}
-            foreach dep $all_dependencies {
-                if {![catch {set ilist [registry::installed $dep]}]} {
-                    set remaining 0
-                    foreach i $ilist {
-                        set iversion [lindex $i 1]
-                        set irevision [lindex $i 2]
-                        set ivariants [lindex $i 3]
-                        if {[llength [registry::list_dependents $dep $iversion $irevision $ivariants]] == 0} {
-                            set regref [registry::open_entry $dep $iversion $irevision $ivariants [lindex $i 5]]
-                            if {![registry::property_retrieve $regref requested] &amp;&amp; ([info exists options(ports_uninstall_no-exec)] || ![registry::run_target $regref uninstall $optionslist])} {
-                                registry_uninstall::uninstall $dep $iversion $irevision $ivariants $optionslist
</del><ins>+        set alldeps $all_dependencies
+        set portilist {}
+        for {set j 0} {$j &lt; [llength $alldeps]} {incr j} {
+            set dep [lindex $alldeps $j]
+            if {![catch {set ilist [registry::installed $dep]}]} {
+                foreach i $ilist {
+                    set dependents {}
+                    set iversion [lindex $i 1]
+                    set irevision [lindex $i 2]
+                    set ivariants [lindex $i 3]
+                    set dependentlist [registry::list_dependents $dep $iversion $irevision $ivariants]
+                    foreach depdt $dependentlist {
+                        lappend dependents [lindex $depdt 2]
+                    }
+                    set regref [registry::open_entry $dep $iversion $irevision $ivariants [lindex $i 5]]
+                    if {![registry::property_retrieve $regref requested]} {
+                        if {[llength $dependents] == 0} { 
+                            lappend uports $dep
+                            lappend portilist $dep@[lindex $i 1]_$irevision 
+                               } else {
+                            foreach depdt $dependents {
+                                set count 0
+                                foreach p $uports {
+                                    if {[string match $p $depdt]} {
+                                        incr count
+                                    }
+                                }
+                                if {$count == [llength $dependents]} {
+                                    lappend uports $dep
+                                    lappend portilist $dep@[lindex $i 1]_$irevision
+                                }
</ins><span class="cx">                             }
</span><del>-                        } else {
-                            set remaining 1
</del><span class="cx">                         }
</span><span class="cx">                     }
</span><del>-                    if {$remaining} {
-                        lappend remaining_list $dep
-                    }
</del><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            if {[llength $remaining_list] == 0 || [llength $remaining_list] == [llength $all_dependencies]} {
-                break
</del><ins>+            set depref [registry::entry imaged $dep]
+            set depdeps [registry_uninstall::generate_deplist $depref $optionslist]
+            foreach d $depdeps {
+                set index [lsearch $alldeps $d]
+                if {$index == -1} {
+                    lappend alldeps $d 
+                }
</ins><span class="cx">             }
</span><del>-            set all_dependencies $remaining_list
</del><span class="cx">         }
</span><ins>+        ## User Interaction Question
+        # show a list of all dependencies to be uninstalled with a timeout when --follow-dependencies is specified
+        if {[info exists macports::ui_options(questions_yesno)]} {
+            $macports::ui_options(questions_yesno) &quot;The following dependencies will be uninstalled:&quot; &quot;Timeout_1&quot; $portilist {y} 10
+        }
+        unset options(ports_uninstall_follow-dependencies)
</ins><span class="cx">     }
</span><del>-    
</del><ins>+
+    # uninstall all dependencies in order from uports
+    foreach dp $uports {
+        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_uninstall_no-exec)] || ![registry::run_target $regref uninstall [array get options]]} {
+                    registry_uninstall::uninstall $dp $iversion $irevision $ivariants [array get options]
+                }
+            }
+        }
+    }
+
</ins><span class="cx">     return 0
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbasesrcregistry20receipt_sqlitetcl"></a>
<div class="propset"><h4>Property changes: trunk/base/src/registry2.0/receipt_sqlite.tcl</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/src/registry1.0/receipt_sqlite.tcl:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/registry2.0/receipt_sqlite.tcl:106692-111324
</span><span class="cx">/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/registry2.0/receipt_sqlite.tcl:57889-64075
</span><span class="cx">/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
</span><span class="cx">/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692
</span><span class="cx">   + /branches/gsoc08-privileges/base/src/registry1.0/receipt_sqlite.tcl:37343-46937
</span><span class="cx">/branches/gsoc09-logging/base/src/registry1.0/receipt_sqlite.tcl:51231-60371
</span><span class="cx">/branches/gsoc11-rev-upgrade/base/src/registry2.0/receipt_sqlite.tcl:78828-88375
</span><span class="cx">/branches/gsoc13-tests/src/registry2.0/receipt_sqlite.tcl:106692-111324
</span><span class="cx">/branches/gsoc14-interactive/base/src/registry2.0/receipt_sqlite.tcl:119516-124240
</span><span class="cx">/branches/universal-sanity/base/src/registry1.0/receipt_sqlite.tcl:51872-52323
</span><span class="cx">/branches/variant-descs-14482/base/src/registry1.0/receipt_sqlite.tcl:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
</span><span class="cx">/trunk/base/src/registry2.0/receipt_sqlite.tcl:57889-64075
</span><span class="cx">/users/perry/base-bugs_and_notes/src/registry1.0/receipt_sqlite.tcl:45682-46060
</span><span class="cx">/users/perry/base-select/src/registry1.0/receipt_sqlite.tcl:44044-44692
</span><a id="trunkbasesrcregistry20registry_utiltcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/registry2.0/registry_util.tcl (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/registry2.0/registry_util.tcl        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/src/registry2.0/registry_util.tcl        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -77,12 +77,29 @@
</span><span class="cx">             set deplist $active_deplist
</span><span class="cx">         }
</span><span class="cx">         if { [llength $deplist] &gt; 0 } {
</span><del>-            ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Unable to %s %s @%s_%s%s, the following ports depend on it:&quot;] $action [$port name] [$port version] [$port revision] [$port variants]]&quot;
-            foreach depport $deplist {
-                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;        %s @%s_%s%s&quot;] [$depport name] [$depport version] [$depport revision] [$depport variants]]&quot;
</del><ins>+            ## User Interaction Question
+            # ask if user wants to uninstall a port and thereby break its dependents
+            if {[info exists macports::ui_options(questions_yesno)] &amp;&amp; ![string is true -strict $force]} { 
+                set portulist {}
+                foreach depport $deplist {
+                    lappend portulist [$depport name]@[$depport version]_[$depport revision]
+                }
+                ui_msg &quot;Note: It is not recommended to uninstall/deactivate a port that has dependents as it breaks the dependents.&quot;
+                set retvalue [$macports::ui_options(questions_yesno) &quot;The following ports will break:&quot; &quot;breakDeps&quot; $portulist {n} 0]
+                if {$retvalue == 0} {
+                    set force &quot;yes&quot;
+                } else {
+                    return quit
+                }
+            } else {        
+                ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;Unable to %s %s @%s_%s%s, the following ports depend on it:&quot;] $action [$port name] [$port version] [$port revision] [$port variants]]&quot;
+                foreach depport $deplist {
+                    ui_msg &quot;$UI_PREFIX [format [msgcat::mc &quot;        %s @%s_%s%s&quot;] [$depport name] [$depport version] [$depport revision] [$depport variants]]&quot;
+                }
</ins><span class="cx">             }
</span><span class="cx">             if { [string is true -strict $force] } {
</span><span class="cx">                 ui_warn &quot;[string totitle $action] forced.  Proceeding despite dependencies.&quot;
</span><ins>+                return forcedbyuser
</ins><span class="cx">             } else {
</span><span class="cx">                 throw registry::uninstall-error &quot;Please uninstall the ports that depend on [$port name] first.&quot;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkbaseteststestlibrarytclin"></a>
<div class="modfile"><h4>Modified: trunk/base/tests/test/library.tcl.in (124242 => 124243)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/tests/test/library.tcl.in        2014-08-21 18:07:56 UTC (rev 124242)
+++ trunk/base/tests/test/library.tcl.in        2014-08-21 18:36:26 UTC (rev 124243)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     set back [pwd]
</span><span class="cx">     cd $pwd
</span><span class="cx"> 
</span><del>-    set result [catch {exec env PORTSRC=${portsrc} ${bindir}/port -d test &gt;&amp;output} ]
</del><ins>+    set result [catch {exec env PORTSRC=${portsrc} ${bindir}/port -d -N test &gt;&amp;output} ]
</ins><span class="cx">     cd $back
</span><span class="cx">     return $result
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>