mirror of
https://github.com/megastep/makeself.git
synced 2025-12-24 11:51:16 +08:00
Fix #349: pre-extraction script execution in combination with --notemp
- MS_Preextract uses basename of pre-extraction script to run it - New test case to verify the fix in test/preextracttest
This commit is contained in:
committed by
Stéphane Peter
parent
6a29bfb15a
commit
a9d64f31b9
@@ -327,7 +327,8 @@ MS_Preextract()
|
||||
echo "\$preextract" | base64 -d > "\$prescript"
|
||||
chmod a+x "\$prescript"
|
||||
|
||||
(cd "\$tmpdir"; eval "\"\$prescript\" \$scriptargs \"\\\$@\""); res=\$?
|
||||
prescript_basename=\$(basename "\$prescript")
|
||||
(cd "\$tmpdir"; eval "\"./\$prescript_basename\" \$scriptargs \"\\\$@\""); res=\$?
|
||||
|
||||
rm -f "\$prescript"
|
||||
if test \$res -ne 0; then
|
||||
|
||||
@@ -80,6 +80,18 @@ testPreextractArgs() {
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
testPreextractNotemp() {
|
||||
echo 'echo Validating pre-extraction script execution.' > preextract.sh
|
||||
${SUT} --notemp --nox11 --preextract preextract.sh src src_notemp.sh alabel ./startup.sh
|
||||
assertEquals 0 $?
|
||||
|
||||
./src_notemp.sh
|
||||
assertEquals 0 $?
|
||||
|
||||
./src_notemp.sh | grep -qF 'Validating pre-extraction script execution.'
|
||||
assertEquals 0 $?
|
||||
}
|
||||
|
||||
testPreextractEnvPassing() {
|
||||
# imitate user input
|
||||
echo 'echo "export INSTALLATION_DIR=/usr/bin" > preextract.env' > preextract.sh
|
||||
|
||||
Reference in New Issue
Block a user