Ignore installed archive when appropriate

See: https://trac.macports.org/ticket/73659
(cherry picked from commit 737d844764)
This commit is contained in:
Joshua Root
2026-04-06 01:25:55 +10:00
parent b230e03a03
commit 0c3d28b566
4 changed files with 10 additions and 12 deletions
+1 -1
View File
@@ -5779,7 +5779,7 @@ proc macports::_exec_upgrade {oplist upgrade_count} {
if {!$source_only} {
if {[catch {mportexec $mport archivefetch} result]} {
ui_debug $::errorInfo
} elseif {$result == 0 && [$workername eval [list find_portarchive_path]] ne ""} {
} elseif {$result == 0 && [$workername eval [list find_portarchive_path 0]] ne ""} {
set destroot_needed 0
}
}
+3 -2
View File
@@ -311,8 +311,9 @@ proc portarchivefetch::fetchfiles {{async no} args} {
}
set sorted no
set existing_archive [find_portarchive_path]
if {$existing_archive eq "" && ![tbool force_archive_refresh]
set include_installed [expr {![tbool force_archive_refresh]}]
set existing_archive [find_portarchive_path $include_installed]
if {$existing_archive eq "" && $include_installed
&& [file isdirectory [file rootname [get_portimage_path]]]} {
set existing_archive yes
}
+1 -1
View File
@@ -292,7 +292,7 @@ proc portinstall::install_main {args} {
variable installPlist
set location [get_portimage_path]
set archive_path [find_portarchive_path]
set archive_path [find_portarchive_path 0]
if {$archive_path ne ""} {
set install_dir [file dirname $location]
file mkdir $install_dir
+5 -8
View File
@@ -2727,16 +2727,13 @@ proc supportedArchiveTypes {} {
}
# return path to a downloaded or installed archive for this port
proc find_portarchive_path {} {
global portdbpath subport version revision portvariants force_archive_refresh
set installed 0
if {[registry_exists $subport $version $revision $portvariants]} {
set installed 1
}
proc find_portarchive_path {{include_installed 1}} {
global portdbpath subport version revision portvariants
set installed [expr {$include_installed && [registry_exists $subport $version $revision $portvariants]}]
set archiverootname [file rootname [get_portimage_name]]
foreach unarchive.type [supportedArchiveTypes] {
set fullarchivename "${archiverootname}.${unarchive.type}"
if {$installed && ![tbool force_archive_refresh]} {
if {$installed} {
set fullarchivepath [file join $portdbpath software $subport $fullarchivename]
} else {
set fullarchivepath [file join $portdbpath incoming/verified $fullarchivename]
@@ -3528,7 +3525,7 @@ proc portutil::_eval_archive_available {{async no}} {
return
}
if {[find_portarchive_path] ne ""} {
if {[find_portarchive_path 0] ne ""} {
set archive_available_result 1
return
}