Skip to content

Commit

Permalink
portdestroot: catch errors from sparse workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Oct 15, 2024
1 parent 079ce04 commit 2fa2e91
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/port1.0/portdestroot.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,19 @@ proc portdestroot::destroot_finish {args} {
if {[fs_clone_capable $destroot]} {
global workpath
ui_debug "Applying sparse file lseek bug workaround"
fs-traverse -depth fullpath [list $destroot] {
if {[file type $fullpath] eq "file" && [fileIsSparse $fullpath]} {
ui_debug "Cloning $fullpath for workaround"
clonefile $fullpath ${workpath}/.macports-sparse-workaround
file delete ${workpath}/.macports-sparse-workaround
if {![fileIsSparse $fullpath]} {
ui_debug "$fullpath is no longer sparse"
try {
fs-traverse -depth fullpath [list $destroot] {
if {[file type $fullpath] eq "file" && [fileIsSparse $fullpath]} {
ui_debug "Cloning $fullpath for workaround"
clonefile $fullpath ${workpath}/.macports-sparse-workaround
file delete ${workpath}/.macports-sparse-workaround
if {![fileIsSparse $fullpath]} {
ui_debug "$fullpath is no longer sparse"
}
}
}
} on error {eMessage} {
ui_debug "Error while applying sparse file workaround: $eMessage"
}
}

Expand Down

0 comments on commit 2fa2e91

Please sign in to comment.