<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/9389e838454b8ad9792c41a5128ff1178f9b2542">https://github.com/macports/macports-base/commit/9389e838454b8ad9792c41a5128ff1178f9b2542</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 9389e83 mportselect: always delete existing symlinks
</span>9389e83 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 9389e838454b8ad9792c41a5128ff1178f9b2542
</span>Author: Rainer Müller <raimue@macports.org>
AuthorDate: Thu Feb 2 14:13:43 2017 +0100
<span style='display:block; white-space:pre;color:#404040;'> mportselect: always delete existing symlinks
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> If the previously selected port was uninstalled, the 'current' symlink
</span><span style='display:block; white-space:pre;color:#404040;'> would be left pointing to the old select file that is no longer
</span><span style='display:block; white-space:pre;color:#404040;'> available.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The condition using 'file exists' follows the symlink and checks its
</span><span style='display:block; white-space:pre;color:#404040;'> target, not the symlink itself. It is safe to always call 'file delete'
</span><span style='display:block; white-space:pre;color:#404040;'> as deletion of a non-existing target is not an error.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/31702
</span>---
src/macports1.0/macports.tcl | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 049b024..3a3214a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4285,9 +4285,7 @@ proc mportselect {command {group ""} {version {}}} {
</span>
# Update the selected version.
set selected_version ${conf_path}/current
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists $selected_version]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete $selected_version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file delete $selected_version
</span> symlink $version $selected_version
return
}
</pre><pre style='margin:0'>
</pre>