add lzop/zlma/lzip/zstd unpack compress options.

Signed-off-by: rektide de la faye <rektide@voodoowarez.com>
Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
This commit is contained in:
rektide de la faye
2022-02-21 20:29:56 -05:00
committed by Dylan Aïssi
parent a494e5e218
commit d7135c3787
2 changed files with 8 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ The default value is 'artifacts' directory in case if this property is omitted.
- compression -- optional hint for unpack allowing to use proper compression method.
Currently only 'gz', bzip2' and 'xz' compression types are supported.
Currently 'bzip2', 'gz', 'lzip', 'lzma', 'lzop', 'xz' and 'zstd' compression types are supported.
If not provided an attempt to autodetect the compression type will be done.
*/
package actions

View File

@@ -83,10 +83,13 @@ func unpack(command []string, destination string) error {
// Returns empty string for unknown
func tarOptions(compression string) string {
unpackTarOpts := map[string]string{
"gz": "-z",
"bzip2": "-j",
"xz": "-J",
"zstd": "--zstd",
"bzip2": "--bzip2",
"gz": "--gzip",
"lzip": "--lzip",
"lzma": "--lzma",
"lzop": "--lzop",
"xz": "--xz",
"zstd": "--zstd",
} // Trying to guess all other supported compression types
return unpackTarOpts[compression]