mirror of
https://github.com/megastep/makeself.git
synced 2025-09-26 19:41:12 +08:00
bug fix: fix mktemp on macos and escaping backslashes on alpine
This commit is contained in:

committed by
Stéphane Peter

parent
c9365dfd0c
commit
271b54a905
@@ -24,14 +24,7 @@ scriptargs="$SCRIPTARGS"
|
||||
cleanup_script="${CLEANUP_SCRIPT}"
|
||||
licensetxt="$LICENSE"
|
||||
helpheader="${HELPHEADER}"
|
||||
preextract='
|
||||
EOF
|
||||
if test -n "${PREEXTRACT_FILE}"; then
|
||||
sed -e "s/['\\]/\\\\&/g" "${PREEXTRACT_FILE}" >> "$archname"
|
||||
fi
|
||||
cat << EOF >> "$archname"
|
||||
'
|
||||
preextract="\${preextract#?}"; preextract="\${preextract%?}" # trim redundant newlines
|
||||
preextract="${PREEXTRACT_ENCODED}"
|
||||
targetdir="$archdirname"
|
||||
filesizes="$filesizes"
|
||||
totalsize="$totalsize"
|
||||
@@ -326,8 +319,8 @@ MS_Preextract()
|
||||
fi
|
||||
fi
|
||||
|
||||
prescript=\`mktemp -t XXXXX -p "\$tmpdir"\`
|
||||
echo "\$preextract" > "\$prescript"
|
||||
prescript=\`mktemp "\$tmpdir/XXXXXX"\`
|
||||
echo "\$preextract" | base64 -d > "\$prescript"
|
||||
chmod a+x "\$prescript"
|
||||
|
||||
(cd "\$tmpdir"; eval "\"\$prescript\" \$scriptargs \"\\\$@\""); res=\$?
|
||||
@@ -495,7 +488,7 @@ EOLSM
|
||||
echo "Pre-extraction script is not provided." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "\$preextract"
|
||||
echo "\$preextract" | base64 -d
|
||||
exit 0
|
||||
;;
|
||||
--confirm)
|
||||
|
@@ -313,9 +313,10 @@ do
|
||||
shift 2 || { MS_Usage; exit 1; }
|
||||
;;
|
||||
--preextract)
|
||||
PREEXTRACT_FILE="$2"
|
||||
preextract_file="$2"
|
||||
shift 2 || { MS_Usage; exit 1; }
|
||||
test -r "$PREEXTRACT_FILE" || { echo "Unable to open pre-extraction script: $PREEXTRACT_FILE" >&2; exit 1; }
|
||||
test -r "$preextract_file" || { echo "Unable to open pre-extraction script: $preextract_file" >&2; exit 1; }
|
||||
PREEXTRACT_ENCODED=`base64 "$preextract_file"`
|
||||
;;
|
||||
--cleanup)
|
||||
CLEANUP_SCRIPT="$2"
|
||||
|
Reference in New Issue
Block a user