forked from CastroFidel/winehelper
added wine/proton separation by prefix bit depth
This commit is contained in:
33
winehelper
33
winehelper
@@ -1574,7 +1574,7 @@ generate_wine_metadata () {
|
||||
# Формат: "ключ_json;репозиторий;расширение_файла;шаблон_исключения"
|
||||
local sources=(
|
||||
"proton_ge;GloriousEggroll/proton-ge-custom;\\.tar\\.gz$;github-action"
|
||||
"wine_kron4ek;Kron4ek/Wine-Builds;\\.tar\\.xz$;-x86"
|
||||
"wine_kron4ek;Kron4ek/Wine-Builds;\\.tar\\.xz$;"
|
||||
"proton_lg;Castro-Fidel/wine_builds;\\.tar\\.xz$;plugins"
|
||||
"proton_cachyos;CachyOS/proton-cachyos;\\.tar\\.xz$;znver"
|
||||
"proton_sarek;pythonlover02/Proton-Sarek;\\.tar\\.gz$;"
|
||||
@@ -1638,13 +1638,40 @@ select_wine_version() {
|
||||
WINE_METADATA_FILE="$WH_TMP_DIR/wine_metadata.json"
|
||||
[[ ! -f "$WINE_METADATA_FILE" ]] && fatal "Файл метаданных WINE не найден."
|
||||
|
||||
local jq_filter
|
||||
if [[ "$WINEARCH" == "win64" ]]; then
|
||||
print_info "Фильтруем версии для 64-битного префикса..."
|
||||
# Для 64-битных префиксов показываем сборки с 'amd64', 'x86_64', 'wow64'
|
||||
# или те, у которых нет явного указания на 32-битную архитектуру.
|
||||
jq_filter='
|
||||
.[] | .[] |
|
||||
select(
|
||||
(.name | test("amd64|x86_64|wow64")) or
|
||||
(.name | test("i[3-6]86|x86(?!_64)") | not)
|
||||
) | .name
|
||||
'
|
||||
else # win32
|
||||
print_info "Фильтруем версии для 32-битного префикса..."
|
||||
# Для 32-битных префиксов показываем только сборки с явным указанием 32-битной архитектуры.
|
||||
jq_filter='
|
||||
.[] | .[] |
|
||||
select(.name | test("i[3-6]86|x86(?!_64)")) | .name
|
||||
'
|
||||
fi
|
||||
|
||||
# Создание единого, отсортированного списка версий
|
||||
local versions=()
|
||||
mapfile -t versions < <(jq -r '.[] | .[] | .name' "$WINE_METADATA_FILE" | sort -V -r | uniq)
|
||||
mapfile -t versions < <(jq -r "$jq_filter" "$WINE_METADATA_FILE" | sort -V -r | uniq)
|
||||
|
||||
if [[ ${#versions[@]} -eq 0 ]]; then
|
||||
print_warning "Не найдено подходящих версий WINE/Proton для архитектуры $WINEARCH."
|
||||
print_warning "Будет использована версия по умолчанию: $WH_WINE_USE"
|
||||
return
|
||||
fi
|
||||
|
||||
local options=("system" "${versions[@]}")
|
||||
|
||||
print_info "Выберите версию WINE/Proton:"
|
||||
print_info "Выберите версию WINE/Proton для $WINEARCH префикса:"
|
||||
PS3="Ваш выбор: "
|
||||
select opt in "Отмена" "${options[@]}"; do
|
||||
if [[ "$REPLY" == "1" ]] || [[ "$opt" == "Отмена" ]]; then
|
||||
|
Reference in New Issue
Block a user