Repository navigation
Extract asks before it replaces, like a copy - #117
Merged
2 commits merged intoNov 30, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
F5 inside an archive ran bsdtar straight into the destination, and bsdtar replaces what is there: silent data loss, no conflict bar, no policy for Unattended, one progress step, and an undo record that knew only the new top-level entries. bsdtar now unpacks into a hidden staging folder inside the destination (same filesystem), and the entries are moved into place by the item loop of a copy. That loop moved out of TransferJob into engine.h so both jobs drive it; a staged run moves but records what it placed as created, and names sources by their place in the archive. So an extract gets the conflict bar with every answer and "for all", merge into folders that exist, the policy set before the start, Unattended's skip and list, and an undo that trashes what was placed and restores what was replaced. While bsdtar runs, -v on a pipe is the progress: the open line names the member in flight, its size on disk is the current bytes, and the totals come from the listing the tab has. Pause stops the child (SIGSTOP), Abort kills it, Skip leaves out the member it was writing (bsdtar cannot be told, so it is written to the end and then dropped). Failures carry the member's name where bsdtar gives one. A folder the archive holds read-only could not be renamed out of the staging folder: it is opened for the move and gets its mode back where it lands. The staging folder is removed on every way out. Fixes #116 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The file is to stay under 350 lines and the jobs paragraph grew by one. "Extract and pack run bsdtar" still holds; how extract places what it unpacked is in the headers of extract.h and engine.h. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #116.
src/core/jobs/engine.h, shared byTransferJobandExtractJob).bsdtar -v: current member, bytes, totals from the tab's listing. Pause stops the child, Abort kills it, Skip drops the member in flight.Tests:
test_jobs(extractAsksLikeACopy,extractMergesAndKeepsModes,extractSkipPauseAbort,undoPackAndExtract),test_window(extractAsksLikeACopy). ctest passes.🤖 Generated with Claude Code