<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/3e4dfa81ddfb3528dec43d17b2e492689dcf0110">https://github.com/macports/macports-base/commit/3e4dfa81ddfb3528dec43d17b2e492689dcf0110</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 3e4dfa81ddfb3528dec43d17b2e492689dcf0110
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Dec 27 14:15:37 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> Strip trailing whitespace from diagnose.tcl
</span>---
src/macports1.0/diagnose.tcl | 102 +++++++++++++++++++++----------------------
1 file changed, 51 insertions(+), 51 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/diagnose.tcl b/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 72fb2f3..868fa83 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -39,7 +39,7 @@
</span> # Check for command line tools
# Check for any DYLD_* environmental variables
# Check for '.la' in dylib and '.prl'
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Check if installed files are readable
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Check if installed files are readable
</span> # Check for sqlite
# Check for openssl
# Crowd-source more ideas from the mailing-list
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -53,32 +53,32 @@
</span> # 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 xquartz site
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Add error catching for line's without an equals sign.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Add error catching for line's without an equals sign.
</span> # Support comments for the parser
# Check for amount of drive space
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Move port_diagnose.ini to the port tree, below _resources
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Move port_diagnose.ini to the port tree, below _resources
</span> # Check for curl
# Check for rsync
# Check if macports is in /opt/local
<span style='display:block; white-space:pre;background:#ffe0e0;'>-package provide diagnose 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+package provide diagnose 1.0
</span>
package require macports
package require reclaim 1.0
namespace eval diagnose {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Command line argument that determines whether or not to output things fancily.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Command line argument that determines whether or not to output things fancily.
</span> variable quiet 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc main {opts} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # The main function. Handles all the calls to the correct functions, and sets the config_options array,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # The main function. Handles all the calls to the correct functions, and sets the config_options array,
</span> # as well as the parser_options array.
#
# Args:
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # opts - The options passed in. Currently the only option available is 'quiet'.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # opts - The options passed in. Currently the only option available is 'quiet'.
</span> # Returns:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -102,7 +102,7 @@ namespace eval diagnose {
</span> make_user_config $user_config_path
# Read the config files
<span style='display:block; white-space:pre;background:#ffe0e0;'>- get_config config_options $parser_options $user_config_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ get_config config_options $parser_options $user_config_path
</span> get_config config_options $parser_options $xcode_config_path
# Start the checks
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -115,9 +115,9 @@ namespace eval diagnose {
</span> check_macports_location
check_free_space
check_for_x11
<span style='display:block; white-space:pre;background:#ffe0e0;'>- check_for_files_in_usr_local
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- check_tarballs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- check_port_files
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_for_files_in_usr_local
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_tarballs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_port_files
</span> check_for_package_managers
check_for_stray_developer_directory
check_compilation_error_cache
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -169,7 +169,7 @@ namespace eval diagnose {
</span>
proc check_for_dyld {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Checks to see if the current MacPorts session is running with a DYLD_* environmental
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Checks to see if the current MacPorts session is running with a DYLD_* environmental
</span> # variable set.
#
# Args:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -194,11 +194,11 @@ namespace eval diagnose {
</span> }
proc output {string} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Outputs the given string formatted correctly.
#
# Args:
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # string - The string to be output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # string - The string to be output
</span> # Returns:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -232,7 +232,7 @@ namespace eval diagnose {
</span>
# Checks to see if the compiler can compile properly, or it throws the error, "couldn't create cache file".
#
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Args:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Args:
</span> # None
# Returns:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -243,7 +243,7 @@ namespace eval diagnose {
</span>
set filename "test.c"
set fd [open $filename w]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> puts $fd "int main() { return 0; }"
close $fd
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -269,13 +269,13 @@ namespace eval diagnose {
</span> }
success_fail 1
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> }
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
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # by Homebrew implementation.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # by Homebrew implementation.
</span> #
# Args:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -283,31 +283,31 @@ namespace eval diagnose {
</span> # None
output "stray developer directory"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set uninstaller "/Developer/Library/uninstall-developer-folder"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${macports::xcodeversion} >= 4.3 && [file exists $uninstaller]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${macports::xcodeversion} >= 4.3 && [file exists $uninstaller]} {
</span> ui_warn "you have leftover files from an older version of Xcode. You should delete them by using, $uninstaller"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- success_fail 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ success_fail 0
</span> return
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- success_fail 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ success_fail 1
</span> }
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.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span> # Args:
# None
# Returns:
# None
output "HomeBrew"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {[file exists "/usr/local/Cellar"]} {
ui_warn "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."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -325,7 +325,7 @@ namespace eval diagnose {
</span> either uninstall it, or move it from /sw for now."
success_fail 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> } else {
success_fail 1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -333,7 +333,7 @@ namespace eval diagnose {
</span> }
proc check_port_files {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # 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.
#
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -423,7 +423,7 @@ namespace eval diagnose {
</span> 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
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # the user and suggest a reinstallation of the port.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the user and suggest a reinstallation of the port.
</span> #
# Args:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -457,11 +457,11 @@ namespace eval diagnose {
</span>
proc check_for_files_in_usr_local {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Checks for dylibs in /usr/local/lib and header files in /usr/local/include, and warns the user about said files if they
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Checks for dylibs in /usr/local/lib and header files in /usr/local/include, and warns the user about said files if they
</span> # are found.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span> # Args:
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # None
</span> # Returns:
# None
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -569,7 +569,7 @@ namespace eval diagnose {
</span>
proc check_for_app {app} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Check's if the binary supplied exists in /usr/bin. If it doesn't, it warns the user.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check's if the binary supplied exists in /usr/bin. If it doesn't, it warns the user.
</span> #
# Args:
# app - The name of the app to check for.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -580,7 +580,7 @@ namespace eval diagnose {
</span>
if {[file exists /usr/bin/$app] == 0} {
ui_error "$app is needed by MacPorts to function normally, but wasn't found on this system. We'd recommend \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- installing it for continued use of MacPorts."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ installing it for continued use of MacPorts."
</span> success_fail 0
return
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -589,9 +589,9 @@ namespace eval diagnose {
</span> }
proc check_xcode {config_options} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Checks to see if the currently installed version of Xcode works with the curent OS version.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span> # Args:
# config_options - The associative array containing all options in the config files
# Returns:
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -602,13 +602,13 @@ namespace eval diagnose {
</span> upvar $config_options config
set mac_version ${macports::macosx_version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set xcode_current ${macports::xcodeversion}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set xcode_current ${macports::xcodeversion}
</span> set xcode_versions $config(xcode_version_$mac_version)
if {$xcode_current in $xcode_versions} {
success_fail 1
return
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> } else {
ui_error "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: \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -618,22 +618,22 @@ namespace eval diagnose {
</span> }
proc make_xcode_config {path} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Checks to see if xcode_versions.ini exists. If it does, it returns. If it doesn't, then it creats a defult config file.
<span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Args:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Args:
</span> # None
# Returns:
# None
if {[file exists $path] == 0} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "No configuration file found at $path. Please run,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "No configuration file found at $path. Please run,
</span> \"port selfupdate\""
exit
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc make_user_config {path} {
# Builds a config file for the user using all default parameters if needed.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -646,20 +646,20 @@ namespace eval diagnose {
</span> if {[file exists $path] == 0} {
ui_warn "No configuration file found at $path. Creating generic config file."
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set fd [open $path w]
puts $fd "macports_location=${macports::prefix}"
puts $fd "profile_path=${macports::user_home}/.bash_profile"
puts $fd "shell_location=/bin/bash"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> close $fd
}
}
proc get_config {config_options parser_options path} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Reads in and parses the configuration file passed in to $path. After parsing, all variables found are assigned
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # in the 'config_options' associative array.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Reads in and parses the configuration file passed in to $path. After parsing, all variables found are assigned
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # in the 'config_options' associative array.
</span> #
# Args:
# config_options - The associative array responsible for holding all the configuration options.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -689,7 +689,7 @@ namespace eval diagnose {
</span> # Only care about things that are in $parser_options
if {[lindex $tokens 0] in $parser_options} {
set config([lindex $tokens 0]) [lindex $tokens 1]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Ignore whitespace
} elseif {[lindex $tokens 0] eq ""} {
continue
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -746,7 +746,7 @@ namespace eval diagnose {
</span>
ui_msg "Added PATH properly. Please execute, 'source $profile_path' in a new terminal window."
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {$input eq "n" || $input eq "N"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$input eq "n" || $input eq "N"} {
</span> ui_msg "Not fixing your \$PATH variable."
} else {
</pre><pre style='margin:0'>
</pre>