mmtarfilter(1)

filter a tarball like dpkg does

Section 1 mmdebstrap bookworm source

Description

MMTARFILTER

NAME

mmtarfilter - filter a tarball like dpkg does

DESCRIPTION

usage: mmtarfilter [-h] [--path-exclude pattern] [--path-include pattern]

[--pax-exclude pattern] [--pax-include pattern] [--transform EXPRESSION] [--strip-components NUMBER] [--idshift NUM]

Filters a tarball on standard input by the same rules as the dpkg --path-exclude and --path-include options and writes resulting tarball to standard output. See dpkg(1) for information on how these two options work in detail. To reuse the exact same semantics as used by dpkg, paths must be given as /path and not as ./path even though they might be stored as such in the tarball.

Secondly, filter out unwanted pax extended headers. This is useful in cases where a tool only accepts certain xattr prefixes. For example tar2sqfs only supports SCHILY.xattr.user.*, SCHILY.xattr.trusted.* and SCHILY.xattr.security.* but not SCHILY.xattr.system.posix_acl_default.*.

Both types of options use Unix shell-style wildcards:

* matches everything ? matches any single character

[seq] matches any character in seq

[!seq] matches any character not in seq

Thirdly, transform the path of tar members using a sed expression just as with GNU tar --transform.

Fourthly, strip leading directory components off of tar members. Just as with GNU tar --strip-components, tar members that have less or equal components in their path are not passed through.

Lastly, shift user id and group id of each entry by the value given by the --idshift argument. The resulting uid or gid must not be negative.

options:

-h, --help

show this help message and exit

--path-exclude pattern

Exclude path matching the given shell pattern. This option can be specified multiple times.

--path-include pattern

Re-include a pattern after a previous exclusion. This option can be specified multiple times.

--pax-exclude pattern

Exclude pax header matching the given globbing pattern. This option can be specified multiple times.

--pax-include pattern

Re-include a pax header after a previous exclusion. This option can be specified multiple times.

--transform EXPRESSION, --xform EXPRESSION

Use sed replace EXPRESSION to transform file names. This option can be specified multiple times.

--strip-components NUMBER

Strip NUMBER leading components from file names

--idshift NUM

Integer value by which to shift the uid and gid of each entry