mirror of
https://github.com/j-hc/revanced-magisk-module.git
synced 2025-05-02 15:44:31 +02:00
even better version selection
This commit is contained in:
parent
38f901a14f
commit
011198c7f3
2
build.sh
2
build.sh
@ -84,7 +84,7 @@ for table_name in $(toml_get_table_names); do
|
|||||||
app_args[dl_from]=apkmirror
|
app_args[dl_from]=apkmirror
|
||||||
} || app_args[apkmirror_dlurl]=""
|
} || app_args[apkmirror_dlurl]=""
|
||||||
if [ -z "${app_args[dl_from]:-}" ]; then
|
if [ -z "${app_args[dl_from]:-}" ]; then
|
||||||
abort "ERROR: no 'apkmirror_dlurl', 'uptodown_dlurl', 'apkmonk_dlurl' were set for '$table_name'."
|
abort "ERROR: no 'apkmirror_dlurl', 'uptodown_dlurl' or 'apkmonk_dlurl' option was set for '$table_name'."
|
||||||
fi
|
fi
|
||||||
app_args[arch]=$(toml_get "$t" arch) && {
|
app_args[arch]=$(toml_get "$t" arch) && {
|
||||||
if ! isoneof "${app_args[arch]}" all arm64-v8a arm-v7a; then
|
if ! isoneof "${app_args[arch]}" all arm64-v8a arm-v7a; then
|
||||||
|
25
utils.sh
25
utils.sh
@ -35,10 +35,13 @@ toml_get() {
|
|||||||
|
|
||||||
pr() { echo -e "\033[0;32m[+] ${1}\033[0m"; }
|
pr() { echo -e "\033[0;32m[+] ${1}\033[0m"; }
|
||||||
epr() {
|
epr() {
|
||||||
echo -e "\033[0;31m[-] ${1}\033[0m"
|
echo >&2 -e "\033[0;31m[-] ${1}\033[0m"
|
||||||
if [ "${GITHUB_REPOSITORY:-}" ]; then echo -e "::error::utils.sh [-] ${1}\n"; fi
|
if [ "${GITHUB_REPOSITORY:-}" ]; then echo -e "::error::utils.sh [-] ${1}\n"; fi
|
||||||
}
|
}
|
||||||
abort() { echo >&2 -e "\033[0;31mABORT: $1\033[0m" && exit 1; }
|
abort() {
|
||||||
|
epr "ABORT: ${1:-}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
get_prebuilts() {
|
get_prebuilts() {
|
||||||
pr "Getting prebuilts"
|
pr "Getting prebuilts"
|
||||||
@ -147,11 +150,16 @@ semver_validate() {
|
|||||||
[ ${#ac} = 0 ]
|
[ ${#ac} = 0 ]
|
||||||
}
|
}
|
||||||
get_patch_last_supported_ver() {
|
get_patch_last_supported_ver() {
|
||||||
local inc_sel exc_sel
|
local inc_sel exc_sel exclus_sel
|
||||||
inc_sel=$(list_args "$2" | sed 's/.*/\.name == "&"/; N;s/\n/ and /' || :)
|
inc_sel=$(list_args "$2" | sed 's/.*/\.name == "&"/' | sed 'N;s/\n/ or /' || :)
|
||||||
exc_sel=$(list_args "$3" | sed 's/.*/\.name != "&"/; N;s/\n/ and /' || :)
|
exc_sel=$(list_args "$3" | sed 's/.*/\.name != "&"/' | sed 'N;s/\n/ and /' || :)
|
||||||
|
if [ "$4" = false ]; then exclus_sel=".excluded==false"; else
|
||||||
|
exclus_sel="true"
|
||||||
|
inc_sel=${inc_sel:-false}
|
||||||
|
fi
|
||||||
jq -r ".[]
|
jq -r ".[]
|
||||||
| select(.compatiblePackages[].name==\"${1}\" and .excluded==false)
|
| select(.compatiblePackages[].name==\"${1}\")
|
||||||
|
| select(${exclus_sel})
|
||||||
| select(${inc_sel:-true})
|
| select(${inc_sel:-true})
|
||||||
| select(${exc_sel:-true})
|
| select(${exc_sel:-true})
|
||||||
| .compatiblePackages[].versions" "$RV_PATCHES_JSON" |
|
| .compatiblePackages[].versions" "$RV_PATCHES_JSON" |
|
||||||
@ -291,7 +299,10 @@ build_rv() {
|
|||||||
|
|
||||||
local get_latest_ver=false
|
local get_latest_ver=false
|
||||||
if [ "$version_mode" = auto ]; then
|
if [ "$version_mode" = auto ]; then
|
||||||
version=$(get_patch_last_supported_ver "$pkg_name" "${args[included_patches]}" "${args[excluded_patches]}") || get_latest_ver=true
|
version=$(
|
||||||
|
get_patch_last_supported_ver "$pkg_name" \
|
||||||
|
"${args[included_patches]}" "${args[excluded_patches]}" "${args[exclusive_patches]}"
|
||||||
|
) || get_latest_ver=true
|
||||||
elif isoneof "$version_mode" latest beta; then
|
elif isoneof "$version_mode" latest beta; then
|
||||||
get_latest_ver=true
|
get_latest_ver=true
|
||||||
p_patcher_args+=("--experimental")
|
p_patcher_args+=("--experimental")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user