forked from CastroFidel/PortWINE
Updated background_pid, added returns for clear prefix, reinstall and delete PP
This commit is contained in:
parent
27d18124c8
commit
27a3962ecc
@ -679,23 +679,27 @@ background_pid () {
|
||||
local arg1=$1 # --start или --end
|
||||
local arg2=$2 # Название команды
|
||||
local arg3=$3 # Номер процесса (1,2,3..)
|
||||
|
||||
if [[ "$START_FROM_STEAM" == 1 ]] \
|
||||
|| [[ -n "$PW_DEBUG" ]] ; then
|
||||
case $arg1 in
|
||||
--start) eval "$arg2" ;;
|
||||
--end) : ;;
|
||||
esac
|
||||
else
|
||||
get_bg_pid () {
|
||||
eval "echo \${$1}"
|
||||
}
|
||||
|
||||
if [[ "$arg1" == --start ]] ; then
|
||||
case $arg1 in
|
||||
--start)
|
||||
eval "$arg2 &"
|
||||
PID=$!
|
||||
export bg_pid"${arg3}"="$PID"
|
||||
elif [[ "$arg1" == --end ]] ; then
|
||||
export bg_pid"${arg3}"="$PID" ;;
|
||||
--end)
|
||||
PID=$(get_bg_pid bg_pid"${arg3}")
|
||||
[[ $PID == "" ]] && return 1
|
||||
while true ; do
|
||||
if [[ ! $(jobs -p) =~ $PID ]] ; then
|
||||
return 0
|
||||
fi
|
||||
sleep 0.005
|
||||
done
|
||||
wait "$PID" && return 0 ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
export -f background_pid
|
||||
@ -849,9 +853,7 @@ pw_reinstall_pp () {
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
elif ! yad_question "${translations[Do you really want to reinstall PortProton?\\nFor this, an internet connection will be required.]}"
|
||||
then exit 1
|
||||
fi
|
||||
elif yad_question "${translations[Do you really want to reinstall PortProton?\\nFor this, an internet connection will be required.]}" ; then
|
||||
pw_clear_pfx
|
||||
try_remove_dir "${PORT_WINE_PATH}/data/dist"
|
||||
create_new_dir "${PORT_WINE_PATH}/data/dist"
|
||||
@ -862,6 +864,7 @@ pw_reinstall_pp () {
|
||||
echo ""
|
||||
unset SKIP_CHECK_UPDATES
|
||||
print_info "Restarting PP for reinstall files..."
|
||||
fi
|
||||
restart_pp
|
||||
}
|
||||
|
||||
@ -5874,8 +5877,8 @@ gui_clear_pfx () {
|
||||
if yad_question "${translations[Do you want to clear prefix in PortProton?]}" ; then
|
||||
pw_clear_pfx
|
||||
print_info "Restarting PP after clearing prefix..."
|
||||
restart_pp
|
||||
fi
|
||||
restart_pp
|
||||
}
|
||||
export -f gui_clear_pfx
|
||||
|
||||
@ -5886,8 +5889,9 @@ gui_rm_portproton () {
|
||||
rm -fr "${HOME}/PortWINE"
|
||||
rm -f "$(grep -il PortProton "${HOME}/.local/share/applications"/*.desktop)"
|
||||
update-desktop-database -q "${HOME}/.local/share/applications"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
restart_pp
|
||||
}
|
||||
export -f gui_rm_portproton
|
||||
|
||||
@ -5988,6 +5992,7 @@ export -f change_gui_start
|
||||
gui_wine_uninstaller () {
|
||||
start_portwine
|
||||
pw_run uninstaller
|
||||
stop_portwine --restart
|
||||
}
|
||||
export -f gui_wine_uninstaller
|
||||
|
||||
|
@ -257,12 +257,8 @@ if [[ "${SKIP_CHECK_UPDATES}" != 1 ]] ; then
|
||||
PW_FILESYSTEM=$(stat -f -c %T "${PORT_WINE_PATH}")
|
||||
export PW_FILESYSTEM
|
||||
|
||||
if [[ "$START_FROM_STEAM" == 1 ]] ; then
|
||||
pw_get_tmp_files
|
||||
else
|
||||
background_pid --start "pw_get_tmp_files" "1"
|
||||
fi
|
||||
fi
|
||||
|
||||
# create lock file
|
||||
if ! check_flatpak ; then
|
||||
@ -802,7 +798,7 @@ fi
|
||||
|
||||
[[ -n "$PW_YAD_SET" ]] && case "$PW_YAD_SET" in
|
||||
gui_pw_reinstall_pp|open_changelog|\
|
||||
128|gui_pw_update|\
|
||||
128|gui_pw_update|gui_rm_portproton|\
|
||||
change_loc|gui_open_scripts_from_backup|\
|
||||
gui_credits|pw_start_cont_xterm)
|
||||
if [[ -z "${PW_ALL_DF}" ]] ; then
|
||||
@ -814,7 +810,7 @@ fi
|
||||
gui_proton_downloader|WINETRICKS|\
|
||||
116|pw_create_prefix_backup|\
|
||||
gui_clear_pfx|WINEREG|WINECMD|\
|
||||
WINEFILE|WINECFG)
|
||||
WINEFILE|WINECFG|gui_wine_uninstaller)
|
||||
if [[ -z "${PW_ALL_DF}" ]] ; then
|
||||
export TAB_MAIN_MENU="3"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user