From b77ebe73e018d47c67267bf1c8912b21d4dfd612 Mon Sep 17 00:00:00 2001 From: Vladimir Stackov Date: Mon, 13 Apr 2015 16:40:16 +0300 Subject: [PATCH] Added support for lzo and lz4 --- README.md | 4 +++- makeself.1 | 8 +++++++- makeself.sh | 20 +++++++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1cee3d61..045f89d2 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,14 @@ The syntax of makeself is the following: * **--bzip2** : Use bzip2 instead of gzip for better compression. The bzip2 command must be available in the command path. It is recommended that the archive prefix be set to something like '.bz2.run', so that potential users know that they'll need bzip2 to extract it. * **--pbzip2** : Use pbzip2 instead of gzip for better and faster compression on machines having multiple CPUs. The pbzip2 command must be available in the command path. It is recommended that the archive prefix be set to something like '.bz2.run', so that potential users know that they'll need bzip2 to extract it. * **--xz** : Use xz instead of gzip for better compression. The xz command must be available in the command path. It is recommended that the archive prefix be set to something like '.xz.run' for the archive, so that potential users know that they'll need xz to extract it. + * **--lzo** : Use lzop instead of gzip for better compression. The lzop command must be available in the command path. It is recommended that the archive prefix be set to something like '.lzo.run' for the archive, so that potential users know that they'll need lzop to extract it. + * **--lz4** : Use lz4 instead of gzip for better compression. The lz4 command must be available in the command path. It is recommended that the archive prefix be set to something like '.lz4.run' for the archive, so that potential users know that they'll need lz4 to extract it. * **--base64** : Encode the archive to ASCII in Base64 format (base64 command required). * **--gpg-encrypt** : Encrypt the archive using "gpg -ac -z $COMPRESS_LEVEL". This will prompt for a password to encrypt with. Assumes that potential users have gpg installed. * **--ssl-encrypt** : Encrypt the archive using "openssl aes-256-cbc -a -salt". This will prompt for a password to encrypt with. Assumes that the potential users have openssl installed. * **--compress** : Use the UNIX "compress" command to compress the data. This should be the default on all platforms that don't have gzip available. * **--nocomp** : Do not use any compression for the archive, which will then be an uncompressed TAR. - * **--complevel** : Specify the compression level for gzip,bzip2,pbzip2 and xz. (default to 9) + * **--complevel** : Specify the compression level for gzip,bzip2,pbzip2,xz,lzo or lz4. (default to 9) * **--notemp** : The generated archive will not extract the files to a temporary directory, but in a new directory created in the current directory. This is better to distribute software packages that may extract and compile by themselves (i.e. launch the compilation through the embedded script). * **--current** : Files will be extracted to the current directory, instead of in a subdirectory. This option implies **--notemp** above. * **--follow** : Follow the symbolic links inside of the archive directory, i.e. store the files that are being pointed to instead of the links themselves. diff --git a/makeself.1 b/makeself.1 index 23cb8a6e..71e5ed13 100644 --- a/makeself.1 +++ b/makeself.1 @@ -33,6 +33,12 @@ Compress using pbzip2. .B --xz Compress using xz. .TP +.B --lzo +Compress using lzop. +.TP +.B --lz4 +Compress using lz4. +.TP .B --compress Compress using the UNIX 'compress' command. .TP @@ -40,7 +46,7 @@ Compress using the UNIX 'compress' command. Do not compress the data. .TP .B --complevel lvl -Specify the compression level for gzip,bzip2,pbzui2 or xz +Specify the compression level for gzip,bzip2,pbzui2,xz,lzo or lz4 .TP .B --notemp The archive will create archive_dir in the current directory and diff --git a/makeself.sh b/makeself.sh index 6c47f7e8..2add0a26 100755 --- a/makeself.sh +++ b/makeself.sh @@ -95,8 +95,10 @@ MS_Usage() 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 xz bzip2 and pbzip2 (default 9)" + echo " --complevel lvl : Compression level for gzip xz lzo lz4 bzip2 and pbzip2 (default 9)" echo " --base64 : Instead of compressing, encode the data using base64" echo " --gpg-encrypt : Instead of compressing, encrypt the data using GPG" echo " --ssl-encrypt : Instead of compressing, encrypt the data using OpenSSL" @@ -176,6 +178,14 @@ do COMPRESS=xz shift ;; + --lzo) + COMPRESS=lzo + shift + ;; + --lz4) + COMPRESS=lz4 + shift + ;; --compress) COMPRESS=Unix shift @@ -367,6 +377,14 @@ xz) GZIP_CMD="xz -c$COMPRESS_LEVEL" GUNZIP_CMD="xz -d" ;; +lzo) + GZIP_CMD="lzop -c$COMPRESS_LEVEL" + GUNZIP_CMD="lzop -d" + ;; +lz4) + GZIP_CMD="lz4 -c$COMPRESS_LEVEL" + GUNZIP_CMD="lz4 -d" + ;; base64) GZIP_CMD="base64" GUNZIP_CMD="base64 -d -i"