2
2
set -e
3
3
4
4
ROOTDIR=dist
5
- BUNDLE=${ROOTDIR} /Bitcoin- Core.app
5
+ BUNDLE=" ${ROOTDIR} /Bitcoin Core.app"
6
6
CODESIGN=codesign
7
7
TEMPDIR=sign.temp
8
8
TEMPLIST=${TEMPDIR} /signatures.txt
@@ -19,19 +19,19 @@ mkdir -p ${TEMPDIR}
19
19
20
20
${CODESIGN} -f --file-list ${TEMPLIST} " $@ " " ${BUNDLE} "
21
21
22
- for i in ` grep -v CodeResources ${TEMPLIST} ` ; do
23
- TARGETFILE=" ${BUNDLE} /` echo ${i} | sed " s|.*${BUNDLE} /||" ` "
24
- SIZE=` pagestuff $i -p | tail -2 | grep size | sed ' s/[^0-9]*//g' `
25
- OFFSET=` pagestuff $i -p | tail -2 | grep offset | sed ' s/[^0-9]*//g' `
22
+ grep -v CodeResources < " ${TEMPLIST} " | while read i ; do
23
+ TARGETFILE=" ${BUNDLE} /` echo " ${i} " | sed " s|.*${BUNDLE} /||" ` "
24
+ SIZE=` pagestuff " $i " -p | tail -2 | grep size | sed ' s/[^0-9]*//g' `
25
+ OFFSET=` pagestuff " $i " -p | tail -2 | grep offset | sed ' s/[^0-9]*//g' `
26
26
SIGNFILE=" ${TEMPDIR} /${TARGETFILE} .sign"
27
- DIRNAME=" ` dirname ${SIGNFILE} ` "
27
+ DIRNAME=" ` dirname " ${SIGNFILE} " ` "
28
28
mkdir -p " ${DIRNAME} "
29
29
echo " Adding detached signature for: ${TARGETFILE} . Size: ${SIZE} . Offset: ${OFFSET} "
30
- dd if=$i of=${SIGNFILE} bs=1 skip=${OFFSET} count=${SIZE} 2> /dev/null
30
+ dd if=" $i " of=" ${SIGNFILE} " bs=1 skip=${OFFSET} count=${SIZE} 2> /dev/null
31
31
done
32
32
33
- for i in ` grep CodeResources ${TEMPLIST} ` ; do
34
- TARGETFILE=" ${BUNDLE} /` echo ${i} | sed " s|.*${BUNDLE} /||" ` "
33
+ grep CodeResources < " ${TEMPLIST} " | while read i ; do
34
+ TARGETFILE=" ${BUNDLE} /` echo " ${i} " | sed " s|.*${BUNDLE} /||" ` "
35
35
RESOURCE=" ${TEMPDIR} /${TARGETFILE} "
36
36
DIRNAME=" ` dirname " ${RESOURCE} " ` "
37
37
mkdir -p " ${DIRNAME} "
41
41
42
42
rm ${TEMPLIST}
43
43
44
- tar -C ${TEMPDIR} -czf ${OUT} .
45
- rm -rf ${TEMPDIR}
44
+ tar -C " ${TEMPDIR} " -czf " ${OUT} " .
45
+ rm -rf " ${TEMPDIR} "
46
46
echo " Created ${OUT} "
0 commit comments