<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.10
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/50f6998243e7a4097ec40b1cceadca81ebc3ad0e">https://github.com/macports/macports-base/commit/50f6998243e7a4097ec40b1cceadca81ebc3ad0e</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 50f6998243e7a4097ec40b1cceadca81ebc3ad0e
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Aug 9 04:59:06 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> Correctly report migration due to non-native base
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit 567fa444ea14564ad1095cb54d71e600d6d64e30)
</span>---
src/macports1.0/macports.tcl | 4 ++--
src/macports1.0/migrate.tcl | 15 ++++++++++++---
2 files changed, 14 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 40082b3d5..2130a959e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1067,8 +1067,8 @@ proc mportinit {{up_ui_options {}} {up_options {}} {up_variations {}}} {
</span>
# Check that the current platform is the one we were configured for, otherwise need to do migration
set skip_migration_check [expr {[info exists macports::global_options(ports_no_migration_check)] && $macports::global_options(ports_no_migration_check)}]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$skip_migration_check && [migrate::needs_migration]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Current platform \"$os_platform $os_major\" does not match expected platform \"$macports::autoconf::os_platform $macports::autoconf::os_major\""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {!$skip_migration_check && [migrate::needs_migration migrate_reason]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error $migrate_reason
</span> ui_error "Please run 'sudo port migrate' or follow the migration instructions: https://trac.macports.org/wiki/Migration"
return -code error "OS platform mismatch"
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/migrate.tcl b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 66b9edc91..8bf49b9fa 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -233,13 +233,22 @@ namespace eval migrate {
</span> # configured for. Returns true, if migration is needed, false otherwise.
#
# @return true iff the migration procedure is needed
<span style='display:block; white-space:pre;background:#ffe0e0;'>- proc needs_migration {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc needs_migration {{reasonvar {}}} {
</span> global macports::os_platform macports::os_major
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$reasonvar ne {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ upvar $reasonvar reason
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set reason {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> if {$os_platform ne $macports::autoconf::os_platform
|| ($os_platform eq "darwin" && $os_major != $macports::autoconf::os_major)
<span style='display:block; white-space:pre;background:#ffe0e0;'>- || ($os_platform eq "darwin" && $os_major >= 20
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && ![catch {sysctl sysctl.proc_translated} translated] && $translated)
</span> } then {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set reason "Current platform \"$os_platform $os_major\" does not match expected platform \"$macports::autoconf::os_platform $macports::autoconf::os_major\""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$os_platform eq "darwin" && $os_major >= 20
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ && ![catch {sysctl sysctl.proc_translated} translated] && $translated
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } then {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set reason "MacPorts is running through Rosetta 2, and should be rebuilt for Apple Silicon"
</span> return 1
}
return 0
</pre><pre style='margin:0'>
</pre>