Skip to content
Permalink
Browse files

macports: skip OS check for migrate/selfupdate

When running migration and/or selfupdate, we specifically do not want to
check for outdated OS versions.
  • Loading branch information
neverpanic committed Jan 7, 2018
1 parent 244eae9 commit 0c2b101fccb0dd7928092a6438e39958894f5ca0
Showing with 7 additions and 2 deletions.
  1. +2 −1 src/macports1.0/macports.tcl
  2. +5 −1 src/port/port.tcl
@@ -692,7 +692,8 @@ proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
macosx_version

# Check that the current platform is the one we were configured for, otherwise need to do migration
if {[migrate::needs_migration]} {
set skip_migration_check [expr {[info exists macports::global_options(ports_no_migration_check)] && $macports::global_options(ports_no_migration_check)}]
if {!$skip_migration_check && [migrate::needs_migration]} {
ui_error "Current platform \"$os_platform $os_major\" does not match expected platform \"$macports::autoconf::os_platform $macports::autoconf::os_major\""
ui_error "Please run 'sudo port migrate' or follow the migration instructions: https://trac.macports.org/wiki/Migration"
return -code error "OS platform mismatch"
@@ -5764,7 +5764,11 @@ set remaining_args [lrange $cmd_argv $cmd_argn end]
# shell mode
if { [llength $remaining_args] == 0 && ![info exists ui_options(ports_commandfiles)] } {
lappend ui_options(ports_commandfiles) -
} elseif {[lookahead] eq "selfupdate" || [lookahead] eq "sync"} {
} elseif {[lookahead] in {"selfupdate" "migrate"}} {
# tell mportinit not to tell the user they should selfupdate and skip the migration check
set ui_options(ports_no_old_index_warning) 1
set global_options(ports_no_migration_check) 1
} elseif {[lookahead] eq "sync"} {
# tell mportinit not to tell the user they should selfupdate
set ui_options(ports_no_old_index_warning) 1
}

0 comments on commit 0c2b101

Please sign in to comment.
You can’t perform that action at this time.