summaryrefslogtreecommitdiff
path: root/scripts/makeself
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-16 00:47:02 +0800
committerruki <[email protected]>2019-08-15 22:42:14 +0800
commit9efdf1c2d98afdf4febb4d79bf3a0c39aa2e5eed (patch)
tree9fdafbc212bead56dac38bc3f3411b5ef50fc0c4 /scripts/makeself
parentc8c6e5c55ecd600522d6e1dee68bd5567fa231be (diff)
improve runfile script
Diffstat (limited to 'scripts/makeself')
-rwxr-xr-xscripts/makeself/build-runfile.sh16
1 files changed, 14 insertions, 2 deletions
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__