Merge branch 'Htylol-improve_updates' into devel
This commit is contained in:
commit
129d71e608
@ -22,11 +22,10 @@ print_wrapped () {
|
|||||||
local text="$1"
|
local text="$1"
|
||||||
local a="0"
|
local a="0"
|
||||||
local b="$2"
|
local b="$2"
|
||||||
local c="$3"
|
|
||||||
|
|
||||||
if [[ -n "$c" ]] ; then
|
if [[ -n "$3" ]] ; then
|
||||||
if (( ${#text} > b )); then
|
if (( ${#text} > b )); then
|
||||||
echo "${text:a:b}${c}"
|
echo "${text:a:b}${3}"
|
||||||
else
|
else
|
||||||
echo "$text"
|
echo "$text"
|
||||||
fi
|
fi
|
||||||
@ -1702,7 +1701,6 @@ pw_port_update () {
|
|||||||
if [[ ! -f "${PORT_WINE_TMP_PATH}/scripts_ver" ]] ; then
|
if [[ ! -f "${PORT_WINE_TMP_PATH}/scripts_ver" ]] ; then
|
||||||
echo "2024" > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
echo "2024" > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
||||||
fi
|
fi
|
||||||
scripts_install_ver=$(<"${PORT_WINE_TMP_PATH}/scripts_ver")
|
|
||||||
|
|
||||||
URL_ETERFUND="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine/scripts/var"
|
URL_ETERFUND="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine/scripts/var"
|
||||||
URL_GITHUB="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine/scripts/var"
|
URL_GITHUB="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine/scripts/var"
|
||||||
@ -1752,8 +1750,12 @@ pw_port_update () {
|
|||||||
echo "$UPDATE_DAYS $UPDATE_MINUTES UPDATE_GITHUB $UPDATE_MINUTES" > "${PORT_WINE_TMP_PATH}/update_skip_mirror"
|
echo "$UPDATE_DAYS $UPDATE_MINUTES UPDATE_GITHUB $UPDATE_MINUTES" > "${PORT_WINE_TMP_PATH}/update_skip_mirror"
|
||||||
UPDATE_URL_MIRROR="UPDATE_GITHUB"
|
UPDATE_URL_MIRROR="UPDATE_GITHUB"
|
||||||
fi
|
fi
|
||||||
|
PW_FORCE_UPDATE="1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[ ! -f "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ]] && echo "1" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||||
|
scripts_update_not=$(<"${PORT_WINE_TMP_PATH}/scripts_update_notifier")
|
||||||
|
|
||||||
if [[ ! -f "${PORT_WINE_TMP_PATH}/update_skip_mirror" ]] ; then
|
if [[ ! -f "${PORT_WINE_TMP_PATH}/update_skip_mirror" ]] ; then
|
||||||
pw_check_update
|
pw_check_update
|
||||||
else
|
else
|
||||||
@ -1763,16 +1765,27 @@ pw_port_update () {
|
|||||||
UPDATE_SKIP_DATE="$(echo "${CHECK_UPDATE_MIRROR}" | awk -F" " '{print $4}')"
|
UPDATE_SKIP_DATE="$(echo "${CHECK_UPDATE_MIRROR}" | awk -F" " '{print $4}')"
|
||||||
UPDATE_DAYS=$(date +%-j)
|
UPDATE_DAYS=$(date +%-j)
|
||||||
UPDATE_MINUTES=$(($(date +%-H) * 60 + $(date +%-M)))
|
UPDATE_MINUTES=$(($(date +%-H) * 60 + $(date +%-M)))
|
||||||
if (( $((UPDATE_DATE_MIRROR + 360)) <= UPDATE_MINUTES )) \
|
if [[ "${scripts_update_not}" != "0" ]] ; then
|
||||||
|| [[ "$UPDATE_SKIP_DAYS" != "$UPDATE_DAYS" ]] \
|
if (( $((UPDATE_DATE_MIRROR + 360)) <= UPDATE_MINUTES )) \
|
||||||
|| [[ "$PW_FORCE_UPDATE" == "1" ]]
|
|| [[ "$UPDATE_SKIP_DAYS" != "$UPDATE_DAYS" ]] \
|
||||||
then
|
|| [[ "$PW_FORCE_UPDATE" == "1" ]] ; then
|
||||||
pw_check_update
|
pw_check_update
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ "$UPDATE_SKIP_DAYS" != "$UPDATE_DAYS" ]] ; then
|
||||||
|
pw_check_update
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $((UPDATE_SKIP_DATE + $(((RANDOM%11)+25)) )) <= UPDATE_MINUTES )) \
|
if (( $((UPDATE_SKIP_DATE + $(((RANDOM%11)+25)) )) <= UPDATE_MINUTES )) \
|
||||||
|| [[ -n "$PW_UPDATE_ALL_LIST" ]] ; then
|
|| [[ "$PW_FORCE_UPDATE" == "1" ]] \
|
||||||
|
|| [[ "${scripts_update_not}" == "2" ]] ; then
|
||||||
|
if [[ "${scripts_update_not}" == "2" ]] ; then
|
||||||
|
echo "1" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||||
|
fi
|
||||||
print_info "Check update..."
|
print_info "Check update..."
|
||||||
echo ""
|
echo ""
|
||||||
if [[ -z "$UPDATE_URL_MIRROR" ]] ; then
|
if [[ -z "$UPDATE_URL_MIRROR" ]] ; then
|
||||||
@ -1781,33 +1794,42 @@ pw_port_update () {
|
|||||||
fi
|
fi
|
||||||
case "$UPDATE_URL_MIRROR" in
|
case "$UPDATE_URL_MIRROR" in
|
||||||
UPDATE_ETERFUND)
|
UPDATE_ETERFUND)
|
||||||
if [[ ! -f "${PORT_WINE_TMP_PATH}/curent_var_ver" ]] \
|
if [[ ! -f "${PORT_WINE_TMP_PATH}/curent_var_ver" ]] \
|
||||||
&& ! timeout 2 curl -f -s --list-only "$URL_ETERFUND" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
&& ! timeout 2 curl -f -s --list-only "$URL_ETERFUND" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
||||||
then
|
then
|
||||||
pw_check_update
|
pw_check_update
|
||||||
fi
|
fi
|
||||||
URL_FOR_CHANGELOG="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine"
|
URL_FOR_CHANGELOG="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine"
|
||||||
URL_TO_PW_BRANCH="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/-/archive/${BRANCH}/PortWINE-${BRANCH}.tar.gz"
|
URL_TO_PW_BRANCH="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/-/archive/${BRANCH}/PortWINE-${BRANCH}.tar.gz"
|
||||||
;;
|
;;
|
||||||
UPDATE_GITHUB)
|
UPDATE_GITHUB)
|
||||||
if [[ ! -f "${PORT_WINE_TMP_PATH}/curent_var_ver" ]] \
|
if [[ ! -f "${PORT_WINE_TMP_PATH}/curent_var_ver" ]] \
|
||||||
&& ! timeout 2 curl -f -s --list-only "$URL_GITHUB" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
&& ! timeout 2 curl -f -s --list-only "$URL_GITHUB" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
||||||
then
|
then
|
||||||
pw_check_update
|
pw_check_update
|
||||||
fi
|
fi
|
||||||
URL_FOR_CHANGELOG="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine"
|
URL_FOR_CHANGELOG="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine"
|
||||||
URL_TO_PW_BRANCH="https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/${BRANCH}.tar.gz"
|
URL_TO_PW_BRANCH="https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/${BRANCH}.tar.gz"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ "$LANGUAGE" == ru ]] && local PW_CHANGELOG_FILE="changelog_ru" || local PW_CHANGELOG_FILE="changelog_en"
|
scripts_current_ver=$(grep "$BRANCH_VERSION_UPDATE" "${PORT_WINE_TMP_PATH}/curent_var_ver" | awk -F "=" '{print $2}')
|
||||||
[[ ! -f "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ]] && echo "1" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
if [[ ! -f "${PORT_WINE_TMP_PATH}/update_remind_later" ]] ; then
|
||||||
read "scripts_update_not" < "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
echo "$scripts_current_ver" > "${PORT_WINE_TMP_PATH}/update_remind_later"
|
||||||
if [[ "${scripts_update_not}" == "1" ]] ; then
|
else
|
||||||
scripts_current_ver=$(grep "$BRANCH_VERSION_UPDATE" "${PORT_WINE_TMP_PATH}/curent_var_ver" | awk -F "=" '{print $2}')
|
PW_REMIND_LATER=$(<"${PORT_WINE_TMP_PATH}/update_remind_later")
|
||||||
|
if [[ $PW_REMIND_LATER != "$scripts_current_ver" ]] ; then
|
||||||
|
echo "2" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||||
|
echo "$scripts_current_ver" > "${PORT_WINE_TMP_PATH}/update_remind_later"
|
||||||
|
scripts_update_not=$(<"${PORT_WINE_TMP_PATH}/scripts_update_notifier")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${scripts_update_not}" == [12] ]] ; then
|
||||||
|
[[ "$LANGUAGE" == ru ]] && local PW_CHANGELOG_FILE="changelog_ru" || local PW_CHANGELOG_FILE="changelog_en"
|
||||||
print_info "Scripts version in git = ${scripts_current_ver}"
|
print_info "Scripts version in git = ${scripts_current_ver}"
|
||||||
print_info "Scripts version local = ${scripts_install_ver}"
|
print_info "Scripts version local = ${scripts_install_ver}"
|
||||||
if [[ -n "${scripts_current_ver}" ]] && [[ "${scripts_current_ver}" -gt "${scripts_install_ver}" ]] ; then
|
if [[ -n "${scripts_current_ver}" ]] && [[ "${scripts_current_ver}" -gt "${scripts_install_ver}" ]] ; then
|
||||||
@ -1834,8 +1856,10 @@ pw_port_update () {
|
|||||||
|
|
||||||
# --button="${translations[EXIT]}"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"":252 \
|
# --button="${translations[EXIT]}"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE.png"!"":252 \
|
||||||
|
|
||||||
case "${YAD_STATUS}" in
|
try_remove_file "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
||||||
1|252) exit 0 ;;
|
|
||||||
|
case ${YAD_STATUS} in
|
||||||
|
1|252) echo "2" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier" && exit 0 ;;
|
||||||
16) xcsd="${translations[DO NOT REMIND ME]}" ;;
|
16) xcsd="${translations[DO NOT REMIND ME]}" ;;
|
||||||
18) xcsd="${translations[REMIND ME LATER]}" ;;
|
18) xcsd="${translations[REMIND ME LATER]}" ;;
|
||||||
20) xcsd="${translations[UPDATING NOW]}" ;;
|
20) xcsd="${translations[UPDATING NOW]}" ;;
|
||||||
@ -1866,14 +1890,12 @@ pw_port_update () {
|
|||||||
yad_error_download && pw_port_update || exit 1
|
yad_error_download && pw_port_update || exit 1
|
||||||
fi ;;
|
fi ;;
|
||||||
"${translations[REMIND ME LATER]}")
|
"${translations[REMIND ME LATER]}")
|
||||||
echo " " ;;
|
echo "2" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ;;
|
||||||
"${translations[DO NOT REMIND ME]}")
|
"${translations[DO NOT REMIND ME]}")
|
||||||
echo "0" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ;;
|
echo "0" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
export scripts_install_ver
|
|
||||||
try_remove_file "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5764,6 +5786,7 @@ change_branch () {
|
|||||||
pw_notify_send -i info \
|
pw_notify_send -i info \
|
||||||
"${translations[Branch changed to:]}" "<b>DEVEL</b>"
|
"${translations[Branch changed to:]}" "<b>DEVEL</b>"
|
||||||
unset SKIP_CHECK_UPDATES
|
unset SKIP_CHECK_UPDATES
|
||||||
|
export PW_FORCE_UPDATE="1"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if yad_question "${translations[Do you actually want to change the scripts version to:]} <b>STABLE?</b>" ; then
|
if yad_question "${translations[Do you actually want to change the scripts version to:]} <b>STABLE?</b>" ; then
|
||||||
@ -5773,6 +5796,7 @@ change_branch () {
|
|||||||
pw_notify_send -i info \
|
pw_notify_send -i info \
|
||||||
"${translations[Branch changed to:]}" "<b>STABLE</b>"
|
"${translations[Branch changed to:]}" "<b>STABLE</b>"
|
||||||
unset SKIP_CHECK_UPDATES
|
unset SKIP_CHECK_UPDATES
|
||||||
|
export PW_FORCE_UPDATE="1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
print_info "Restarting PP for change branch..."
|
print_info "Restarting PP for change branch..."
|
||||||
|
@ -169,7 +169,7 @@ export PW_WINELIB="${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}"
|
|||||||
try_remove_dir "${PW_WINELIB}/var"
|
try_remove_dir "${PW_WINELIB}/var"
|
||||||
install_ver="$(<"${PORT_WINE_TMP_PATH}/PortProton_ver")"
|
install_ver="$(<"${PORT_WINE_TMP_PATH}/PortProton_ver")"
|
||||||
export install_ver
|
export install_ver
|
||||||
scripts_install_ver=$(<"${PORT_WINE_TMP_PATH}/scripts_ver")
|
scripts_install_ver="$(<"${PORT_WINE_TMP_PATH}/scripts_ver")"
|
||||||
export scripts_install_ver
|
export scripts_install_ver
|
||||||
export WINETRICKS_DOWNLOADER="curl"
|
export WINETRICKS_DOWNLOADER="curl"
|
||||||
export USER_CONF="${PORT_WINE_PATH}/data/user.conf"
|
export USER_CONF="${PORT_WINE_PATH}/data/user.conf"
|
||||||
|
Loading…
Reference in New Issue
Block a user