<!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>[123744] branches/gsoc14-cleanup/src</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/123744">123744</a></dd>
<dt>Author</dt> <dd>ksammons@macports.org</dd>
<dt>Date</dt> <dd>2014-08-13 15:08:44 -0700 (Wed, 13 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reset the files</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesgsoc14cleanupsrcmacports10macportstcl">branches/gsoc14-cleanup/src/macports1.0/macports.tcl</a></li>
<li><a href="#branchesgsoc14cleanupsrcportporttcl">branches/gsoc14-cleanup/src/port/port.tcl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchesgsoc14cleanupsrcmacports10doctortcl">branches/gsoc14-cleanup/src/macports1.0/doctor.tcl</a></li>
<li><a href="#branchesgsoc14cleanupsrcmacports10reclaimtcl">branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesgsoc14cleanupsrcmacports10doctortcl"></a>
<div class="addfile"><h4>Added: branches/gsoc14-cleanup/src/macports1.0/doctor.tcl (0 => 123744)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/macports1.0/doctor.tcl                                (rev 0)
+++ branches/gsoc14-cleanup/src/macports1.0/doctor.tcl        2014-08-13 22:08:44 UTC (rev 123744)
</span><span class="lines">@@ -0,0 +1,715 @@
</span><ins>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# doctor.tcl
+# $Id: doctor.tcl 119177 2014-04-18 22:35:29Z cal@macports.org $
+#
+# Copyright (c) 2002 - 2003 Apple Inc.
+# Copyright (c) 2004 - 2005 Paul Guyot, &lt;pguyot@kallisys.net&gt;.
+# Copyright (c) 2004 - 2006 Ole Guldberg Jensen &lt;olegb@opendarwin.org&gt;.
+# Copyright (c) 2004 - 2005 Robert Shaw &lt;rshaw@opendarwin.org&gt;
+# Copyright (c) 2004 - 2014 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Todo:
+
+# Done:
+# Add -q for quiet mode, where we don't print anything
+# Check for command line tools
+# Check for any DYLD_* environmental variables
+# Check for '.la' in dylib and '.prl'
+# Check if installed files are readable 
+# Check for sqlite
+# Check for openssl
+# Crowd-source more ideas from the mailing-list
+# Check if $PATH is first
+# Check for issues with compilation. Compile small, simple file, check for &quot;couldn't create cache file&quot;
+# check_for_stray_developer_directory
+# Check for *.h, *.hpp, *.hxx in /usr/local/include
+# Check for *.dylib in /usr/local/lib
+# Check for other package managers. Fink = /sw, homebrew = /usr/local/Cellar
+# Check for all files installed by ports exists
+# Check for archives from all ports exists
+# Check for things in /usr/local
+# Check for x11.app if the OS is 10.6 and suggest installing xorg-server or the site on macosforge
+# Add error catching for line's without an equals sign. 
+# Support comments for the parser
+# Check for amount of drive space
+# Move port_doctor.ini to the port tree, below _resources 
+# Check for curl
+# Check for rsync
+# Check if macports is in /opt/local
+
+
+package provide doctor 1.0 
+
+package require macports
+package require reclaim 1.0
+
+namespace eval doctor {
+
+    # Command line argument that determines whether or not to output things fancily. 
+    variable quiet 0
+    
+    proc main {opts} {
+        
+        # The main function. Handles all the calls to the correct functions, and sets the config_options array, 
+        # as well as the parser_options array.
+        #
+        # Args:
+        #           opts - The options passed in. Currently the only option availible is 'quiet'. 
+        # Returns:
+        #           None
+
+        # Setting the 'quiet' variable based on what was passed in.
+        if {$opts ne &quot;&quot;} {
+            set doctor::quiet 1
+        } else {
+            set doctor::quiet 0
+        }
+
+        array set config_options    [list]
+        set parser_options          {&quot;macports_location&quot; &quot;profile_path&quot; &quot;shell_location&quot; &quot;xcode_version_10.9&quot; &quot;xcode_version_10.8&quot; \
+                                    &quot;xcode_version_10.7&quot; &quot;xcode_version_10.6&quot; &quot;xcode_version_10.7&quot; &quot;xcode_version_10.6&quot; &quot;xcode_version_10.5&quot; \
+                                    &quot;xcode_version_10.4&quot; &quot;xcode_build&quot;}
+
+        set user_config_path        ${macports::portdbpath}/port_doctor.ini
+        set xcode_config_path       ${macports::portdbpath}/sources/rsync.macports.org/release/tarballs/ports/_resources/xcode_versions.ini
+
+        # Make sure at least a default copy of the xcode and user config exist
+        make_xcode_config
+        make_user_config
+
+        # Read the config files
+        get_config config_options $parser_options $user_config_path 
+        get_config config_options $parser_options $xcode_config_path 
+
+        # Start the checks
+        check_path $config_options(macports_location) $config_options(profile_path) $config_options(shell_location)
+        check_xcode config_options
+        check_for_app curl
+        check_for_app rsync
+        check_for_app openssl
+        check_for_app sqlite3
+        check_macports_location
+        check_free_space
+        check_for_x11
+        check_for_files_in_usr_local 
+        check_tarballs 
+        check_port_files 
+        check_for_package_managers
+        check_for_stray_developer_directory
+        check_compilation_error_cache
+        check_for_dyld
+        check_for_clt
+    }
+
+    proc check_for_clt {} {
+
+        # Checks to see if the Xcode Command Line Tools are installed by checking if the file
+        # /Library/Developer/CommandLineTools exists if the system is running 10.9, or if they're
+        # running an older version, if the command xcode-select -p outputs something.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;command line tools&quot;
+
+        set version ${macports::macosx_version}
+
+        if {$version == 10.9} {
+
+            if {![file exists &quot;/Library/Developer/CommandLineTools/&quot;]} {
+
+                ui_warn &quot;Xcode Command Line Tools are not installed! To install them, please enter the command:
+                                    xcode-select --install&quot;
+                success_fail 0
+                return
+            }
+            success_fail 1
+            return
+
+        } else {
+
+            set xcode_select [exec xcode-select -p]
+
+            if {$xcode_select eq &quot;&quot;} {
+
+                ui_warn &quot;Xcode Command Line Tools are not installed! To install them, please enter the command:
+                                    xcode-selct --install&quot;
+                success_fail 0
+                return
+            }
+            success_fail 1
+        }
+    }
+
+    proc check_for_dyld {} {
+
+        # Checks to see if the current MacPorts session is running with a DYLD_* environmental 
+        # variable set.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;DYLD_* environmental variables&quot;
+
+        set printenv        [exec printenv]
+        set split           [split $printenv]
+
+        if {[regexp {DYLD_.} $split]} {
+            ui_warn &quot;found a DYLD_* environmental variable. These are known to cause issues with MacPorts. Please\
+                     unset the variable for the duration MacPorts is running.&quot;
+
+            success_fail 0
+            return
+        }
+
+        success_fail 1
+   }
+
+    proc output {string} {
+        
+        # Outputs the given string formatted correctly.
+        #
+        # Args:
+        #           string - The string to be output 
+        # Returns:
+        #           None
+
+        if {${doctor::quiet} eq 0} {
+            ui_msg -nonewline &quot;Checking for $string... &quot;
+        }
+    }
+
+    proc success_fail {result} {
+
+        # Either outputs a [SUCCESS] or [FAILED], depending on the result.
+        #
+        # Args:
+        #           result - An integer value. 1 = [SUCCESS], anything else = [FAILED]
+        # Returns:
+        #           None
+
+        if {${doctor::quiet} eq 0} {
+
+            if {$result == 1} {
+
+                ui_msg &quot;\[SUCCESS\]&quot;
+                return
+            }
+
+            ui_msg &quot;\[FAILED\]&quot;
+        }
+    }
+
+    proc check_compilation_error_cache {} {
+
+        # Checks to see if the compiler can compile properly, or it throws the error, &quot;couldn't create cache file&quot;.
+        #
+        # Args: 
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;compilation errors&quot;
+
+        set filename    &quot;test.c&quot;
+        set fd          [open $filename w]
+        
+        puts $fd &quot;int main() { return 0; }&quot;
+        close $fd
+
+        set output      [exec clang $filename -o main_test]
+
+        file delete $filename
+        file delete &quot;main_test&quot;
+
+        if {&quot;couldn't create cache file&quot; in $output} {
+            ui_warn &quot;found errors when attempting to compile file. To fix this issue, delete your tmp folder using:
+                       rm -rf \$TMPDIR&quot;
+            success_fail 0 
+            return
+        }
+
+        success_fail 1 
+       
+    }
+
+    proc check_for_stray_developer_directory {} {
+
+        # Checks to see if the script to remove leftover files from Xcode has been run or not. Implementation heavily influenced
+        # by Homebrew implementation. 
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;stray developer directory&quot;
+        
+        set uninstaller &quot;/Developer/Library/uninstall-developer-folder&quot;
+        
+        if {${macports::xcodeversion} &gt;= 4.3 &amp;&amp; [file exists $uninstaller]} { 
+            ui_warn &quot;you have leftover files from an older version of Xcode. You should delete them by using, $uninstaller&quot;
+
+            success_fail 0 
+            return
+        } 
+
+        success_fail 1 
+    }
+
+    proc check_for_package_managers {} {
+
+        # Checks to see if either Fink or Homebrew are installed on the system. If they are, it warns them and suggest they uninstall
+        # or move them to a different location.
+        # 
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;HomeBrew&quot;
+        
+        if {[file exists &quot;/usr/local/Cellar&quot;]} {
+            ui_warn &quot;it seems you have Homebrew installed on this system -- Because Homebrew uses /usr/local, this can potentially cause issues \
+                     with MacPorts. We'd recommend you either uninstall it, or move it from /usr/local for now.&quot;
+
+            success_fail 0
+
+        } else {
+
+            success_fail 1
+        }
+
+        output &quot;Fink&quot;
+        if {[file exists &quot;/sf&quot;]} {
+            ui_warn &quot;it seems you have Fink installed on your system -- This could potentially cause issues with MacPorts. We'd recommend you'd \
+                     either uninstall it, or move it from /sf for now.&quot;
+
+            success_fail 0

+        } else {
+
+            success_fail 1
+        }
+    }
+
+    proc check_port_files {} {
+        
+        # Checks to see if each file installed by all active and installed ports actually exists on the filesystem. If not, it warns
+        # the user and suggests the user deactivate and reactivate the port.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+
+        set apps [reclaim::get_info]
+
+        foreach app $apps {
+
+            
+            set name    [lindex $app 0]
+            set active  [lindex $app 4]
+            set files   [registry::port_registered $name]
+
+            if {$active} { 
+
+                foreach file $files {
+
+                    output &quot;file '$file' on disk&quot;
+                    
+                    if {![file exists $file]} {
+                        success_fail 0
+                        ui_warn &quot;couldn't find file '$file' for port '$name'. Please deactivate and reactivate the port to fix this issue.&quot;
+
+                    } elseif {![file readable $file]} {
+                        success_fail 0
+                        ui_warn &quot;'$file' installed by port '$name' is currently not readable. Please try again. If this problem persists, please contact\
+                                 the mailing list.&quot;
+
+                    } else {
+
+                        success_fail 1
+                    }
+                }
+            }
+        }
+
+    } 
+
+    proc check_tarballs {} {
+
+        # Checks if the archives for each installed port in /opt/local/var/macports/software/$name is actually in there. If not, it warns
+        # the user and suggest a reinstallation of the port. 
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        set apps [reclaim::get_info]
+
+        foreach app $apps {
+
+            output &quot;'$app's tarball on disk&quot;
+
+            set name        [lindex $app 0]
+            set version     [lindex $app 1]
+            set revision    [lindex $app 2]
+            set variants    [lindex $app 3]
+            set epoch       [lindex $app 5]
+
+            set ref         [registry::open_entry $name $version $revision $variants $epoch]
+            set image_dir   [registry::property_retrieve $ref location]
+
+            if {![file exists $image_dir]} {
+                ui_warn &quot;couldn't find the archive for '$name'. Please uninstall and reinstall this application.&quot;
+                success_fail 0
+            } else {
+                success_fail 1
+            }
+        }
+    }
+
+    proc check_for_files_in_usr_local {} {
+
+        # Checks for dylibs in /usr/local/lib and header files in /usr/local/include, and warns the user about said files if they 
+        # are found.
+        # 
+        # Args:
+        #           None 
+        # Returns:
+        #           None
+
+        output &quot;dylibs in /usr/local/lib&quot;
+
+        if {[glob -nocomplain -directory &quot;/usr/local/lib&quot; *.dylib *.la *.prl] ne &quot;&quot;} {
+            ui_warn &quot;found dylib's in your /usr/local/lib directory. These are known to cause problems. We'd recommend \
+                     you remove them.&quot;
+
+            success_fail 0
+
+        } else {
+
+            success_fail 1
+        }
+
+        output &quot;header files in /usr/local/include&quot;
+
+        if {[glob -nocomplain -directory &quot;/usr/local/include&quot; *.h *.hpp *.hxx] ne &quot;&quot;} {
+            ui_warn &quot;found header files in your /usr/local/include directory. These are known to cause problems. We'd recommend \
+                     you remove them.&quot;
+
+            success_fail 0
+
+        } else {
+
+            success_fail 1
+        }
+    }
+
+    proc check_for_x11 {} {
+
+        # Checks to see if the user is using the X11.app, and if they're on 10.6. If they are, it alerts them about it.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;X11.app on OS X 10.6 systems&quot;
+
+        set mac_version ${macports::macosx_version}
+
+        if {$mac_version == 10.6} {
+
+            if {[file exists /Applications/X11.app]} {
+                ui_error &quot;it seems you have Mac OSX 10.6 installed, and are using X11 from \&quot;X11.app\&quot;. This has been known to cause issues. \
+                         To fix this, please install xorg-server, by using the command 'sudo port install xorg-server', or installing it from \
+                         their website, http://xquartz.macosforge.org/trac/wiki/Releases.&quot;
+
+                success_fail 0
+                return
+            }
+        }
+
+        success_fail 1
+    }
+
+    proc check_free_space {} {
+
+        # Checks to see if the user has less than 5 gigs of space left, and warns if they don't.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;free disk space&quot;
+
+        set output          [exec df -g]
+        set tokens          [split $output \n]
+        set disk_info       [lindex $tokens 1]
+        set availible       [lindex $disk_info 3]
+
+        if {$availible &lt; 5} {
+            ui_warn &quot;you have less than 5 gigabytes free on your machine! This can cause serious errors. We recommend trying to clear out unnecessary \
+                     programs and files by running 'sudo port reclaim', or manually uninstalling/deleting programs and folders on your drive.&quot;
+
+            success_fail 0
+            return
+        }
+
+        success_fail 1
+    }
+
+    proc check_macports_location {} {
+
+        # Checks to see if port is where it should be. If it isn't, freak the frick out.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        output &quot;MacPort's location&quot;
+
+        if {[file exists ${macports::prefix}/bin/port] == 0} {
+            ui_error &quot;port was not in ${macports::prefix}/bin. This can potentially cause errors. It's recommended you move it back to ${macports::prefix}/bin.&quot;
+            success_fail 0
+            return
+        }
+
+        success_fail 1
+   }
+
+    proc check_for_app {app} {
+
+        # Check's if the binary supplied exists in /usr/bin. If it doesn't, it warns the user. 
+        #
+        # Args:
+        #           app - The name of the app to check for.
+        # Returns
+        #           None
+
+        output &quot;for '$app'&quot;
+
+        if {[file exists /usr/bin/$app] == 0} {
+            ui_error &quot;$app is needed by MacPorts to function normally, but wasn't found on this system. We'd recommend \
+                      installing it for continued use of MacPorts.&quot; 
+            success_fail 0
+            return
+        }
+
+        success_fail 1
+    }
+
+    proc check_xcode {config_options} {
+        
+        # Checks to see if the currently installed version of Xcode works with the curent OS version.
+        # 
+        # Args:
+        #           config_options - The associative array containing all options in the config files
+        # Returns:
+        #           None
+
+        output &quot;correct Xcode version&quot;
+
+        upvar $config_options config 
+
+        set mac_version     ${macports::macosx_version}
+        set xcode_current   ${macports::xcodeversion} 
+        set xcode_versions  $config(xcode_version_$mac_version)
+
+        if {$xcode_current in $xcode_versions} {
+            success_fail 1
+            return
+        
+        } else {
+            ui_error &quot;currently installed version of Xcode, $xcode_current, is not supported by MacPorts. \
+                      For your currently installed system, only the following versions of Xcode are supported: \
+                      $xcode_versions&quot;
+            success_fail 0
+        }
+    }
+
+    proc make_xcode_config {} {
+        
+        # Checks to see if xcode_versions.ini exists. If it does, it returns. If it doesn't, then it creats a defult config file.
+        # 
+        # Args: 
+        #           None
+        # Returns:
+        #           None
+
+        #FIXME: This most likely shouldn't be hardcoded... but for now it is. Fix it. 
+
+        set path    ${macports::portdbpath}/sources/rsync.macports.org/release/tarballs/ports/_resources/xcode_versions.ini
+
+        if {[file exists $path] == 0} {
+            ui_warn &quot;No configuration file found at $path. Creating generic config file.&quot;
+
+            set fd      [open $path w] 
+
+            puts $fd &quot;xcode_version_10.9=5.1.1 5.1 5.0.2 5.0.1&quot;
+            puts $fd &quot;xcode_version_10.8=5.1 5.0.2 5.0.1 5.0 4.6.3 4.6.2 4.6.1 4.6 4.5.2 4.5.1 4.5&quot;
+            puts $fd &quot;xcode_version_10.7=4.6.3 4.6.2 4.6.1 4.6 4.5.2 4.5.1 4.5 4.3.3&quot;
+            puts $fd &quot;xcode_version_10.6=4.2 3.2.6 3.2.5 3.2.4 3.2.3 3.2.2 3.2.1 3.2&quot;
+            puts $fd &quot;xcode_version_10.5=3.1.4 3.1.3 3.1.2 3.1.1 3.1 3.0&quot;
+            puts $fd &quot;xcode_version_10.4=2.5 2.4.1 2.4 2.3 2.2.1 2.2 2.1 2.0&quot;
+            puts $fd &quot;xcode_build=5B1008&quot;
+
+            close $fd
+        }
+    }
+     
+    proc make_user_config {} {
+
+        # Builds a config file for the user using all default parameters if needed.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        set path    ${macports::portdbpath}/port_doctor.ini

+        if {[file exists $path] == 0} {
+
+            ui_warn &quot;No configuration file found at $path. Creating generic config file.&quot;
+           
+            set fd      [open $path w]
+            puts $fd &quot;macports_location=${macports::prefix}&quot;
+            puts $fd &quot;profile_path=${macports::user_home}/.bash_profile&quot;
+            puts $fd &quot;shell_location=/bin/bash&quot;
+           
+            close $fd
+        }
+   }
+
+    proc get_config {config_options parser_options path} {
+
+        # Reads in and parses the configuration file passed in to $path. After parsing, all variables found are assigned 
+        # in the 'config_options' associative array. 
+        #
+        # Args:
+        #           config_options - The associative array responsible for holding all the configuration options.
+        #           parser_options - The list responsible for holding each option to set/look for in the configuration file.
+        #           path           - The path to the correct config_file
+        # Returns:
+        #           None. 
+
+        upvar $config_options config 
+
+        set fd   [open $path r]
+        set text [read $fd]
+        set data [split $text &quot;\n&quot;]
+
+        close $fd
+
+        foreach line $data { 
+
+            # Ignore comments
+            if {[string index $line 0] eq &quot;#&quot; } {
+                continue
+            }
+
+            #The tokens
+            set tokens [split $line &quot;=&quot;]
+
+            # Only care about things that are in $parser_options
+            if {[lindex $tokens 0] in $parser_options} {
+                set config([lindex $tokens 0]) [lindex $tokens 1]
+            
+            # Ignore whitespace
+            } elseif {[lindex $tokens 0] eq &quot;&quot;} {
+                continue
+
+            } else {
+                ui_error &quot;unrecognized config option in file $path: [lindex $tokens 0]&quot;
+            }
+        }
+    }
+
+    proc check_path {port_loc profile_path shell_loc} {
+
+        # Checks to see if port_location/bin and port_location/sbin are in the environmental $PATH variable.
+        # If they aren't, it appends it to the correct shell's profile file.
+        #
+        # Args:
+        #           port_loc        - The location of port (as set in the config file)
+        #           profile_path    - The location of the profile file (as set in the config file)
+        #           shell_loc       - The location of the shell binary (as set in the config file)
+        # Returns:
+        #           None.
+
+        set path ${macports::user_path}
+        set split [split $path :]
+
+        if {&quot;$port_loc/bin&quot; in $split &amp;&amp; &quot;$port_loc/sbin&quot; in $split } {
+
+            if {[lindex $split 0] != &quot;$port_loc/bin&quot;} {
+                ui_warn &quot;$port_loc/bin is not first in your PATH environmental variable.  This may or may not \
+                         cause problems in the future.&quot;
+            }
+            return
+
+        } else {
+            ui_warn &quot;your environmental \$PATH variable does not currently include, $port_loc/bin, which is where port is located. \
+                     Would you like to add $port_loc/bin to your \$PATH variable now? \[Y/N\]&quot;
+            set input [gets stdin]
+
+            if {$input == &quot;y&quot; || $input == &quot;Y&quot;} {
+                ui_msg &quot;Attempting to add $port_loc/bin to $profile_path&quot;
+
+                if {[file exists $profile_path] == 1} {
+                    set fd [open $profile_path a]
+
+                } else {
+                    ui_error &quot;$profile_path does not exist.&quot;
+                }
+
+                puts $fd &quot;export PATH=$port_loc/bin:$port_loc/sbin:\$PATH&quot;
+                close $fd
+
+                ui_msg &quot;Added PATH properly. Please execute, 'source $profile_path' in a new terminal window.&quot;
+
+            } elseif {$input == &quot;n&quot; || $input == &quot;N&quot;} {    
+                ui_msg &quot;Not fixing your \$PATH variable.&quot;
+
+            } else {
+                ui_msg &quot;Not a valid choice: $input&quot;
+            }
+       }
+   }
+}
</ins></span></pre></div>
<a id="branchesgsoc14cleanupsrcmacports10macportstcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/macports1.0/macports.tcl (123743 => 123744)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/macports1.0/macports.tcl        2014-08-13 22:05:22 UTC (rev 123743)
+++ branches/gsoc14-cleanup/src/macports1.0/macports.tcl        2014-08-13 22:08:44 UTC (rev 123744)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> package provide macports 1.0
</span><span class="cx"> package require macports_dlist 1.0
</span><span class="cx"> package require macports_util 1.0
</span><ins>+package require doctor 1.0
+package require reclaim 1.0
</ins><span class="cx"> package require Tclx
</span><span class="cx"> 
</span><span class="cx"> namespace eval macports {
</span><span class="lines">@@ -55,7 +57,7 @@
</span><span class="cx">     variable user_options {}
</span><span class="cx">     variable portinterp_options &quot;\
</span><span class="cx">         portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
</span><del>-        registry.path registry.format user_home \
</del><ins>+        registry.path registry.format user_home user_path \
</ins><span class="cx">         portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
</span><span class="cx">         rsync_server rsync_options rsync_dir startupitem_type startupitem_install place_worksymlink macportsuser \
</span><span class="cx">         configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
</span><span class="lines">@@ -658,6 +660,9 @@
</span><span class="cx">         set macports::user_home /dev/null/NO_HOME_DIR
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    # Save the path for future processing
+    set macports::user_path $env(PATH)
+
</ins><span class="cx">     # Configure the search path for configuration files
</span><span class="cx">     set conf_files {}
</span><span class="cx">     lappend conf_files ${macports_conf_path}/macports.conf
</span><span class="lines">@@ -1189,6 +1194,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    # Check the last time 'reclaim' was run
+    macports::check_last_reclaim
+
</ins><span class="cx">     # init registry
</span><span class="cx">     set db_path [file join ${registry.path} registry registry.db]
</span><span class="cx">     set db_exists [file exists $db_path]
</span><span class="lines">@@ -4359,6 +4367,45 @@
</span><span class="cx">     return yes
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+proc macports::doctor_main {opts} {
+    
+    # Calls the main function for the 'port doctor' command.
+    #
+    # Args: 
+    #           None
+    # Returns:
+    #           0 on successful execution.
+
+    doctor::main $opts
+    return 0
+}
+
+proc macports::check_last_reclaim {} {
+
+    # An abstraction layer for the reclaim function, 'check_last_run'.
+    #
+    # Args:
+    #           None
+    # Returns:
+    #           None
+
+    reclaim::check_last_run
+    return 0
+}
+
+proc macports::reclaim_main {} {
+
+    # Calls the main function for the 'port reclaim' command.
+    #
+    # Args:
+    #           None
+    # Returns:
+    #           None
+
+    reclaim::main
+    return 0
+}
+
</ins><span class="cx"> ##
</span><span class="cx"> # Execute the rev-upgrade scan and attempt to rebuild all ports found to be
</span><span class="cx"> # broken. Depends on the revupgrade_mode setting from macports.conf.
</span></span></pre></div>
<a id="branchesgsoc14cleanupsrcmacports10reclaimtcl"></a>
<div class="addfile"><h4>Added: branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl (0 => 123744)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl                                (rev 0)
+++ branches/gsoc14-cleanup/src/macports1.0/reclaim.tcl        2014-08-13 22:08:44 UTC (rev 123744)
</span><span class="lines">@@ -0,0 +1,380 @@
</span><ins>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# reclaim.tcl
+# $Id: macports.tcl 119177 2014-04-18 22:35:29Z cal@macports.org $
+#
+# Copyright (c) 2002 - 2003 Apple Inc.
+# Copyright (c) 2004 - 2005 Paul Guyot, &lt;pguyot@kallisys.net&gt;.
+# Copyright (c) 2004 - 2006 Ole Guldberg Jensen &lt;olegb@opendarwin.org&gt;.
+# Copyright (c) 2004 - 2005 Robert Shaw &lt;rshaw@opendarwin.org&gt;
+# Copyright (c) 2004 - 2014 The MacPorts Project
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Inc. nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# TODO:
+
+# Finished:
+# Add ui_debug statments
+# Catch some error-prone areas.
+# Remove the useless/structure comments and add actual docstrings.
+# Add copyright notice
+# Check if inactive files are dependents for other files. 
+# Add test cases
+# Add distfile version checking.
+# Pretty sure we should be using ui_msg, instead of puts and what not. Should probably add that.
+# Register the &quot;port cleanup&quot; command with port.tcl and all that involves.
+# Implement a hash-map, or multidimensional array for ease of app info keeping. Write it yourself if you have to.
+# 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
+
+package provide reclaim 1.0
+
+package require registry_uninstall 2.0
+package require macports
+
+namespace eval reclaim {
+
+    proc main {args} {
+
+        # The main function. Calls each individual function that needs to be run.
+        # Args: 
+        #           None
+        # Returns:
+        #           None
+
+        uninstall_inactive
+        remove_distfiles
+        update_last_run
+    }
+
+    proc is_empty_dir {dir} {
+        
+        # Test if the given directory is empty.
+        # Args:
+        #           dir         - A string path of the given directory to test
+        # Returns:
+        #           0 if the directory is not empty, 1 if it is.
+
+        # Get _all_ files
+        set filenames [glob -nocomplain -tails -directory $dir * .*]
+
+        # Yay complex statements! Use RE, lsearch, and llength to determine if the directory is empty.  
+        expr {![llength [lsearch -all -not -regexp $filenames {^\.\.?$}]]}
+    }
+
+    proc walk_files {dir delete dist_paths} {
+
+        # Recursively walk through each directory that isn't an installed port and if delete each file that isn't a directory if requested.
+        # Args:
+        #           dir             - A string path of the given directory to walk through
+        #           delete          - Whether to delete each file found that isn't a directory or not. Set to 'yes' or 'no'. 
+        #           dist_paths      - A list of the full paths for all distfiles from installed ports  
+        # Returns: 
+        #           'no' if no distfiles were found, and 'yes' if distfiles were found. 
+
+        set found_distfile no 
+
+        # If the directory is empty, and this isn't the root folder, delete it and recursively go up directories until a non-empty one is found.
+        if { $dir ne &quot;/opt/local/var/macports/distfiles&quot; &amp;&amp; [readdir $dir] eq &quot;&quot;} {
+
+            set up_dir [file dirname $dir]
+
+            ui_msg &quot;Found empty directory: $dir. Attempting to delete.&quot;
+
+            if {[catch {file delete -force $dir} error] } {
+                ui_error &quot;something went wrong when trying to delete $dir&quot;
+            }
+
+            walk_files $up_dir $delete $dist_paths
+            return
+        }
+
+        foreach item [readdir $dir] {
+
+            set currentPath [file join $dir $item]
+
+            if {[file isdirectory $currentPath]} {
+
+                walk_files $currentPath $delete $dist_paths
+
+            } else {
+                
+                # If the current file isn't in the known-installed-distfiles
+                if {[lsearch $dist_paths $currentPath] == -1} {
+                    set found_distfile yes
+
+                    ui_msg &quot;Found distfile: $item&quot;
+
+                    if {$delete eq &quot;yes&quot;} {
+
+                        ui_debug &quot;Deleting file: $item&quot;
+                        ui_msg &quot;Removing distfile: $item&quot;
+
+                        if {[catch {file delete $currentPath} error]} {
+                            ui_error &quot;something went wrong when trying to delete $currentPath&quot;
+                        }
+
+                        # If the directory is now empty, recursively call on this directory, to delete it.
+                        if {[is_empty_dir $dir]} {
+
+                            ui_debug &quot;Current directory is empty. Walking to $dir&quot;
+                            walk_files $dir $delete $dist_paths
+                        }
+                    }
+                }
+            }
+        }
+
+        return $found_distfile
+    }
+
+    proc remove_distfiles {} {
+
+        # Check for distfiles in both the root, and home directories. If found, delete them.
+        # Args:
+        #               None
+        # Returns:
+        #               0 on successful execution
+
+        global macports::portdbpath
+        global macports::user_home
+
+        # The root and home distfile folder locations, respectively. 
+        set root_dist       [file join ${macports::portdbpath} distfiles]
+        set home_dist       ${macports::user_home}/.macports$root_dist
+
+        set port_info    [get_info]
+        set dist_path    [list]
+
+        foreach port $port_info {
+
+            set name        [lindex $port 0]
+            set version     [lindex $port 1]
+            set revision    [lindex $port 2]
+            set variants    [lindex $port 3]
+
+            # Get mport reference
+            if {[catch {set mport [mportopen_installed $name $version $revision $variants {}]} error]} {
+                ui_error &quot;something went wrong when trying to get an mport reference.&quot;
+            }
+
+            # Setup sub-Tcl-interpreter that executed the installed port
+            set workername [ditem_key $mport workername]
+
+            # Append that port's distfiles to the list
+            set subdir [$workername eval return \$dist_subdir]
+            set name   [$workername eval return \$distfiles]
+
+            set root_path [file join $root_dist $subdir $name]
+            set home_path [file join $home_dist $subdir $name]
+
+            # Add the full file path to the list, depending where it's located.
+            if {[file isfile $root_path]} {
+                ui_debug &quot;Appending $root_path.&quot;
+                lappend dist_path $root_path
+
+            } else {
+                if {[file isfile $home_path]} {
+                    ui_debug &quot;Appending $home_path&quot;
+                    lappend dist_path $home_path
+                }
+            }
+        }
+
+        ui_debug &quot;Calling walk_files on root directory.&quot;
+
+        # Walk through each directory, and delete any files found. Alert the user if no files were found.
+        if {[walk_files $root_dist yes $dist_path] eq &quot;no&quot;} {
+            ui_msg &quot;No distfiles found in root directory.&quot;
+        }
+
+        ui_debug &quot;Calling walk_files on home directory.&quot;
+        # FIXME: Only commented because I accidentally delete all my dotfiles (including the home_dist location). It does in fact work on normal machines.
+        #if {[walk_files $home_dist yes $dist_path] eq &quot;no&quot;} {
+        #    ui_msg &quot;No distfiles found in home directory.&quot;
+        #}
+
+        return 0
+    } 
+
+    proc close_file {file} {
+
+        # Closes the file, handling error catching if needed.
+        #
+        # Args: 
+        #           file - The file handler
+        # Returns:
+        #           None
+        if {[catch {close $file} error]} {
+            ui_error &quot;something went wrong when closing file, $file.&quot;
+        }
+    }
+
+    proc is_inactive {app} {
+
+        # Determine's whether an application is inactive or not.
+        # Args: 
+        #           app - An array where the fourth item in it is the activity of the application.
+        # Returns:
+        #           1 if inactive, 0 if active.
+
+        if {[lindex $app 4] == 0} {
+            ui_debug &quot;App, [lindex $app 0], is inactive.&quot;
+            return 1
+        }
+        ui_debug &quot;App, [lindex $app 0], is not inactive.&quot;
+        return 0
+    }
+
+    proc get_info {} {
+
+        # Get's the information of all installed appliations (those returned by registry::installed), and returns it in a
+        # multidimensional list.
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           A multidimensional list where each app is a sublist, i.e., [{First Application Info} {Second Application Info} {...}]
+        #           Indexes of each sublist are: 0 = name, 1 = version, 2 = revision, 3 = variants, 4 = activity, and 5 = epoch.
+        
+        if { [catch {set installed [registry::installed]} result]} {
+            ui_error &quot;no installed applications found.&quot;
+        }
+
+        return $installed
+    }
+
+    proc update_last_run {} {
+        
+        # Updates the last_reclaim textfile with the newest time the code has been ran. 
+        #
+        # Args:
+        #           None
+        # Returns:
+        #           None
+
+        ui_debug &quot;Updating last run information.&quot;
+
+        set path    [file join ${macports::portdbpath} last_reclaim.txt]
+        set fd      [open $path w]
+        puts $fd    [clock seconds]
+        close_file $fd
+    }
+
+    proc check_last_run {} {
+
+        # Periodically warn's the user that they haven't run 'port reclaim' in two weeks, and that they should consider doing so.
+        # 
+        # Args:
+        #           None
+        # Returns: 
+        #           None
+
+        ui_debug &quot;Checking last run information.&quot;
+
+        set path [file join ${macports::portdbpath} last_reclaim.txt]
+
+        if {[file exists $path]} {
+
+            set fd      [open $path r]
+            set time    [gets $fd]
+            close_file $fd
+
+            if {$time ne &quot;&quot;} {
+                if {[clock seconds] - $time &gt; 1209600} {
+                    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;
+                }
+            }
+        }
+    }
+
+    proc uninstall_inactive {} {
+
+        # Attempts to uninstall all inactive applications. (Performance is now O(N)!)
+        #
+        # Args: 
+        #           None
+        # Returns: 
+        #           0 if execution was successful. Errors (for now) if execution wasn't. 
+
+        set apps            [get_info]
+        set inactive_apps   [list]
+        set inactive_names  [list]
+        set inactive_count  0
+
+        ui_debug &quot;Iterating through all inactive apps.&quot;
+
+        foreach app $apps {
+
+            if { [is_inactive $app] } {
+                lappend inactive_apps $app
+                lappend inactive_names [lindex $app 0]
+                incr inactive_count
+            }
+        }
+
+        if { $inactive_count == 0 } {
+            ui_msg &quot;Found no inactive ports.&quot;
+
+        } else {
+
+            ui_msg &quot;Found inactive ports: $inactive_names.&quot;
+            ui_msg &quot;Would you like to uninstall these apps? \[Y/N\]: &quot;
+
+            set input [gets stdin]
+            if {$input eq &quot;Y&quot; || $input eq &quot;y&quot; } {
+
+                ui_debug &quot;Iterating through all inactive apps... again.&quot;
+
+                foreach app $inactive_apps {
+                    set name [lindex $app 0]
+
+                    # Get all dependents for the current application
+                    if {[catch {set dependents [registry::list_dependents $name [lindex 1] [lindex 2] [lindex 3]]} error]} {
+                        ui_error &quot;something went wrong when trying to enumerate all dependents for $name&quot;
+                    }
+                    if {dependents ne &quot;&quot;} {
+                        ui_warn &quot;the following application ($name) is a dependent for $dependents. Are you positive you'd like to uninstall this 
+                                 (this could break other applications)? \[Y/N\]&quot;
+
+                        set input [gets stdin]
+                        if { $input eq &quot;N&quot; || &quot;n&quot; } {
+                            ui_msg &quot;Skipping application.&quot;
+                            continue
+                        }
+                    }
+                    ui_msg &quot;Uninstalling: $name&quot;
+
+                    # Note: 'uninstall' takes a name, version, revision, variants and an options list. 
+                    if {[catch {registry_uninstall::uninstall $name [lindex $app 1] [lindex $app 2] [lindex $app 3] {}} error]} {
+                        ui_error &quot;something went wrong when uninstalling $name&quot;
+                    }
+                }
+            } else {
+                ui_msg &quot;Not uninstalling applications.&quot;
+            }
+        }
+        return 0
+    }
+}
</ins></span></pre></div>
<a id="branchesgsoc14cleanupsrcportporttcl"></a>
<div class="modfile"><h4>Modified: branches/gsoc14-cleanup/src/port/port.tcl (123743 => 123744)</h4>
<pre class="diff"><span>
<span class="info">--- branches/gsoc14-cleanup/src/port/port.tcl        2014-08-13 22:05:22 UTC (rev 123743)
+++ branches/gsoc14-cleanup/src/port/port.tcl        2014-08-13 22:08:44 UTC (rev 123744)
</span><span class="lines">@@ -2725,7 +2725,23 @@
</span><span class="cx">     return $status
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+proc action_doctor { action portlist opts } {
+    if {[prefix_unwritable]} {
+        return 1
+    }
+    macports::doctor_main $opts
+    return 0
+}
</ins><span class="cx"> 
</span><ins>+proc action_reclaim { action portlist opts } {
+    if {[prefix_unwritable]} {
+        return 1
+    }
+    macports::reclaim_main  
+    return 0
+}
+
+
</ins><span class="cx"> proc action_upgrade { action portlist opts } {
</span><span class="cx">     if {[require_portlist portlist &quot;yes&quot;] || ([prefix_unwritable] &amp;&amp; ![macports::global_option_isset ports_dryrun])} {
</span><span class="cx">         return 1
</span><span class="lines">@@ -4205,6 +4221,8 @@
</span><span class="cx">     \
</span><span class="cx">     upgrade     [list action_upgrade        [ACTION_ARGS_PORTS]] \
</span><span class="cx">     rev-upgrade [list action_revupgrade     [ACTION_ARGS_NONE]] \
</span><ins>+    reclaim     [list action_reclaim        [ACTION_ARGS_NONE]] \
+    doctor      [list action_doctor         [ACTION_ARGS_NONE]] \
</ins><span class="cx">     \
</span><span class="cx">     version     [list action_version        [ACTION_ARGS_NONE]] \
</span><span class="cx">     platform    [list action_platform       [ACTION_ARGS_NONE]] \
</span><span class="lines">@@ -4365,6 +4383,7 @@
</span><span class="cx">     log         {{phase 1} {level 1}}
</span><span class="cx">     upgrade     {force enforce-variants no-replace no-rev-upgrade}
</span><span class="cx">     rev-upgrade {id-loadcmd-check}
</span><ins>+    doctor      {quiet}
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ##
</span></span></pre>
</div>
</div>

</body>
</html>