From 49a5891d71fba18b2e7b248534a57c5c18500820 Mon Sep 17 00:00:00 2001 From: rektide de la faye Date: Mon, 21 Feb 2022 20:29:56 -0500 Subject: [PATCH] add lzop/zlma/lzip/zstd unpack compress options. --- actions/unpack_action.go | 2 +- archiver.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/actions/unpack_action.go b/actions/unpack_action.go index d4993b14..04123b9c 100644 --- a/actions/unpack_action.go +++ b/actions/unpack_action.go @@ -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 'gz', bzip2', 'xz', "zstd", "lzop", "lzma", "lzip" compression types are supported. If not provided an attempt to autodetect the compression type will be done. */ package actions diff --git a/archiver.go b/archiver.go index c54f89c0..34c315c8 100644 --- a/archiver.go +++ b/archiver.go @@ -82,9 +82,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", + "bzip2": "--bzip2", + "gz": "--gzip", + "lzop": "--lzop", + "lzma": "--lzma", + "lzip", "--lzip", + "xz": "--xz", + "zstd": "--zstd", } // Trying to guess all other supported compression types return unpackTarOpts[compression]