Deprecate port selfupdate --nosync, add --no-sync

Closes: https://trac.macports.org/ticket/56434
This commit is contained in:
Rainer Müller
2018-05-09 13:08:19 +02:00
parent b97b8e2051
commit ce6d4817b3
2 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ proc selfupdate::main {{optionslist {}} {updatestatusvar {}}} {
set comp [vercmp $macports_version_new $macports::autoconf::macports_version]
# syncing ports tree.
if {![info exists options(ports_selfupdate_nosync)] || !$options(ports_selfupdate_nosync)} {
if {![info exists options(ports_selfupdate_no-sync)] || !$options(ports_selfupdate_no-sync)} {
if {$comp > 0} {
# updated portfiles potentially need new base to parse - tell sync to try to
# use prefabricated PortIndex files and signal if it couldn't
@@ -218,7 +218,7 @@ proc selfupdate::main {{optionslist {}} {updatestatusvar {}}} {
return -code error "Couldn't change permissions of the MacPorts sources at $mp_source_path to ${sources_owner}: $eMessage"
}
if {![info exists options(ports_selfupdate_nosync)] || !$options(ports_selfupdate_nosync)} {
if {![info exists options(ports_selfupdate_no-sync)] || !$options(ports_selfupdate_no-sync)} {
if {[info exists needed_portindex]} {
ui_msg "Not all sources could be fully synced using the old version of MacPorts."
ui_msg "Please run selfupdate again now that MacPorts base has been updated."
+7 -2
View File
@@ -2701,7 +2701,12 @@ proc action_selfupdate { action portlist opts } {
if {[prefix_unwritable]} {
return 1
}
if { [catch {macports::selfupdate [array get global_options] base_updated} result ] } {
array set options [array get global_options]
if {[info exists options(ports_${action}_nosync)] && $options(ports_${action}_nosync) eq "yes"} {
ui_warn "port selfupdate --nosync is deprecated, use --no-sync instead"
set options(ports_${action}_no-sync) $options(ports_${action}_nosync)
}
if { [catch {macports::selfupdate [array get options] base_updated} result ] } {
ui_debug $::errorInfo
ui_error $result
if {![macports::ui_isset ports_verbose]} {
@@ -4394,7 +4399,7 @@ array set cmd_opts_array {
depends description epoch exact glob homepage line
long_description maintainer maintainers name platform
platforms portdir regex revision variant variants version}
selfupdate {nosync}
selfupdate {no-sync nosync}
space {{units 1} total}
activate {no-exec}
deactivate {no-exec}