You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
mportselect: always delete existing symlinks
If the previously selected port was uninstalled, the 'current' symlink would be left pointing to the old select file that is no longer available. The condition using 'file exists' follows the symlink and checks its target, not the symlink itself. It is safe to always call 'file delete' as deletion of a non-existing target is not an error. Closes: https://trac.macports.org/ticket/31702
This commit is contained in:
@@ -4285,9 +4285,7 @@ proc mportselect {command {group ""} {version {}}} {
|
||||
|
||||
# Update the selected version.
|
||||
set selected_version ${conf_path}/current
|
||||
if {[file exists $selected_version]} {
|
||||
file delete $selected_version
|
||||
}
|
||||
file delete $selected_version
|
||||
symlink $version $selected_version
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user