]> git.ipfire.org Git - thirdparty/libarchive.git/commit
non-recursive extract and list
authorPatrick Ohly <patrick.ohly@intel.com>
Mon, 24 Oct 2016 10:54:48 +0000 (12:54 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Mon, 15 Apr 2019 06:59:07 +0000 (08:59 +0200)
commit7c5e94c9ec3a70ddaeec6c554149eb13db9cfe60
tree910a217dd29a26a1fc25ab45e5f80ae1a0c4f34e
parent19bd077987ff26a4cb108edde5eaf970837aa1f0
non-recursive extract and list

Sometimes it makes sense to extract or list a directory contained in
an archive without also doing the same for the content of the
directory, i.e. allowing -n (= --no-recursion) in combination with the
x and t modes.

bsdtar uses the match functionality in libarchive to track include
matches. A new libarchive API call
archive_match_set_inclusion_recursion() gets introduced to
influence the matching behavior, with the default behavior as before.

Non-recursive matching can be achieved by anchoring the path match at
both start and end. Asking for a directory which itself isn't in the
archive when in non-recursive mode is an error and handled by the
existing mechanism for tracking unused inclusion entries.
libarchive/archive.h
libarchive/archive_match.c
tar/bsdtar.1
tar/bsdtar.c