Skip to content

Commit

Permalink
cache cli list-patches
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hc committed Dec 15, 2024
1 parent 6f14ee9 commit ce1dd09
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ semver_validate() {
[ ${#ac} = 0 ]
}
get_patch_last_supported_ver() {
local pkg_name=$1 inc_sel=$2 _exc_sel=$3 _exclusive=$4 # TODO: resolve using all of these
local list_patches=$1 pkg_name=$2 inc_sel=$3 _exc_sel=$4p _exclusive=$5 # TODO: resolve using all of these
local op
if [ "$inc_sel" ]; then
if ! op=$(java -jar "$rv_cli_jar" list-patches "$rv_patches_jar" -f "$pkg_name" -v -p 2>&1 | awk '{$1=$1}1'); then
if ! op=$(awk '{$1=$1}1' <<<"$list_patches"); then
epr "list-patches: '$op'"
return 1
fi
Expand Down Expand Up @@ -469,7 +469,7 @@ build_rv() {
fi
local get_latest_ver=false
if [ "$version_mode" = auto ]; then
if ! version=$(get_patch_last_supported_ver "$pkg_name" \
if ! version=$(get_patch_last_supported_ver "$pkg_name" "$list_patches" \
"${args[included_patches]}" "${args[excluded_patches]}" "${args[exclusive_patches]}"); then
exit 1
elif [ -z "$version" ]; then get_latest_ver=true; fi
Expand Down Expand Up @@ -519,17 +519,17 @@ build_rv() {
abort "apk signature mismatch '$stock_apk'"
fi
log "${table}: ${version}"
local list_patches
list_patches=$(java -jar "$rv_cli_jar" list-patches "$rv_patches_jar" -f "$pkg_name" -v -p 2>&1)

local microg_patch
microg_patch=$(java -jar "$rv_cli_jar" list-patches "$rv_patches_jar" -f "$pkg_name" -v -p 2>&1 |
grep "^Name: " | grep -i "gmscore\|microg" || :) microg_patch=${microg_patch#*: }
microg_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "gmscore\|microg" || :) microg_patch=${microg_patch#*: }
if [ -n "$microg_patch" ] && [[ ${p_patcher_args[*]} =~ $microg_patch ]]; then
epr "You cant include/exclude microg patch as that's done by rvmm builder automatically."
p_patcher_args=("${p_patcher_args[@]//-[ei] ${microg_patch}/}")
fi
local spoof_streams_patch
spoof_streams_patch=$(java -jar "$rv_cli_jar" list-patches "$rv_patches_jar" -f "$pkg_name" -v -p 2>&1 |
grep "^Name: " | grep -i "spoof" | grep -i "streams" || :) spoof_streams_patch=${spoof_streams_patch#*: }
spoof_streams_patch=$(grep "^Name: " <<<"$list_patches" | grep -i "spoof" | grep -i "streams" || :) spoof_streams_patch=${spoof_streams_patch#*: }
if [ -n "$spoof_streams_patch" ] && [[ ${p_patcher_args[*]} =~ $spoof_streams_patch ]]; then
epr "You cant include/exclude spoof stream patch as that's done by rvmm builder automatically."
p_patcher_args=("${p_patcher_args[@]//-[ei] ${spoof_streams_patch}/}")
Expand Down

0 comments on commit ce1dd09

Please sign in to comment.