Skip to content

Commit

Permalink
update error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hc committed Oct 5, 2024
1 parent 45bf672 commit f25b6c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ java --version >/dev/null || abort "\`openjdk 17\` is not installed. install it
zip --version >/dev/null || abort "\`zip\` is not installed. install it with 'apt install zip' or equivalent"
# ----------------
rm -rf revanced-magisk/bin/*/tmp.*
: >"$TEMP_DIR"/*-rv/changelog.md || :
if [ "$(echo "$TEMP_DIR"/*-rv/changelog.md)" ]; then
: >"$TEMP_DIR"/*-rv/changelog.md || :
fi

get_prebuilts

Expand Down
11 changes: 7 additions & 4 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ get_rv_prebuilts() {
if [ "$tag" = "Integrations" ]; then integs_file=$file; fi
echo "$tag: $(cut -d/ -f1 <<<"$src")/${name} " >>"${cl_dir}/changelog.md"
else
local for_err=$file
if [ "$ver" = "latest" ]; then
file=$(grep -v dev <<<"$file" | head -1)
else file=$(grep "${ver#v}" <<<"$file" | head -1); fi
if [ -z "$file" ]; then abort "filter fail: '$for_err' with '$ver'"; fi
name=$(basename "$file")
tag_name=$(cut -d'-' -f3- <<<"$name")
tag_name=v${tag_name%.*}
if [ "$tag_name" = "v" ]; then abort "wrong ver"; fi
fi

echo -n "$file "
Expand Down Expand Up @@ -543,9 +544,11 @@ build_rv() {
fi
fi
fi
if ! patch_apk "$stock_apk" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then
epr "Building '${table}' failed!"
return 0
if [ "${NORB:-}" != true ] || [ ! -f "$patched_apk" ]; then
if ! patch_apk "$stock_apk" "$patched_apk" "${patcher_args[*]}" "${args[cli]}" "${args[ptjar]}"; then
epr "Building '${table}' failed!"
return 0
fi
fi
if [ "$build_mode" = apk ]; then
local apk_output="${BUILD_DIR}/${app_name_l}-${rv_brand_f}-v${version_f}-${arch_f}.apk"
Expand Down

0 comments on commit f25b6c8

Please sign in to comment.