Commit d5babc7
committed
fix: copy fallback uses legacy heuristic to validate copied content
Round-6 review fix:
After Round-5 made is_install_complete() strict marker-only, the copy
fallback path broke:
bool copyOk = copy_xpkg_from_global(verdir);
if (copyOk && is_install_complete(verdir)) { // ← always false
mark_install_complete(...); // never reached
return make_payload();
}
clean_incomplete_install(verdir); // ← wipes the copy
copy_xpkg_from_global() doesn't (and can't) write .mcpp_ok in the
copied directory, so the marker-only check would always fail, and the
just-copied package would be immediately wiped, returning "xpkg payload
missing".
Fix: validate the copied content via looks_complete_legacy() (the
structural heuristic) before writing the marker. This is safe in this
context because:
1. Step 2 of the resolve chain already cleaned any pre-existing
residue using strict marker-only semantics — so anything at
verdir now MUST be the result of our just-completed copy.
2. copy_xpkg_from_global() only returns true on a clean recursive
copy (no partial copies reach this branch).
3. The heuristic validates that the source actually had content
(rules out copying from an empty/broken global xlings dir).
This restores the documented "copy_xpkg_from_global is the typical fast
fallback" behavior that Round-5 unintentionally broke.1 parent 161cb40 commit d5babc7
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
706 | 713 | | |
707 | | - | |
| 714 | + | |
708 | 715 | | |
709 | 716 | | |
710 | 717 | | |
711 | 718 | | |
712 | | - | |
| 719 | + | |
713 | 720 | | |
714 | 721 | | |
715 | 722 | | |
| |||
0 commit comments