Skip to content

Commit

Permalink
_upgrade: skip archivefetch/destroot if possible
Browse files Browse the repository at this point in the history
Don't even run archivefetch if in source-only mode or destroot if in
binary-only mode.
  • Loading branch information
jmroot committed Oct 31, 2023
1 parent a9597dc commit 8d94e2f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/macports1.0/macports.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4344,8 +4344,6 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
}
}

array unset interp_options

set will_build no
set already_installed [registry::entry_exists $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants)]
# avoid building again unnecessarily
Expand Down Expand Up @@ -4408,14 +4406,19 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
# doing this instead of just running install ensures that we have the
# new copy ready but not yet installed, so we can safely uninstall the
# existing one.
set archivefetch_failed 0
if {[catch {mportexec $mport archivefetch} result]} {
ui_debug $::errorInfo
set archivefetch_failed 1
} elseif {$result != 0} {
set archivefetch_failed 1
set archivefetch_failed 1
if {![info exists interp_options(ports_source_only)]} {
if {[catch {mportexec $mport archivefetch} result]} {
ui_debug $::errorInfo
} elseif {$result == 0 && [$workername eval [list find_portarchive_path]] ne ""} {
set archivefetch_failed 0
}
}
if {$archivefetch_failed || [$workername eval [list find_portarchive_path]] eq ""} {
if {$archivefetch_failed} {
if {[info exists interp_options(ports_binary_only)]} {
_upgrade_cleanup
return 1
}
if {[catch {mportexec $mport destroot} result]} {
ui_debug $::errorInfo
_upgrade_cleanup
Expand All @@ -4439,6 +4442,8 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
}
}

array unset interp_options

# check if the startupitem is loaded, so we can load again it after upgrading
# (deactivating the old version will unload the startupitem)
set loaded_startupitems [list]
Expand Down

0 comments on commit 8d94e2f

Please sign in to comment.