<!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>[129015] trunk/base/src/macports1.0/reclaim.tcl</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/129015">129015</a></dd>
<dt>Author</dt> <dd>ryandesign@macports.org</dd>
<dt>Date</dt> <dd>2014-12-03 04:49:15 -0800 (Wed, 03 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>reclaim.tcl: more &quot;app&quot; to &quot;port&quot; changes; fix typos</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbasesrcmacports10reclaimtcl">trunk/base/src/macports1.0/reclaim.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbasesrcmacports10reclaimtcl"></a>
<div class="modfile"><h4>Modified: trunk/base/src/macports1.0/reclaim.tcl (129014 => 129015)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/base/src/macports1.0/reclaim.tcl        2014-12-03 09:46:17 UTC (rev 129014)
+++ trunk/base/src/macports1.0/reclaim.tcl        2014-12-03 12:49:15 UTC (rev 129015)
</span><span class="lines">@@ -40,12 +40,12 @@
</span><span class="cx"> # Catch some error-prone areas.
</span><span class="cx"> # Remove the useless/structure comments and add actual docstrings.
</span><span class="cx"> # Add copyright notice
</span><del>-# Check if inactive files are dependents for other files. 
</del><ins>+# Check if inactive files are dependents of other files.
</ins><span class="cx"> # Add test cases
</span><span class="cx"> # Add distfile version checking.
</span><span class="cx"> # Pretty sure we should be using ui_msg, instead of puts and what not. Should probably add that.
</span><span class="cx"> # Register the &quot;port cleanup&quot; command with port.tcl and all that involves.
</span><del>-# Implement a hash-map, or multidimensional array for ease of app info keeping. Write it yourself if you have to.
</del><ins>+# Implement a hash-map, or multidimensional array for ease of port info keeping. Write it yourself if you have to.
</ins><span class="cx"> # Figure out what the hell is going on with &quot;port clean all&quot; vs &quot;port clean installed&quot; the 'clean' target is provided by this package
</span><span class="cx"> 
</span><span class="cx"> # XXX: all prompts for the user need to use the ui_ask_* API
</span><span class="lines">@@ -271,31 +271,31 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    proc is_inactive {app} {
</del><ins>+    proc is_inactive {port} {
</ins><span class="cx"> 
</span><del>-        # Determine's whether an port is inactive or not.
</del><ins>+        # Determines whether a port is inactive or not.
</ins><span class="cx">         # Args: 
</span><del>-        #           app - An array where the fourth item in it is the activity of the port.
</del><ins>+        #           port - An array where the fourth item in it is the activity of the port.
</ins><span class="cx">         # Returns:
</span><span class="cx">         #           1 if inactive, 0 if active.
</span><span class="cx"> 
</span><del>-        if {[lindex $app 4] == 0} {
-            ui_debug &quot;App, [lindex $app 0], is inactive.&quot;
</del><ins>+        if {[lindex $port 4] == 0} {
+            ui_debug &quot;Port [lindex $port 0] is inactive.&quot;
</ins><span class="cx">             return 1
</span><span class="cx">         }
</span><del>-        ui_debug &quot;App, [lindex $app 0], is not inactive.&quot;
</del><ins>+        ui_debug &quot;Port [lindex $port 0] is not inactive.&quot;
</ins><span class="cx">         return 0
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     proc get_info {} {
</span><span class="cx"> 
</span><del>-        # Get's the information of all installed appliations (those returned by registry::installed), and returns it in a
</del><ins>+        # Gets the information of all installed ports (those returned by registry::installed), and returns it in a
</ins><span class="cx">         # multidimensional list.
</span><span class="cx">         #
</span><span class="cx">         # Args:
</span><span class="cx">         #           None
</span><span class="cx">         # Returns:
</span><del>-        #           A multidimensional list where each app is a sublist, i.e., [{First Application Info} {Second Application Info} {...}]
</del><ins>+        #           A multidimensional list where each port is a sublist, i.e., [{first port info} {second port info} {...}]
</ins><span class="cx">         #           Indexes of each sublist are: 0 = name, 1 = version, 2 = revision, 3 = variants, 4 = activity, and 5 = epoch.
</span><span class="cx">         
</span><span class="cx">         if {[catch {set installed [registry::installed]} result]} {
</span><span class="lines">@@ -325,7 +325,7 @@
</span><span class="cx"> 
</span><span class="cx">     proc check_last_run {} {
</span><span class="cx"> 
</span><del>-        # Periodically warn's the user that they haven't run 'port reclaim' in two weeks, and that they should consider doing so.
</del><ins>+        # Periodically warns the user that they haven't run 'port reclaim' in two weeks, and that they should consider doing so.
</ins><span class="cx">         # 
</span><span class="cx">         # Args:
</span><span class="cx">         #           None
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx"> 
</span><span class="cx">             if {$time ne &quot;&quot;} {
</span><span class="cx">                 if {[clock seconds] - $time &gt; 1209600} {
</span><del>-                    ui_warn &quot;you haven't run 'port reclaim' in two weeks. It's recommended you run this once every two weeks to help save space on your computer.&quot;
</del><ins>+                    ui_warn &quot;You haven't run 'port reclaim' in two weeks. It's recommended you run this every two weeks to reclaim disk space.&quot;
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -388,15 +388,15 @@
</span><span class="cx"> 
</span><span class="cx">                 ui_debug &quot;Iterating through all inactive ports... again.&quot;
</span><span class="cx"> 
</span><del>-                foreach app $inactive_ports {
-                    set name [lindex $app 0]
</del><ins>+                foreach port $inactive_ports {
+                    set name [lindex $port 0]
</ins><span class="cx"> 
</span><del>-                    # Get all dependents for the current port
</del><ins>+                    # Get all dependents of the current port
</ins><span class="cx">                     if {[catch {set dependents [registry::list_dependents $name [lindex 1] [lindex 2] [lindex 3]]} error]} {
</span><del>-                        ui_error &quot;something went wrong when trying to enumerate all dependents for $name&quot;
</del><ins>+                        ui_error &quot;something went wrong when trying to enumerate all dependents of $name&quot;
</ins><span class="cx">                     }
</span><span class="cx">                     if {${dependents} ne &quot;&quot;} {
</span><del>-                        ui_warn &quot;the following port $name is a dependent for $dependents. Do you want to uninstall this port with the risk of breaking other ports? \[Y/n\]&quot;
</del><ins>+                        ui_warn &quot;Port $name is a dependent of $dependents. Do you want to uninstall this port at the risk of breaking other ports? \[Y/n\]&quot;
</ins><span class="cx"> 
</span><span class="cx">                         set input [gets stdin]
</span><span class="cx">                         if { $input eq &quot;N&quot; || &quot;n&quot; } {
</span><span class="lines">@@ -407,7 +407,7 @@
</span><span class="cx">                     ui_msg &quot;Uninstalling: $name&quot;
</span><span class="cx"> 
</span><span class="cx">                     # Note: 'uninstall' takes a name, version, revision, variants and an options list. 
</span><del>-                    if {[catch {registry_uninstall::uninstall $name [lindex $app 1] [lindex $app 2] [lindex $app 3] {}} error]} {
</del><ins>+                    if {[catch {registry_uninstall::uninstall $name [lindex $port 1] [lindex $port 2] [lindex $port 3] {}} error]} {
</ins><span class="cx">                         ui_error &quot;something went wrong when uninstalling $name&quot;
</span><span class="cx">                     }
</span><span class="cx">                 }
</span></span></pre>
</div>
</div>

</body>
</html>