Compare commits

..

6 Commits

Author SHA1 Message Date
the-sane
0d90486527 String formatting 2022-11-06 18:01:26 -05:00
the-sane
2c6217da60 Only display directories for installed lutrises 2022-11-06 17:57:17 -05:00
the-sane
1c58b24ed6 Not an array 2022-11-06 17:52:03 -05:00
the-sane
c04b4ca2c2 Handle unknown case 2022-11-06 17:32:40 -05:00
the-sane
6899d3d94b Fix glibc check for flatpak lutris 2022-11-06 17:10:29 -05:00
the-sane
1ef7e0658d Fix message when glibc is not installed 2022-11-06 13:44:18 -05:00

View File

@ -1283,14 +1283,66 @@ download_select_install() {
# For runners, check GlibC version against runner requirements
if [ "$download_type" = "runner" ] && ( [ "$contributor_name" = "/dev/null" ] || [ "$contributor_name" = "TKG" ] ); then
unset glibc_fail
required_glibc="2.33"
system_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
# Sort the versions and check if the installed glibc is smaller
if [ "$required_glibc" != "$system_glibc" ] &&
[ "$system_glibc" = "$(printf "$system_glibc\n$required_glibc" | sort -V | head -n1)" ]; then
message warning "Your glibc version is incompatible with the selected runner.\n\nSystem glibc: v$system_glibc\nMinimum required glibc: v$required_glibc"
return 1
# Native lutris
if [ "$lutris_native" = "true" ]; then
if [ -x "$(command -v ldd)" ]; then
native_glibc="$(ldd --version | awk '/ldd/{print $NF}')"
else
native_glibc="0 (Not installed)"
fi
# Sort the versions and check if the installed glibc is smaller
if [ "$required_glibc" != "$native_glibc" ] &&
[ "$native_glibc" = "$(printf "$native_glibc\n$required_glibc" | sort -V | head -n1)" ]; then
glibc_fail+=("Native")
fi
fi
# Flatpak lutris
if [ "$lutris_flatpak" = "true" ]; then
flatpak_glibc="$(flatpak run --command="ldd" net.lutris.Lutris --version | awk '/ldd/{print $NF}')"
# Sort the versions and check if the installed glibc is smaller
if [ "$required_glibc" != "$flatpak_glibc" ] &&
[ "$flatpak_glibc" = "$(printf "$flatpak_glibc\n$required_glibc" | sort -V | head -n1)" ]; then
glibc_fail+=("Flatpak")
fi
fi
# Display a warning message
if [ -n "$glibc_fail" ]; then
unset glibc_message
# Prepare the warning message
for (( i=0; i<"${#glibc_fail[@]}"; i++ )); do
case "${glibc_fail[i]}" in
"Native")
glibc_message+="System glibc: $native_glibc\n"
;;
"Flatpak")
glibc_message+="Flatpak glibc: $flatpak_glibc\n"
;;
*)
debug_print exit "Script error: Unknown glibc_fail string in download_select_install() function. Aborting."
;;
esac
done
message warning "Your glibc version is incompatible with the selected runner\n\n${glibc_message}Minimum required glibc: $required_glibc"
# Return if all installed versions of lutris fail the check
if [ "$lutris_native" = "true" ] && [ "$lutris_flatpak" = "true" ]; then
# Both are installed
if [ "${#glibc_fail[@]}" -eq 2 ]; then
# Both failed the check
return 1
fi
else
# Only one is installed, but it failed the check
return 1
fi
fi
fi
@ -1714,48 +1766,51 @@ rm_dxvkcache() {
# Display all directories currently used by this helper and Star Citizen
display_dirs() {
unset dirs_list
dirs_list="\n"
lutris_detect
# Helper configs and keybinds
if [ -d "$conf_dir/$conf_subdir" ]; then
dirs_list+=("\n\nHelper configuration:\n$conf_dir/$conf_subdir\n\nKeybind backups:\n$conf_dir/$conf_subdir/keybinds")
dirs_list+="Helper configuration:\n$conf_dir/$conf_subdir\n\nKeybind backups:\n$conf_dir/$conf_subdir/keybinds\n\n"
fi
# Wine prefix
if [ -f "$conf_dir/$conf_subdir/$wine_conf" ]; then
dirs_list+="\n\nWine prefix:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")"
dirs_list+="Wine prefix:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")\n\n"
fi
# Star Citizen installation
if [ -f "$conf_dir/$conf_subdir/$game_conf" ]; then
dirs_list+="\n\nStar Citizen game directory:\n$(cat "$conf_dir/$conf_subdir/$game_conf")"
dirs_list+="Star Citizen game directory:\n$(cat "$conf_dir/$conf_subdir/$game_conf")\n\n"
fi
# Star Citizen shaders path
if [ -f "$conf_dir/$conf_subdir/$wine_conf" ]; then
dirs_list+="\n\nStar Citizen shaders:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")/$appdata_path"
dirs_list+="Star Citizen shaders:\n$(cat "$conf_dir/$conf_subdir/$wine_conf")/$appdata_path\n\n"
fi
# Lutris runners
if [ -d "$runners_dir_native" ] || [ -d "$runners_dir_flatpak" ]; then
dirs_list+="\n\nLutris Runners:"
if [ -d "$runners_dir_native" ]; then
dirs_list+="Lutris Runners:"
if [ -d "$runners_dir_native" ] && [ "$lutris_native" = "true" ]; then
dirs_list+="\n$runners_dir_native"
fi
if [ -d "$runners_dir_flatpak" ]; then
if [ -d "$runners_dir_flatpak" ] && [ "$lutris_flatpak" = "true" ]; then
dirs_list+="\n$runners_dir_flatpak"
fi
dirs_list+="\n\n"
fi
# Lutris dxvk
if [ -d "$dxvk_dir_native" ] || [ -d "$dxvk_dir_flatpak" ]; then
dirs_list+="\n\nLutris DXVK Versions:"
if [ -d "$dxvk_dir_native" ]; then
dirs_list+="Lutris DXVK Versions:"
if [ -d "$dxvk_dir_native" ] && [ "$lutris_native" = "true" ]; then
dirs_list+="\n$dxvk_dir_native"
fi
if [ -d "$dxvk_dir_flatpak" ]; then
if [ -d "$dxvk_dir_flatpak" ] && [ "$lutris_flatpak" = "true" ]; then
dirs_list+="\n$dxvk_dir_flatpak"
fi
dirs_list+="\n\n"
fi
# Format the info header
@ -1764,7 +1819,7 @@ display_dirs() {
message_heading="<b>$message_heading</b>"
fi
message info "$message_heading\n${dirs_list[@]}"
message info "$message_heading\n$dirs_list"
}
# Display the LUG Wiki