Add prefix_unwritable check for selfupdate

Fail early with a good message if the user forgot to use sudo or
otherwise can't write to the prefix.

Fixes: https://trac.macports.org/ticket/48439
This commit is contained in:
Joshua Root
2016-12-10 23:23:50 +11:00
parent c6b5a6bec4
commit 68016b825b
+3
View File
@@ -2674,6 +2674,9 @@ proc action_select { action portlist opts } {
proc action_selfupdate { action portlist opts } {
global global_options
if {[prefix_unwritable]} {
return 1
}
if { [catch {macports::selfupdate [array get global_options] base_updated} result ] } {
global errorInfo
ui_debug "$errorInfo"