Commit aa16081c authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'Htylol-new-update2' into devel

parents 754a8b80 b41a8707
...@@ -679,23 +679,27 @@ background_pid () { ...@@ -679,23 +679,27 @@ background_pid () {
local arg1=$1 # --start или --end local arg1=$1 # --start или --end
local arg2=$2 # Название команды local arg2=$2 # Название команды
local arg3=$3 # Номер процесса (1,2,3..) local arg3=$3 # Номер процесса (1,2,3..)
get_bg_pid () {
eval "echo \${$1}"
}
if [[ "$arg1" == --start ]] ; then if [[ "$START_FROM_STEAM" == 1 ]] \
eval "$arg2 &" || [[ -n "$PW_DEBUG" ]] ; then
PID=$! case $arg1 in
export bg_pid"${arg3}"="$PID" --start) eval "$arg2" ;;
elif [[ "$arg1" == --end ]] ; then --end) : ;;
PID=$(get_bg_pid bg_pid"${arg3}") esac
[[ $PID == "" ]] && return 1 else
while true ; do get_bg_pid () {
if [[ ! $(jobs -p) =~ $PID ]] ; then eval "echo \${$1}"
return 0 }
fi case $arg1 in
sleep 0.005 --start)
done eval "$arg2 &"
PID=$!
export bg_pid"${arg3}"="$PID" ;;
--end)
PID=$(get_bg_pid bg_pid"${arg3}")
[[ $PID == "" ]] && return 1
wait "$PID" && return 0 ;;
esac
fi fi
} }
export -f background_pid export -f background_pid
...@@ -849,19 +853,18 @@ pw_reinstall_pp () { ...@@ -849,19 +853,18 @@ pw_reinstall_pp () {
echo "" echo ""
exit 1 exit 1
fi fi
elif ! yad_question "${translations[Do you really want to reinstall PortProton?\\nFor this, an internet connection will be required.]}" elif yad_question "${translations[Do you really want to reinstall PortProton?\\nFor this, an internet connection will be required.]}" ; then
then exit 1 pw_clear_pfx
try_remove_dir "${PORT_WINE_PATH}/data/dist"
create_new_dir "${PORT_WINE_PATH}/data/dist"
try_remove_dir "${PORT_WINE_TMP_PATH}/VULKAN"
try_remove_file "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
try_remove_file "${PORT_WINE_PATH}/data/user.conf"
try_remove_file "${PORT_WINE_TMP_PATH}/scripts_ver"
echo ""
unset SKIP_CHECK_UPDATES
print_info "Restarting PP for reinstall files..."
fi fi
pw_clear_pfx
try_remove_dir "${PORT_WINE_PATH}/data/dist"
create_new_dir "${PORT_WINE_PATH}/data/dist"
try_remove_dir "${PORT_WINE_TMP_PATH}/VULKAN"
try_remove_file "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
try_remove_file "${PORT_WINE_PATH}/data/user.conf"
try_remove_file "${PORT_WINE_TMP_PATH}/scripts_ver"
echo ""
unset SKIP_CHECK_UPDATES
print_info "Restarting PP for reinstall files..."
restart_pp restart_pp
} }
...@@ -5874,8 +5877,8 @@ gui_clear_pfx () { ...@@ -5874,8 +5877,8 @@ gui_clear_pfx () {
if yad_question "${translations[Do you want to clear prefix in PortProton?]}" ; then if yad_question "${translations[Do you want to clear prefix in PortProton?]}" ; then
pw_clear_pfx pw_clear_pfx
print_info "Restarting PP after clearing prefix..." print_info "Restarting PP after clearing prefix..."
restart_pp
fi fi
restart_pp
} }
export -f gui_clear_pfx export -f gui_clear_pfx
...@@ -5886,8 +5889,9 @@ gui_rm_portproton () { ...@@ -5886,8 +5889,9 @@ gui_rm_portproton () {
rm -fr "${HOME}/PortWINE" rm -fr "${HOME}/PortWINE"
rm -f "$(grep -il PortProton "${HOME}/.local/share/applications"/*.desktop)" rm -f "$(grep -il PortProton "${HOME}/.local/share/applications"/*.desktop)"
update-desktop-database -q "${HOME}/.local/share/applications" update-desktop-database -q "${HOME}/.local/share/applications"
exit 0
fi fi
exit 0 restart_pp
} }
export -f gui_rm_portproton export -f gui_rm_portproton
...@@ -5988,6 +5992,7 @@ export -f change_gui_start ...@@ -5988,6 +5992,7 @@ export -f change_gui_start
gui_wine_uninstaller () { gui_wine_uninstaller () {
start_portwine start_portwine
pw_run uninstaller pw_run uninstaller
stop_portwine --restart
} }
export -f gui_wine_uninstaller export -f gui_wine_uninstaller
......
...@@ -258,11 +258,7 @@ if [[ "${SKIP_CHECK_UPDATES}" != 1 ]] ; then ...@@ -258,11 +258,7 @@ if [[ "${SKIP_CHECK_UPDATES}" != 1 ]] ; then
PW_FILESYSTEM=$(stat -f -c %T "${PORT_WINE_PATH}") PW_FILESYSTEM=$(stat -f -c %T "${PORT_WINE_PATH}")
export PW_FILESYSTEM export PW_FILESYSTEM
if [[ "$START_FROM_STEAM" == 1 ]] ; then background_pid --start "pw_get_tmp_files" "1"
pw_get_tmp_files
else
background_pid --start "pw_get_tmp_files" "1"
fi
fi fi
# create lock file # create lock file
...@@ -805,7 +801,7 @@ fi ...@@ -805,7 +801,7 @@ fi
[[ -n "$PW_YAD_SET" ]] && case "$PW_YAD_SET" in [[ -n "$PW_YAD_SET" ]] && case "$PW_YAD_SET" in
gui_pw_reinstall_pp|open_changelog|\ gui_pw_reinstall_pp|open_changelog|\
128|gui_pw_update|\ 128|gui_pw_update|gui_rm_portproton|\
change_loc|gui_open_scripts_from_backup|\ change_loc|gui_open_scripts_from_backup|\
gui_credits|pw_start_cont_xterm) gui_credits|pw_start_cont_xterm)
if [[ -z "${PW_ALL_DF}" ]] ; then if [[ -z "${PW_ALL_DF}" ]] ; then
...@@ -817,7 +813,7 @@ fi ...@@ -817,7 +813,7 @@ fi
gui_proton_downloader|WINETRICKS|\ gui_proton_downloader|WINETRICKS|\
116|pw_create_prefix_backup|\ 116|pw_create_prefix_backup|\
gui_clear_pfx|WINEREG|WINECMD|\ gui_clear_pfx|WINEREG|WINECMD|\
WINEFILE|WINECFG) WINEFILE|WINECFG|gui_wine_uninstaller)
if [[ -z "${PW_ALL_DF}" ]] ; then if [[ -z "${PW_ALL_DF}" ]] ; then
export TAB_MAIN_MENU="3" export TAB_MAIN_MENU="3"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment