diff options
author | Chloe Strachan <68156310+chloeeeS@users.noreply.github.com> | 2022-12-25 04:31:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-25 01:31:00 -0800 |
commit | 117e41d599e11e7c776beb0258fc8ffd1a6ec52f (patch) | |
tree | 079b2c42ec3e9f9a67463c2c99c71ba91c029700 | |
parent | f0658cc19f2268f93b255607605fad18d55b74d3 (diff) | |
download | makeself-117e41d599e11e7c776beb0258fc8ffd1a6ec52f.tar.gz |
Add bzip3 compression support (#289)
-rwxr-xr-x | makeself.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/makeself.sh b/makeself.sh index 47025d2..6808288 100755 --- a/makeself.sh +++ b/makeself.sh @@ -110,11 +110,12 @@ MS_Usage() echo " --zstd : Compress with zstd" echo " --bzip2 : Compress using bzip2 instead of gzip" echo " --pbzip2 : Compress using pbzip2 instead of gzip" + echo " --bzip3 : Compress using bzip3 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 zstd xz lzo lz4 bzip2 and pbzip2 (default 9)" + echo " --complevel lvl : Compression level for gzip pigz zstd xz lzo lz4 bzip2 pbzip2 and bzip3 (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." @@ -234,6 +235,10 @@ do COMPRESS=pbzip2 shift ;; + --bzip3) + COMPRESS=bzip3 + shift + ;; --bzip2) COMPRESS=bzip2 shift @@ -541,6 +546,16 @@ pbzip2) fi GUNZIP_CMD="bzip2 -d" ;; +bzip3) + # Map the compression level to a block size in MiB as 2^(level-1). + BZ3_COMPRESS_LEVEL=`echo "2^($COMPRESS_LEVEL-1)" | bc` + GZIP_CMD="bzip3 -b$BZ3_COMPRESS_LEVEL" + if test $THREADS -ne $DEFAULT_THREADS; then # Leave as the default if threads not indicated + GZIP_CMD="$GZIP_CMD -j$THREADS" + fi + JOBS=`echo "10-$COMPRESS_LEVEL" | bc` + GUNZIP_CMD="bzip3 -dj$JOBS" + ;; bzip2) GZIP_CMD="bzip2 -$COMPRESS_LEVEL" GUNZIP_CMD="bzip2 -d" |