<!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 "SYNOPSIS"
</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 \&...] \&... [option=value \&...]]
</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] > 0} {
</span><del>- set depstring "$macports::ui_prefix Dependencies to be installed:"
- foreach ditem $dlist {
- append depstring " [ditem_key $ditem provides]"
</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) "The following dependencies will be installed: " "TestCase#2" [lsort $deplist] {y} 0]
+ if {$retvalue == 1} {
+ return 0
+ }
+ } else {
+ set depstring "$macports::ui_prefix Dependencies to be installed:"
+ foreach ditem $dlist {
+ append depstring " [ditem_key $ditem provides]"
+ }
+ 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 "$macports::ui_prefix Rebuilding in order"
</del><ins>+ set broken_portnames {}
+ if {![info exists macports::ui_options(questions_yesno)]} {
+ ui_msg "$macports::ui_prefix Rebuilding in order"
+ }
</ins><span class="cx"> foreach port $topsort_ports {
</span><del>- ui_msg " [$port name] @[$port version] [$port variants][$port negated_variants]"
</del><ins>+ lappend broken_portnames [$port name]@[$port version][$port variants]
+ if {![info exists macports::ui_options(questions_yesno)]} {
+ ui_msg " [$port name] @[$port version] [$port variants][$port negated_variants]"
+ }
</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 "You can always run 'port rev-upgrade' again to fix errors."
+ set retvalue [$macports::ui_options(questions_yesno) "The following ports will be rebuilt:" "TestCase#1" $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 "The following versions of $portname are currently installed:"
</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 >= 0} {
+                        if {[catch {set inp [read stdin]} err]} {
+                                return -code error "Ctrl-C"
+                        }
+                        if {$inp eq "\n"} {
+                                return $def
+                        }
+                        puts -nonewline "\r"
+                        puts -nonewline [format "Continuing in %02d s. Press Ctrl-C to exit: " $timeout]
+                        flush stdout
+                        after 1000
+                        incr timeout -1
+                }
+                puts ""
+                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 " $i) "
+                        puts [string map {@ " @" ( " ("} $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 " "
+                
+                # Print portname or port list suitably
+                if {[llength $ports] == 1} {
+                        puts -nonewline " "
+                        puts [string map {@ " @"} $ports]
+                } else {
+                        puts ""
+                        foreach port $ports {
+                                puts -nonewline $leftmargin
+                                puts [string map {@ " @"} $port]
+                        }
+                }
+                
+                # Check if timeout is set or not
+                if {$timeout > 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 "Continue? \[Y/n\]: "
+                        flush stdout
+                } else {
+                        puts -nonewline "Continue? \[y/N\]: "
+                        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 "Ctrl-C"
+                        }
+                        signal -restart error {TERM INT}
+                        if {$input in {y Y}} {
+                                return 0
+                        } elseif {$input in {n N}} {
+                                return 1
+                        } elseif {$input == ""} {
+                                return $default
+                        } else {
+                                puts "Please enter either 'y' or 'n'."
+                        }
+                }
+        }
+        
+        ##
+        # 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 "Enter a number to select an option: "
+                        flush stdout
+                        signal error {TERM INT}
+                        if {[catch {set input [gets stdin]} err]} {
+                                return -code error "Ctrl-C"
+                        }
+                        signal -restart error {TERM INT}
+                        if {($input <= [llength $ports] && [string is integer -strict $input])} {
+                                return $input
+                        } else {
+                                puts "Please enter an index from the above list."
+                        }
+                }
+        }
+        
+        ##
+        # 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 "Enter the numbers to select the options: "
+                        flush stdout
+                        signal error {TERM INT}
+                        if {[catch {set input [gets stdin]} err]} {
+                                return -code error "Ctrl-C"
+                        }
+                        signal -restart error {TERM INT}
+                        set count 0
+                        # check if input is non-empty and otherwise fine
+                        if {$input == ""} {
+                                continue
+                        }
+                        foreach num $input {
+                                if {($num <= [llength $ports] && [string is integer -strict $num])} {
+                                        incr count
+                                } else {
+                                        puts "Please enter numbers separated by a space which are indices from the above list."
+                                        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]
+        && [isatty stdout]
+        && (![info exists ui_options(ports_quiet)] || $ui_options(ports_quiet) ne "yes")
+        && (![info exists ui_options(ports_noninteractive)] || $ui_options(ports_noninteractive) ne "yes")} {
+        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 "Active version of $name is not $v but ${specifier}."
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $specifier]"
-
</del><span class="cx"> if { [$requested installtype] ne "image" } {
</span><span class="cx"> return -code error "Image error: ${name} @${specifier} not installed as an image."
</span><span class="cx"> }
</span><span class="lines">@@ -194,11 +192,16 @@
</span><span class="cx"> if { [$requested state] ne "installed" } {
</span><span class="cx"> return -code error "Image error: ${name} @${specifier} is not active."
</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 "deactivate"
</del><ins>+ set retvalue [registry::check_dependents $requested $force "deactivate"]
+ if {$retvalue eq "quit"} {
+ return
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ ui_msg "$UI_PREFIX [format [msgcat::mc "Deactivating %s @%s"] $name $specifier]"
+        
</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] > 1 } {
</span><del>- ui_msg "$UI_PREFIX [msgcat::mc "The following versions of $name are currently installed:"]"
</del><ins>+ set portilist {}
+ set msg "The following versions of $name are currently installed:"
+ if {[macports::ui_isset ports_noninteractive]} {
+ ui_msg "$UI_PREFIX [msgcat::mc $msg]"
+ }
</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 "installed" } {
- ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
</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 "installed" } {
+ lappend portilist $iname@${iversion}_${irevision}${ivariants}(active)
+ } else {
+ lappend portilist $iname@${iversion}_${irevision}${ivariants}
+ }
</ins><span class="cx"> } else {
</span><del>- ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
</del><ins>+ if { [$i state] eq "installed" } {
+ ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s_%s%s (active)"] $iname $iversion $irevision $ivariants]"
+ } else {
+ ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s_%s%s"] $iname $iversion $irevision $ivariants]"
+ }
</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 "Choice_Q1" $portilist]
+ set index [expr { $retvalue - 1 }]
+ return [lindex $ilist $index]
+ }
</ins><span class="cx"> throw registry::invalid "Registry error: Please specify the full version as recorded in the port registry."
</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 ""}} {
+ 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)] && [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] && [llength $result] >= 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 "+"
+ }
+ foreach v $minusvariant {
+ lappend variations $v "-"
+                         }
+ 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 ""} {optionslist ""}} {
</span><span class="cx"> if {$v eq ""} {
</span><span class="lines">@@ -89,15 +152,38 @@
</span><span class="cx"> if { [llength $ilist] > 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 "$UI_PREFIX [msgcat::mc "The following versions of $portname are currently installed:"]"
- foreach i [portlist_sortint $ilist] {
</del><ins>+ set msg "The following versions of $portname are currently installed:"
+ if {[macports::ui_isset ports_noninteractive]} {
+ ui_msg "$UI_PREFIX [msgcat::mc $msg]"
+ }
+ set sortedlist [portlist_sortint $ilist]
+ foreach i $sortedlist {
</ins><span class="cx"> set ispec "[$i version]_[$i revision][$i variants]"
</span><del>- if {[$i state] eq "installed"} {
- ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s (active)"] [$i name] $ispec]"
</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 "installed" } {
+ 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 "$UI_PREFIX [format [msgcat::mc " %s @%s"] [$i name] $ispec]"
</del><ins>+ if {[$i state] eq "installed"} {
+ ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s (active)"] [$i name] $ispec]"
+ } else {
+ ui_msg "$UI_PREFIX [format [msgcat::mc " %s @%s"] [$i name] $ispec]"
+ }
</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 "Choice_Q2" $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 "Registry error: Please specify the full version as recorded in the port registry."
</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 "Registry error: ${portname}${composite_spec} not registered as installed"
</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)] && $options(ports_uninstall_follow-dependents) eq "yes"} {
</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} "uninstall"
</del><ins>+ set userinput [registry::check_dependents $port ${uninstall.force} "uninstall"]
+ if {$userinput eq "quit"} {
+ return 0
+ }
</ins><span class="cx"> }
</span><span class="cx"> # if it's active, deactivate it
</span><span class="cx"> if {[$port state] eq "installed"} {
</span><span class="cx"> if {[info exists options(ports_dryrun)] && [string is true -strict $options(ports_dryrun)]} {
</span><span class="cx"> ui_msg "For $portname @${composite_spec}: skipping deactivate (dry run)"
</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 "forcedbyuser"} {
+ set options(ports_nodepcheck) "yes"
</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 "forcedbyuser"} {
+ 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)] && [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] && [llength $result] >= 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 "+"
- }
- foreach v $minusvariant {
- lappend variations $v "-"
- }
- 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)] && [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)] && [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] && ([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 < [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) "The following dependencies will be uninstalled:" "Timeout_1" $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] > 0 } {
</span><del>- ui_msg "$UI_PREFIX [format [msgcat::mc "Unable to %s %s @%s_%s%s, the following ports depend on it:"] $action [$port name] [$port version] [$port revision] [$port variants]]"
- foreach depport $deplist {
- ui_msg "$UI_PREFIX [format [msgcat::mc "        %s @%s_%s%s"] [$depport name] [$depport version] [$depport revision] [$depport variants]]"
</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)] && ![string is true -strict $force]} {
+ set portulist {}
+ foreach depport $deplist {
+ lappend portulist [$depport name]@[$depport version]_[$depport revision]
+ }
+ ui_msg "Note: It is not recommended to uninstall/deactivate a port that has dependents as it breaks the dependents."
+ set retvalue [$macports::ui_options(questions_yesno) "The following ports will break:" "breakDeps" $portulist {n} 0]
+ if {$retvalue == 0} {
+ set force "yes"
+ } else {
+ return quit
+ }
+ } else {        
+ ui_msg "$UI_PREFIX [format [msgcat::mc "Unable to %s %s @%s_%s%s, the following ports depend on it:"] $action [$port name] [$port version] [$port revision] [$port variants]]"
+ foreach depport $deplist {
+ ui_msg "$UI_PREFIX [format [msgcat::mc "        %s @%s_%s%s"] [$depport name] [$depport version] [$depport revision] [$depport variants]]"
+ }
</ins><span class="cx"> }
</span><span class="cx"> if { [string is true -strict $force] } {
</span><span class="cx"> ui_warn "[string totitle $action] forced. Proceeding despite dependencies."
</span><ins>+ return forcedbyuser
</ins><span class="cx"> } else {
</span><span class="cx"> throw registry::uninstall-error "Please uninstall the ports that depend on [$port name] first."
</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 >&output} ]
</del><ins>+ set result [catch {exec env PORTSRC=${portsrc} ${bindir}/port -d -N test >&output} ]
</ins><span class="cx"> cd $back
</span><span class="cx"> return $result
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>