1 parent
639362fbf5
commit
bdd69f0aad
101 files changed
+22691
-531
No files matched your search
@@ -25,7 +25,8 @@ work_dir=$(realpath -m -- "$6")
|
||||
echo "stage is missing executable installer helpers" >&2
|
||||
exit 2
|
||||
}
|
||||
[[ -f $stage/manifest.json && -x $stage/bin/echoiond && -f $stage/lib/Echoion.ts ]] || {
|
||||
[[ -f $stage/manifest.json && -x $stage/bin/echoiond &&
|
||||
-x $stage/bin/echoion-updater && -f $stage/lib/Echoion.ts ]] || {
|
||||
echo "stage is missing required Echoion payload files" >&2
|
||||
exit 2
|
||||
}
|
||||
@@ -55,6 +56,7 @@ tar -C "$stage" "${tar_options[@]}" \
|
||||
--transform="s,^\\./,$artifact_base/," \
|
||||
-cf - . |
|
||||
zstd -T1 -19 --no-progress -o "$archive_tmp"
|
||||
chmod 0644 "$archive_tmp"
|
||||
mv -f -- "$archive_tmp" "$archive"
|
||||
|
||||
tar -C "$stage" "${tar_options[@]}" -cf - . | gzip -n -9 >"$gzip_payload"
|
||||
@@ -65,13 +67,29 @@ set -eu
|
||||
self=$0
|
||||
case $self in
|
||||
/*) ;;
|
||||
*) self=$(pwd)/$self ;;
|
||||
*/*)
|
||||
self_directory=$(CDPATH= cd -P -- "$(dirname -- "$self")" && pwd -P)
|
||||
self=$self_directory/$(basename -- "$self")
|
||||
;;
|
||||
*)
|
||||
self=$(command -v "$self") || {
|
||||
echo "Cannot locate Echoion installer: $0" >&2
|
||||
exit 2
|
||||
}
|
||||
case $self in
|
||||
/*) ;;
|
||||
*) self=$(pwd)/$self ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
temporary=$(mktemp -d "${TMPDIR:-/tmp}/echoion-installer.XXXXXX")
|
||||
cleanup() {
|
||||
rm -rf -- "$temporary"
|
||||
}
|
||||
trap cleanup EXIT HUP INT TERM
|
||||
trap cleanup EXIT
|
||||
trap 'exit 129' HUP
|
||||
trap 'exit 130' INT
|
||||
trap 'exit 143' TERM
|
||||
payload_line=$(awk '/^__ECHOION_PAYLOAD_BELOW__$/ { print NR + 1; exit }' "$self")
|
||||
if [ -z "$payload_line" ]; then
|
||||
echo "Echoion installer payload marker is missing" >&2
|
||||
@@ -80,8 +98,7 @@ fi
|
||||
tail -n "+$payload_line" "$self" |
|
||||
tar --same-permissions --no-same-owner -xzf - -C "$temporary"
|
||||
"$temporary/install.sh" "$@"
|
||||
status=$?
|
||||
exit "$status"
|
||||
exit 0
|
||||
__ECHOION_PAYLOAD_BELOW__
|
||||
RUN_HEADER
|
||||
cat "$header" "$gzip_payload" >"$installer_tmp"
|
||||
|
||||
Reference in new issue
Block a user