Skip to content

Commit 2247ded

Browse files
committed
utils: Fix temporary paths
* By default Morphe CLI uses a hardcoded temporary directory 'morphe-temporary-files/patcher/' which isn't namespaced per job. This affected the building process when parallel-jobs was set to something superior than 1. Set an unique temp path derived from the APK filename to fix this issue. Signed-off-by: peternmuller <pm563838@gmail.com>
1 parent 41d8e0a commit 2247ded

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

utils.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ wpr() {
4747
}
4848
abort() {
4949
epr "ABORT: ${1-}"
50-
rm -rf ./${TEMP_DIR}/*tmp.* ./${TEMP_DIR}/*/*tmp.* ./${TEMP_DIR}/*-temporary-files ./*-temporary-files
50+
rm -rf ./${TEMP_DIR}/*tmp.* ./${TEMP_DIR}/*/*tmp.* ./${TEMP_DIR}/*-temporary-files ./${TEMP_DIR}/*.apk-temporary-files ./*-temporary-files
5151
trap - SIGTERM SIGINT EXIT
5252
kill -- -$$ 2>/dev/null
5353
exit 1
@@ -543,7 +543,8 @@ get_direct_resp() { __DIRECT_APKNAME__=$(awk -F/ '{print $NF}' <<<"$1"); }
543543

544544
patch_apk() {
545545
local stock_input=$1 patched_apk=$2 patcher_args=$3 cli_jar=$4 patches_jar=$5
546-
local cmd="java -jar '$cli_jar' patch '$stock_input' --purge -o '$patched_apk' -p '$patches_jar' --keystore=ks.keystore \
546+
local tmp_dir="${CWD}/${patched_apk}-temporary-files"
547+
local cmd="java -jar '$cli_jar' patch '$stock_input' --purge -t '$tmp_dir' -o '$patched_apk' -p '$patches_jar' --keystore=ks.keystore \
547548
--keystore-entry-password=123456789 --keystore-password=123456789 --signer=jhc --keystore-entry-alias=jhc $patcher_args"
548549

549550
# TODO: remove this later

0 commit comments

Comments
 (0)