diff options
-rw-r--r-- | .github/workflows/build.yml | 4 | ||||
-rwxr-xr-x | makeself.sh | 11 | ||||
-rwxr-xr-x | test/extracttest | 9 |
3 files changed, 21 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98fdc69..ba2bea6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,11 +12,11 @@ jobs: steps: - name: Install Linux packages if: runner.os == 'Linux' - run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2 + run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2 zstd - name: Install macOS packages if: runner.os == 'macOS' - run: brew install pbzip2 coreutils + run: brew install pbzip2 coreutils zstd - name: Checkout Makeself uses: actions/checkout@v2 diff --git a/makeself.sh b/makeself.sh index a75cb5d..fb058a3 100755 --- a/makeself.sh +++ b/makeself.sh @@ -105,13 +105,14 @@ MS_Usage() echo " --quiet | -q : Do not print any messages other than errors." echo " --gzip : Compress using gzip (default if detected)" echo " --pigz : Compress with pigz" + echo " --zstd : Compress with zstd" echo " --bzip2 : Compress using bzip2 instead of gzip" echo " --pbzip2 : Compress using pbzip2 instead of gzip" echo " --xz : Compress using xz instead of gzip" echo " --lzo : Compress using lzop instead of gzip" echo " --lz4 : Compress using lz4 instead of gzip" echo " --compress : Compress using the UNIX 'compress' command" - echo " --complevel lvl : Compression level for gzip pigz xz lzo lz4 bzip2 and pbzip2 (default 9)" + echo " --complevel lvl : Compression level for gzip pigz zstd xz lzo lz4 bzip2 and pbzip2 (default 9)" echo " --threads thds : Number of threads to be used by compressors that support parallelization." echo " Omit to use compressor's default. Most useful (and required) for opting" echo " into xz's threading, usually with '--threads=0' for all available cores." @@ -233,6 +234,10 @@ do COMPRESS=pigz shift ;; + --zstd) + COMPRESS=zstd + shift + ;; --xz) COMPRESS=xz shift @@ -500,6 +505,10 @@ pigz) fi GUNZIP_CMD="gzip -cd" ;; +zstd) + GZIP_CMD="zstd -$COMPRESS_LEVEL" + GUNZIP_CMD="zstd -cd" + ;; pbzip2) GZIP_CMD="pbzip2 -c$COMPRESS_LEVEL" if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated diff --git a/test/extracttest b/test/extracttest index 9f55aac..bd7f899 100755 --- a/test/extracttest +++ b/test/extracttest @@ -46,6 +46,15 @@ testPBzip2() assertEqual $? 0 } +testZstd() +{ + # Skip if zstd is not available + which zstd || return + setupTests --zstd + + ./makeself-test.run --check + assertEqual $? 0 +} source bashunit/bashunit.bash |