diff options
author | Aaron Ball <nullspoon@oper.io> | 2018-02-14 11:26:22 -0700 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2018-02-14 11:26:22 -0700 |
commit | e2eefee7a83b19b6012ff9b093e71d93f66cf3f2 (patch) | |
tree | 129e0c1e610440ed0691ceb3d4d6e61274e8a0a9 /install-header.sh | |
parent | 59173296aba560377f55dcc0527f2ddbb6c8d2ac (diff) | |
download | pkgself-e2eefee7a83b19b6012ff9b093e71d93f66cf3f2.tar.gz pkgself-e2eefee7a83b19b6012ff9b093e71d93f66cf3f2.tar.xz |
Added compress and decompress variables
Install header now has a {{ DECOMPRESS }} variable that is interpolated
on run of pkgself with pkgself's value for ${DECOMPRESS}.
Also added DECOMPRESS, COMPRESS, and COMPRESSEXT variables to pkgself to
standardize compression tools and command calls across the script. This
will also make it easier to make compress tools selectable in the future
(eg: --gzip or --bzip2 will set the variables differently).
Moved install header size calculation after all interpolations with a
note that all interpolations need to occur before that line so the size
counts are accurate.
Diffstat (limited to 'install-header.sh')
-rwxr-xr-x | install-header.sh | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/install-header.sh b/install-header.sh index b54a0ec..1d36f2a 100755 --- a/install-header.sh +++ b/install-header.sh @@ -4,12 +4,11 @@ # DO NOT CHANGE THIS without great care - it will break header length # calculations LENS=( ) -export SELF # Absolute path to the installer script (me!) -export TMP # Path to tmp install staging directory -export PAYLOAD # Path to the extracted payload directory -export NOCLEANUP # Do not clean up deploy resources. Useful for debugging -export COMPRESS # Command to compress data -export DECOMPRESS # Command to decompress data +export SELF # Absolute path to the installer script (me!) +export TMP # Path to tmp install staging directory +export PAYLOAD # Path to the extracted payload directory +export NOCLEANUP # Do not clean up deploy resources. Useful for debugging +export DECOMPRESS='{{ DECOMPRESS }}' # Command to decompress data # Header: 0 # runscript: 1 @@ -36,15 +35,15 @@ extract_header() { } extract_libinstall() { - extract_chunk_index "${SELF}" '-' 1 | xz -d -c | tar -C "${TMP}" -x + extract_chunk_index "${SELF}" '-' 1 | ${DECOMPRESS} | tar -C "${TMP}" -x } extract_runscript() { - extract_chunk_index "${SELF}" '-' 2 | xz -d -c > "${TMP}/run.sh" + extract_chunk_index "${SELF}" '-' 2 | ${DECOMPRESS} > "${TMP}/run.sh" } extract_payload() { - extract_chunk_index "${SELF}" '-' 3 | xz -d -c | tar -C "${TMP}" -x + extract_chunk_index "${SELF}" '-' 3 | ${DECOMPRESS} | tar -C "${TMP}" -x export PAYLOAD="${TMP}/pkg" } |