"""Create a (possibly compressed) tar file from all the files under
'base_dir'.
- 'compress' must be "gzip" (the default), "bzip2", "xz", or None.
+ 'compress' must be "gzip" (the default), "bzip2", "xz", "zst", or None.
'owner' and 'group' can be used to define an owner and a group for the
archive that is being built. If not provided, the current owner and group
will be used.
The output tar file will be named 'base_name' + ".tar", possibly plus
- the appropriate compression extension (".gz", ".bz2", or ".xz").
+ the appropriate compression extension (".gz", ".bz2", ".xz", or ".zst").
Returns the output filename.
"""
'base_name' is the name of the file to create, minus any format-specific
extension; 'format' is the archive format: one of "zip", "tar", "gztar",
- "bztar", "zstdtar", or "xztar". Or any other registered format.
+ "bztar", "xztar", or "zstdtar". Or any other registered format.
'root_dir' is a directory that will be the root directory of the
archive; ie. we typically chdir into 'root_dir' before creating the
zip.close()
def _unpack_tarfile(filename, extract_dir, *, filter=None):
- """Unpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
+ """Unpack tar/tar.gz/tar.bz2/tar.xz/tar.zst `filename` to `extract_dir`
"""
import tarfile # late import for breaking circular dependency
try:
is unpacked. If not provided, the current working directory is used.
`format` is the archive format: one of "zip", "tar", "gztar", "bztar",
- or "xztar". Or any other registered format. If not provided,
+ "xztar", or "zstdtar". Or any other registered format. If not provided,
unpack_archive will use the filename extension and see if an unpacker
was registered for that extension.