Debian Bookworm includes a version of tar with native support
for Zstandard compression.
Add mapping to enable zstd in pack and unpack operations.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
pigz does gzip compression on multiple cores and multiple processors
and there is improvement in compression time on multi core machines.
Use pigz for gzip compression if installed on the host machine.
Fixes: #218
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Add options to `tar` to tell it to save and restore extended attributes:
* `--xattr`: enable extended attributes support
* `--xattrs-include=*.*`: tell `tar` to include every extended attribute
since by default `tar` only stores attributes in the `user.*` namespace
This fixes the `pack` and `unpack` actions when dealing with tools like
`ping` which on modern distributions have been switched to use file
capabilities to do privileged operations without being setuid, as they are
based on extended attributes.
This relies on `tar` being GNU Tar >= 1.27, released in 2013 and shipped since
Debian Jessie.
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
Common approach for working with archives is introduced.
Unpacker and Archiver interfaces are added.
Example of file unpacking:
archive, _ := debos.NewArchive("file.ext")
archive.Unpack("destination")
Three archive types are supported:
- tar
- zip
- debian packages
Type of archive is guessed by extension or can be set explicitly during
archiver creation with option for NewArchive().
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
This change allows to import and use core modules from "debos" package and
actions from "actions" package. Add prefix 'debos.' to all symbols imported
from core "debos" package to satisfy syntax check.
Package "actions" shouldn't keep any common function or structure:
- function 'DownloadHttpUrl()' is moved from 'DownloadAction' to "debos"
package. New file 'net.go' has been added to keep a common network functions
in core part of debos.
- move common functions for extracting files from 'UnpackAction' to 'debos'
package. File 'archiver.go' has been added for common operations on archives.
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>