Skip to content

Create missing parent directories when packaging a bag - #81

Merged
whikloj merged 1 commit into
whikloj:mainfrom
tacman:create-archive-parent
Oct 21, 2026
Merged

whikloj merged 1 commit into
whikloj:mainfrom
tacman:create-archive-parent

Conversation

@tacman

@tacman tacman commented Oct 20, 2026

Copy link
Copy Markdown

Packaging to a path such as new/nested/archive.tar.bz2 fails when its parent directories do not exist. This reproduces the exception reported in #75; existing nested destination directories work in my local test.

Create the destination parent recursively through the existing checked filesystem helper after validation and before writing the archive. This applies consistently to tar, tar.gz, tgz, tar.bz2 and ZIP. Archive write failures still raise errors.

The regression test fails for all five formats before the fix. With the fix, each archive is created, reloaded, validated, and its payload checksums compared with the source bag.

Validation: PHP 8.4, 259 tests / 1548 assertions pass; PSR-12 checks pass. This PR branches directly from upstream main and is independent of #80.

Fixes #75 for the missing-parent-directory case. If the original reporter's directory already exists, additional environment details would still be needed to reproduce that case.

@whikloj whikloj closed this Oct 21, 2026
@whikloj whikloj reopened this Oct 21, 2026
@whikloj
whikloj merged commit 3ecbcdc into whikloj:main Oct 21, 2026
8 checks passed
@whikloj

whikloj commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Thanks for your contribution @tacman, I'll have a look at your other PR very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FilesystemException

2 participants