From 2210356fec600cfa3dbb6f77391b6e8c8cf84d41 Mon Sep 17 00:00:00 2001 From: Mikhail Tergoev Date: Thu, 11 Jul 2024 21:25:35 +0300 Subject: [PATCH] fixed PW_NO_RESTART_PPDB --- data_from_portwine/scripts/functions_helper | 23 +++++++++++++++---- .../scripts/pw_autoinstall/PW_WOSB | 2 +- data_from_portwine/scripts/start.sh | 15 ++++++------ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index 05dade0f..ac8502dc 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -1275,13 +1275,17 @@ pw_init_db () { elif [[ $(echo "$PW_FIND_DB_FILE" | wc -l) -eq 1 ]] ; then PORTWINE_DB_FILE="${PW_FIND_DB_FILE}" fi + IFS="$orig_IFS" - if [[ -f "${PW_FIND_DB_FILE}" ]] && [[ -z $(grep "^export PW_DISABLED_CREATE_DB=1" "${PW_FIND_DB_FILE}") ]] ; then + if [[ -f "${PW_FIND_DB_FILE}" ]] \ + && [[ "${PW_DISABLED_CREATE_DB}" != 1 ]] \ + && [[ -z $(grep "^export PW_DISABLED_CREATE_DB=1" "${PW_FIND_DB_FILE}") ]] + then try_copy_file "${PW_FIND_DB_FILE}" "${portwine_exe}".ppdb PORTWINE_DB_FILE="${portwine_exe}".ppdb fi - if [[ ! -z $(echo "${portwine_exe}" | grep "/data/prefixes/") ]] && \ - [[ -z $(echo "${portwine_exe}" | grep "/data/prefixes/DEFAULT/") ]] + if [[ ! -z $(echo "${portwine_exe}" | grep "/data/prefixes/") ]] \ + && [[ -z $(echo "${portwine_exe}" | grep "/data/prefixes/DEFAULT/") ]] then PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}') fi @@ -1464,6 +1468,10 @@ update_winetricks () { } edit_db_from_gui () { + if [[ "${PW_DISABLED_CREATE_DB}" == 1 ]] ; then + print_warning "Skipped edit_db_from_gui" + return 0 + fi print_info "edit_db_from_gui PORTWINE_DB_FILE=$PORTWINE_DB_FILE" if [[ ! -z "$PORTWINE_DB_FILE" ]] \ && [[ -f "$PORTWINE_DB_FILE" ]] @@ -1501,7 +1509,9 @@ edit_user_conf_from_gui () { } pw_create_gui_png () { - if [[ -z "$PORTPROTON_NAME" ]] ; then + if [[ -z "$PORTPROTON_NAME" ]] \ + || [[ "$PW_NO_RESTART_PPDB" == "1" ]] + then if [[ ! -z "${PORTWINE_CREATE_SHORTCUT_NAME}" ]] ; then PORTPROTON_NAME="${PORTWINE_CREATE_SHORTCUT_NAME}" else @@ -4401,6 +4411,9 @@ portwine_create_shortcut () { [[ ! -e ${portwine_exe} ]] && return 1 pw_create_gui_png +print_error "portwine_exe: $portwine_exe" +print_error "PORTPROTON_NAME: ${PORTPROTON_NAME}" + if [[ "$1" == "block_name" ]] ; then export name_desktop="${PORTPROTON_NAME}" OUTPUT=$("${pw_yad}" --title="$(gettext "Choices")" --form \ @@ -4513,7 +4526,7 @@ portwine_create_shortcut () { unset PW_SKIP_RESTART_STEAM fi - if [[ "$PW_NO_RESTART" != "1" ]] ; then + if [[ "$PW_NO_RESTART_PPDB" != "1" ]] ; then print_info "Restarting PP..." export SKIP_CHECK_UPDATES=1 /usr/bin/env bash -c ${pw_full_command_line[*]} & diff --git a/data_from_portwine/scripts/pw_autoinstall/PW_WOSB b/data_from_portwine/scripts/pw_autoinstall/PW_WOSB index d22660e2..0fe8c661 100755 --- a/data_from_portwine/scripts/pw_autoinstall/PW_WOSB +++ b/data_from_portwine/scripts/pw_autoinstall/PW_WOSB @@ -20,7 +20,7 @@ then portwine_exe="$WINEPREFIX/drive_c/WoSB/launcher.exe" pw_stop_progress_bar - export PW_NO_RESTART="1" + export PW_NO_RESTART_PPDB="1" if [[ "$LANGUAGE" == "ru" ]] ; then export PORTWINE_CREATE_SHORTCUT_NAME="World of Sea Battle RU" pw_create_unique_exe "wosb_launcher_ru" diff --git a/data_from_portwine/scripts/start.sh b/data_from_portwine/scripts/start.sh index 6de03372..94b18fdf 100755 --- a/data_from_portwine/scripts/start.sh +++ b/data_from_portwine/scripts/start.sh @@ -27,7 +27,11 @@ export pw_full_command_line=("$0" $*) MISSING_DESKTOP_FILE=0 -if [[ -f "$1" ]] ; then +if [[ "$1" == *.ppack ]] ; then + export PW_NO_RESTART_PPDB="1" + export PW_DISABLED_CREATE_DB="1" + portwine_exe="$1" +elif [[ -f "$1" ]] ; then portwine_exe="$(realpath "$1")" elif [[ -f "$OLDPWD/$1" ]] && [[ "$1" == *.exe ]] ; then portwine_exe="$(realpath "$OLDPWD/$1")" @@ -72,7 +76,7 @@ else fi unset MANGOHUD MANGOHUD_DLSYM PW_NO_ESYNC PW_NO_FSYNC PW_VULKAN_USE WINEDLLOVERRIDES PW_NO_WRITE_WATCH PW_YAD_SET PW_ICON_FOR_YAD -unset PW_CHECK_AUTOINSTALL PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS PORTWINE_DB PORTWINE_DB_FILE PW_DISABLED_CREATE_DB RADV_PERFTEST +unset PW_CHECK_AUTOINSTALL PW_VKBASALT_EFFECTS PW_VKBASALT_FFX_CAS PORTWINE_DB PORTWINE_DB_FILE RADV_PERFTEST unset CHK_SYMLINK_FILE PW_MESA_GL_VERSION_OVERRIDE PW_VKD3D_FEATURE_LEVEL PATH_TO_GAME PW_START_DEBUG PORTPROTON_NAME PW_PATH unset PW_PREFIX_NAME WINEPREFIX VULKAN_MOD PW_WINE_VER PW_ADD_TO_ARGS_IN_RUNTIME PW_GAMEMODERUN_SLR AMD_VULKAN_ICD PW_WINE_CPU_TOPOLOGY unset PW_NAME_D_NAME PW_NAME_D_ICON PW_NAME_D_EXEC PW_EXEC_FROM_DESKTOP PW_ALL_DF PW_GENERATE_BUTTONS PW_NAME_D_ICON PW_NAME_D_ICON_48 @@ -324,9 +328,8 @@ EOF if [[ -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/.create_shortcut" ]] ; then while IFS= read -r line do - export PW_NO_RESTART="1" export portwine_exe="$PORT_WINE_PATH/data/prefixes/$PW_PREFIX_NAME/$line" - portwine_create_shortcut "$PORT_WINE_PATH/data/prefixes/$PW_PREFIX_NAME/$line" + portwine_create_shortcut done < "$PORT_WINE_PATH/data/prefixes/$PW_PREFIX_NAME/.create_shortcut" fi yad_info "$(gettext "Unpack is DONE for prefix:") \"${PW_PREFIX_NAME}\"." @@ -721,9 +724,7 @@ case "${VULKAN_MOD}" in esac init_wine_ver -if [[ -f "${PORTWINE_DB_FILE}" ]] \ -&& [[ "${PW_DISABLED_CREATE_DB}" != 1 ]] -then +if [[ -f "${PORTWINE_DB_FILE}" ]] ; then edit_db_from_gui PW_VULKAN_USE PW_WINE_USE PW_PREFIX_NAME fi