version selection bug

This commit is contained in:
j-hc 2023-03-18 13:25:49 +03:00
parent eda4f830f9
commit e00978c464
No known key found for this signature in database
GPG Key ID: FCBF5E9C57092AD9
2 changed files with 11 additions and 10 deletions

View File

@ -28,8 +28,12 @@ if [ "$ENABLE_MAGISK_UPDATE" = true ] && [ -z "${GITHUB_REPOSITORY:-}" ]; then
pr "You are building locally. Magisk updates will not be enabled."
ENABLE_MAGISK_UPDATE=false
fi
PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs) || PARALLEL_JOBS=1
BUILD_MINDETACH_MODULE=$(toml_get "$main_config_t" build-mindetach-module) || abort "ERROR: build-mindetach-module is missing"
if [ "$BUILD_MINDETACH_MODULE" = true ] && [ ! -f "mindetach-magisk/mindetach/detach.txt" ]; then
pr "mindetach module was not found."
BUILD_MINDETACH_MODULE=false
fi
PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs) || PARALLEL_JOBS=1
LOGGING_F=$(toml_get "$main_config_t" logging-to-file) && vtf "$LOGGING_F" "logging-to-file" || LOGGING_F=false
CONF_PATCHES_VER=$(toml_get "$main_config_t" patches-version) || CONF_PATCHES_VER=
CONF_INTEGRATIONS_VER=$(toml_get "$main_config_t" integrations-version) || CONF_INTEGRATIONS_VER=

View File

@ -150,17 +150,14 @@ semver_validate() {
[ ${#ac} = 0 ]
}
get_patch_last_supported_ver() {
local inc_sel exc_sel exclus_sel
inc_sel=$(list_args "$2" | sed 's/.*/\.name == "&"/' | sed 'N;s/\n/ or /' || :)
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
local inc_sel exc_sel
inc_sel=$(list_args "$2" | sed 's/.*/\.name == "&"/' | paste -sd '~' | sed 's/~/ or /g' || :)
exc_sel=$(list_args "$3" | sed 's/.*/\.name != "&"/' | paste -sd '~' | sed 's/~/ and /g' || :)
inc_sel=${inc_sel:-false}
if [ "$4" = false ]; then inc_sel="${inc_sel} or .excluded==false"; fi
jq -r ".[]
| select(.compatiblePackages[].name==\"${1}\")
| select(${exclus_sel})
| select(${inc_sel:-true})
| select(${inc_sel})
| select(${exc_sel:-true})
| .compatiblePackages[].versions" "$RV_PATCHES_JSON" |
tr -d ' ,\t[]"' | grep -v '^$' | sort | uniq -c | sort -nr | head -1 | xargs | cut -d' ' -f2 || return 1