From f1ce871d07cf4e913fa224da6ae6246480eeaa09 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sat, 23 Aug 2025 06:48:40 +0800 Subject: [PATCH] Prevent selfbreak --- portmgr/dmg/postflight.in | 9 ++------ src/macports1.0/selfupdate.tcl | 38 +++------------------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/portmgr/dmg/postflight.in b/portmgr/dmg/postflight.in index 1d7dc83ee..380a87872 100755 --- a/portmgr/dmg/postflight.in +++ b/portmgr/dmg/postflight.in @@ -99,13 +99,8 @@ function update_macports { "${TCLSH}" "${SCRIPT_DIR}/dedup_portfiles.tcl" "${TCLSH}" "${SCRIPT_DIR}/cxx_stdlib_overridden.tcl" - echo "Synchronizing the MacPorts installation with the project's rsync server..." - if ! "${BINPATH}/port" -v selfupdate; then - echo "An attempt to synchronize your recent MacPorts installation with the project's rsync server failed!" - echo "Please run 'sudo port -d selfupdate' manually to find out the cause of the error." - else - echo "Successful!" - fi + echo "Please run 'sudo port sync' to update ports sources." + echo "Successful!" } # Through this command we write an environment variable to an appropriate shell configuration file, diff --git a/src/macports1.0/selfupdate.tcl b/src/macports1.0/selfupdate.tcl index f7f3d38ad..afedf6983 100644 --- a/src/macports1.0/selfupdate.tcl +++ b/src/macports1.0/selfupdate.tcl @@ -593,42 +593,10 @@ proc selfupdate::main {{options {}} {updatestatusvar {}}} { if {$use_the_force_luke || $comp > 0 || ($comp == 0 && $migrating)} { if {[dict exists $options ports_dryrun] && [dict get $options ports_dryrun]} { - ui_msg "$ui_prefix MacPorts base is outdated, selfupdate would install $macports_version_new (dry run)" + ui_msg "$ui_prefix MacPorts base is outdated (dry run)." } else { - ui_msg "$ui_prefix MacPorts base is outdated, installing new version $macports_version_new" - - if {!$rsync_fetched} { - if {!$prefer_rsync} { - macports_try -pass_signal { - set source_code [download_source $mp_source_path $macports_version_new] - } on error {eMessage} { - ui_debug "download_source failed: $eMessage" - set prefer_rsync 1 - } - } - if {$prefer_rsync} { - set source_code [download_source_rsync] - set macports_version_downloaded [get_current_version_from_sources $source_code] - set comp [vercmp $macports_version_downloaded $macports_version] - } - } - if {$use_the_force_luke || $comp > 0 || ($comp == 0 && $migrating)} { - install $source_code - - if {[info exists updatestatus]} { - dict set updatestatus base_updated yes - } - - # Keep sources for future syncing if preferring rsync - if {!$prefer_rsync} { - cleanup_sources $mp_source_path - } - # Return here, port.tcl will re-execute selfupdate with the updated - # base to trigger sync and portindex with the new version - return 0 - } else { - ui_msg "$ui_prefix HTTP download failed and rsync does not yet have version $macports_version_new" - } + ui_msg "$ui_prefix MacPorts base is outdated, please update it." + ui_msg "$ui_prefix To update ports sources use 'sudo port sync'." } } elseif {$comp < 0} { ui_msg "$ui_prefix MacPorts base is probably master or a release candidate"