@@ -23,7 +23,7 @@ script="$SCRIPT"
23
23
scriptargs="$SCRIPTARGS "
24
24
cleanup_script="${CLEANUP_SCRIPT} "
25
25
licensetxt="$LICENSE "
26
- helpheader=' $ HELPHEADER'
26
+ helpheader=" ${ HELPHEADER} "
27
27
targetdir="$archdirname "
28
28
filesizes="$filesizes "
29
29
totalsize="$totalsize "
@@ -92,7 +92,7 @@ MS_PrintLicense()
92
92
MS_diskspace()
93
93
{
94
94
(
95
- df -kP "\$ 1" | tail -1 | awk '{ if (\$ 4 ~ /%/) {print \$ 3} else {print \$ 4} }'
95
+ df -k "\$ 1" | tail -1 | awk '{ if (\$ 4 ~ /%/) {print \$ 3} else {print \$ 4} }'
96
96
)
97
97
}
98
98
@@ -127,7 +127,7 @@ MS_dd_Progress()
127
127
blocks=\` expr \$ length / \$ bsize\`
128
128
bytes=\` expr \$ length % \$ bsize\`
129
129
(
130
- dd ibs=\$ offset skip=1 count=0 2>/dev/null
130
+ dd ibs=\$ offset skip=1 count=1 2>/dev/null
131
131
pos=\` expr \$ pos \+ \$ bsize\`
132
132
MS_Printf " 0%% " 1>&2
133
133
if test \$ blocks -gt 0; then
@@ -157,7 +157,7 @@ MS_dd_Progress()
157
157
MS_Help()
158
158
{
159
159
cat << EOH >&2
160
- \$ {helpheader} Makeself version $MS_VERSION
160
+ Makeself version $MS_VERSION
161
161
1) Getting help or info about \$ 0 :
162
162
\$ 0 --help Print this message
163
163
\$ 0 --info Print embedded info : title, default target directory, embedded script ...
@@ -190,7 +190,7 @@ MS_Help()
190
190
on the current terminal.
191
191
--cleanup-args args Arguments to the cleanup script. Wrap in quotes to provide
192
192
multiple arguments.
193
- -- Following arguments will be passed to the embedded script
193
+ -- Following arguments will be passed to the embedded script\$ {helpheader}
194
194
EOH
195
195
}
196
196
@@ -200,7 +200,7 @@ MS_Verify_Sig()
200
200
MKTEMP_PATH=\` exec <&- 2>&-; which mktemp || command -v mktemp || type mktemp\`
201
201
test -x "\$ GPG_PATH" || GPG_PATH=\` exec <&- 2>&-; which gpg || command -v gpg || type gpg\`
202
202
test -x "\$ MKTEMP_PATH" || MKTEMP_PATH=\` exec <&- 2>&-; which mktemp || command -v mktemp || type mktemp\`
203
- offset=\` head -n "\$ skip" "\$ 1" | wc -c | tr -d " "\`
203
+ offset=\` head -n "\$ skip" "\$ 1" | wc -c | sed "s/ //g "\`
204
204
temp_sig=\` mktemp -t XXXXX\`
205
205
echo \$ SIGNATURE | base64 --decode > "\$ temp_sig"
206
206
gpg_output=\` MS_dd "\$ 1" \$ offset \$ totalsize | LC_ALL=C "\$ GPG_PATH" --verify "\$ temp_sig" - 2>&1\`
@@ -235,8 +235,8 @@ MS_Check()
235
235
if test x"\$ quiet" = xn; then
236
236
MS_Printf "Verifying archive integrity..."
237
237
fi
238
- offset=\` head -n "\$ skip" "\$ 1" | wc -c | tr -d " "\`
239
- fsize=\` cat "\$ 1" | wc -c | tr -d " "\`
238
+ offset=\` head -n "\$ skip" "\$ 1" | wc -c | sed "s/ //g "\`
239
+ fsize=\` cat "\$ 1" | wc -c | sed "s/ //g "\`
240
240
if test \$ totalsize -ne \` expr \$ fsize - \$ offset\` ; then
241
241
echo " Unexpected archive size." >&2
242
242
exit 2
@@ -424,7 +424,7 @@ EOLSM
424
424
;;
425
425
--list)
426
426
echo Target directory: \$ targetdir
427
- offset=\` head -n "\$ skip" "\$ 0" | wc -c | tr -d " "\`
427
+ offset=\` head -n "\$ skip" "\$ 0" | wc -c | sed "s/ //g "\`
428
428
for s in \$ filesizes
429
429
do
430
430
MS_dd "\$ 0" \$ offset \$ s | MS_Decompress | UnTAR t
@@ -433,7 +433,7 @@ EOLSM
433
433
exit 0
434
434
;;
435
435
--tar)
436
- offset=\` head -n "\$ skip" "\$ 0" | wc -c | tr -d " "\`
436
+ offset=\` head -n "\$ skip" "\$ 0" | wc -c | sed "s/ //g "\`
437
437
arg1="\$ 2"
438
438
shift 2 || { MS_Help; exit 1; }
439
439
for s in \$ filesizes
@@ -556,6 +556,7 @@ copy)
556
556
cp "\$ 0" "\$ SCRIPT_COPY"
557
557
chmod +x "\$ SCRIPT_COPY"
558
558
cd "\$ TMPROOT"
559
+ export USER_PWD="\$ tmpdir"
559
560
exec "\$ SCRIPT_COPY" --phase2 -- \$ initargs
560
561
;;
561
562
phase2)
@@ -564,7 +565,7 @@ phase2)
564
565
esac
565
566
566
567
if test x"\$ nox11" = xn; then
567
- if tty -s ; then # Do we have a terminal?
568
+ if test -t 1 ; then # Do we have a terminal on stdout ?
568
569
:
569
570
else
570
571
if test x"\$ DISPLAY" != x -a x"\$ xterm_loop" = x; then # No, but do we have X?
@@ -576,7 +577,7 @@ if test x"\$nox11" = xn; then
576
577
break
577
578
fi
578
579
done
579
- chmod a+x \$ 0 || echo Please add execution rights on \$ 0
580
+ chmod a+x \$ 0 || echo Please add execution rights on \$ 0 >&2
580
581
if test \` echo "\$ 0" | cut -c1\` = "/"; then # Spawn a terminal!
581
582
exec \$ XTERM -e "\$ 0 --xwin \$ initargs"
582
583
else
@@ -616,7 +617,7 @@ location="\`pwd\`"
616
617
if test x"\$ SETUP_NOCHECK" != x1; then
617
618
MS_Check "\$ 0"
618
619
fi
619
- offset=\` head -n "\$ skip" "\$ 0" | wc -c | tr -d " "\`
620
+ offset=\` head -n "\$ skip" "\$ 0" | wc -c | sed "s/ //g "\`
620
621
621
622
if test x"\$ verbose" = xy; then
622
623
MS_Printf "About to extract $USIZE KB in \$ tmpdir ... Proceed ? [Y/n] "
0 commit comments