From 9efdf1c2d98afdf4febb4d79bf3a0c39aa2e5eed Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 16 Aug 2019 00:47:02 +0800 Subject: improve runfile script --- scripts/makeself/build-runfile.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'scripts/makeself') diff --git a/scripts/makeself/build-runfile.sh b/scripts/makeself/build-runfile.sh index 504a64a3f..dda90d9e5 100755 --- a/scripts/makeself/build-runfile.sh +++ b/scripts/makeself/build-runfile.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash +# compress algorithm: gzip, bzip2, xz +algo=$1 +if [ -z $algo ]; then + algo="gzip" +fi +suffix=$algo +if [ $algo = "gzip" ]; then + suffix="gz" +elif [ $algo = "bzip2" ]; then + suffix="bz2" +fi + # path constants cd "$(dirname "$0")/../.." xmakeroot=`pwd` @@ -44,11 +56,11 @@ cd $temproot wget https://github.com/megastep/makeself/releases/download/release-2.4.0/makeself-2.4.0.run -O ./makeself-2.4.0.run sh ./makeself-2.4.0.run ./makeself-2.4.0/makeself.sh \ - --bzip2 \ + --$algo \ --sha256 \ --lsm ./lsm \ --help-header ./header \ ./xmake \ - $buildroot/xmake.bz2.run \ + $buildroot/xmake.$suffix.run \ xmake-v$version-runfile \ ./scripts/get.sh __local__ -- cgit v1.3.1