Skip to content
Permalink
Browse files

restore: Remove port command checking

Users cannot run 'port restore' with a base installation that requires
migration at the moment, because the check in 'mportinit' will already
abort before 'restore::main' is even run.

Remove the check for now; we will re-use the check in mportinit and add
an exception for 'port migrate' instead.
  • Loading branch information
neverpanic committed Jan 7, 2018
1 parent 468865e commit 3fc1f832389845687a320370bbda2ae0a93182af
Showing with 0 additions and 20 deletions.
  1. +0 −20 src/macports1.0/restore.tcl
@@ -69,10 +69,6 @@ namespace eval restore {
deactivate_all
}

if {![check_port_command]} {
return -code error "OS platform mismatch"
}

ui_msg "Restoring snapshot '[$snapshot note]' created at [$snapshot created_at]"

ui_msg "Fetching ports to install..."
@@ -84,22 +80,6 @@ namespace eval restore {
return 0
}

proc check_port_command {} {

global tcl_platform
set os_version $tcl_platform(osVersion)
set os_major [lindex [split $os_version .] 0]
set os_platform [string tolower $tcl_platform(os)]

# Check that the current platform is the one we were configured for, otherwise need to do migration
if {($os_platform ne $macports::autoconf::os_platform) || ($os_major != $macports::autoconf::os_major)} {
ui_error "Current platform \"$os_platform $os_major\" does not match expected platform \"$macports::autoconf::os_platform $macports::autoconf::os_major\""
ui_error "If you upgraded your OS or changed the hardware architecture, you need to run 'port migrate' instead."
return 0
}
return 1
}

proc fetch_snapshot {snapshot_id} {
return [registry::snapshot get_by_id $snapshot_id]
}

0 comments on commit 3fc1f83

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