PathFilter.create() currently instantiates individual filters in a match -
case over the filter URI's protocol. The plan is to instantiate filters
without match / case based on a protocol naming scheme only, so we better
introduce one at this point. Adopt jw-python's kebab_to_pascal() and
pascal_to_kebab() functions as a foundation for a future naming convention.
Signed-off-by: Jan Lindemann <jan@janware.com>
copy() handed a non-recursive copy of a directory to the single-object
get() path. For a plain context the backend then fails with a transport
error, and for a kvfile store the store root is a branch, not an entry,
so the get() fails with a FileNotFoundError naming a transformed address:
copying "kvfile:///etc" reported "FileNotFoundError: etc".
Require recursive for a directory source that is not fetchable as a whole,
as cp requires -r for directories: copy() now raises with a message naming
the source and the recursive option, instead of falling through to get().
Add a unit test that covers a directory source for a plain context and a
kvfile store.
Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0
copy() lands a source below the destination root, taking at most the
source's basename, so there is no way to land it at its source path, as cp
--parents does.
Add a parents flag that requests just that.
Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
Using a FileContext, notably with its chroot flag set, is useful as a
tree source in copy(), so allow it.
Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
copy() copies a single file: it fetches the source root as one content and
puts it at the destination, so addressing a directory source fails, and
there is no way to mirror a tree between file contexts.
Add a recursive mode:
- a directory source is mirrored below the destination root, into it if the
root is an existing directory, as it if it does not exist yet
- entries are enumerated with readdir(), destination directories are
created level by level, and every leaf is put with the requested owner,
group, and mode
- a file source is unaffected, and the destination parent must exist, as
before
posix copy exposes the mode as -r/--recursive; the help test reference
picks up the new option.
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.87.1
Signed-off-by: Jan Lindemann <jan@janware.com>