added branches
This commit is contained in:
parent
013eab8e11
commit
e7b604109e
@ -1355,20 +1355,31 @@ pw_init_db () {
|
|||||||
|
|
||||||
# SCRIPTS UPDATE
|
# SCRIPTS UPDATE
|
||||||
pw_port_update () {
|
pw_port_update () {
|
||||||
|
case "$BRANCH" in
|
||||||
|
master|stable)
|
||||||
|
BRANCH_VERSION="SCRIPTS_STABLE_VERSION"
|
||||||
|
BRANCH="master"
|
||||||
|
;;
|
||||||
|
devel|beta)
|
||||||
|
BRANCH_VERSION="SCRIPTS_NEXT_VERSION"
|
||||||
|
BRANCH="devel"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
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=$(head -n 1 "${PORT_WINE_TMP_PATH}/scripts_ver")
|
scripts_install_ver=$(head -n 1 "${PORT_WINE_TMP_PATH}/scripts_ver")
|
||||||
print_info "Check update..."
|
print_info "Check update..."
|
||||||
if curl -f -s --list-only --connect-timeout 3 "https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/master/data_from_portwine/scripts/var" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
if curl -f -s --list-only --connect-timeout 3 "https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine/scripts/var" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
||||||
then
|
then
|
||||||
URL_FOR_CHANGELOG="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/master/data_from_portwine"
|
URL_FOR_CHANGELOG="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/raw/${BRANCH}/data_from_portwine"
|
||||||
URL_TO_PW_MASTER="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/-/archive/master/PortWINE-master.tar.gz"
|
URL_TO_PW_BRANCH="https://gitlab.eterfund.ru/Castro-Fidel/PortWINE/-/archive/${BRANCH}/PortWINE-${BRANCH}.tar.gz"
|
||||||
else
|
else
|
||||||
if curl -f -s --list-only --connect-timeout 3 "https://raw.githubusercontent.com/Castro-Fidel/PortWINE/master/data_from_portwine/scripts/var" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
if curl -f -s --list-only --connect-timeout 3 "https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine/scripts/var" > "${PORT_WINE_TMP_PATH}/curent_var_ver"
|
||||||
then
|
then
|
||||||
URL_FOR_CHANGELOG="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/master/data_from_portwine"
|
URL_FOR_CHANGELOG="https://raw.githubusercontent.com/Castro-Fidel/PortWINE/${BRANCH}/data_from_portwine"
|
||||||
URL_TO_PW_MASTER="https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/master.tar.gz"
|
URL_TO_PW_BRANCH="https://github.com/Castro-Fidel/PortWINE/archive/refs/heads/${BRANCH}.tar.gz"
|
||||||
else
|
else
|
||||||
print_error "Unable to determine the version on the server. Skip it..."
|
print_error "Unable to determine the version on the server. Skip it..."
|
||||||
return 1
|
return 1
|
||||||
@ -1378,7 +1389,7 @@ pw_port_update () {
|
|||||||
[[ ! -f "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ]] && echo "1" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
[[ ! -f "${PORT_WINE_TMP_PATH}/scripts_update_notifier" ]] && echo "1" > "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||||
read "scripts_update_not" < "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
read "scripts_update_not" < "${PORT_WINE_TMP_PATH}/scripts_update_notifier"
|
||||||
if [[ "${scripts_update_not}" == "1" ]] ; then
|
if [[ "${scripts_update_not}" == "1" ]] ; then
|
||||||
scripts_current_ver=$(grep "SCRIPTS_NEXT_VERSION" "${PORT_WINE_TMP_PATH}/curent_var_ver" | awk -F "=" '{print $2}')
|
scripts_current_ver=$(grep "$BRANCH_VERSION" "${PORT_WINE_TMP_PATH}/curent_var_ver" | awk -F "=" '{print $2}')
|
||||||
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 [[ ! -z "${scripts_current_ver}" ]] && [[ "${scripts_current_ver}" -gt "${scripts_install_ver}" ]] ; then
|
if [[ ! -z "${scripts_current_ver}" ]] && [[ "${scripts_current_ver}" -gt "${scripts_install_ver}" ]] ; then
|
||||||
@ -1412,18 +1423,18 @@ pw_port_update () {
|
|||||||
"$(gettext "UPDATING NOW")")
|
"$(gettext "UPDATING NOW")")
|
||||||
echo "######################################################"
|
echo "######################################################"
|
||||||
print_info "Update scripts..."
|
print_info "Update scripts..."
|
||||||
try_remove_file "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz"
|
try_remove_file "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}.tar.gz"
|
||||||
if try_download "${URL_TO_PW_MASTER}" "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz" no_mirror ; then
|
if try_download "${URL_TO_PW_BRANCH}" "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}.tar.gz" no_mirror ; then
|
||||||
if unpack "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz" "${PORT_WINE_TMP_PATH}"
|
if unpack "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}.tar.gz" "${PORT_WINE_TMP_PATH}"
|
||||||
then
|
then
|
||||||
create_new_dir "${PORT_WINE_TMP_PATH}/scripts_backup"
|
create_new_dir "${PORT_WINE_TMP_PATH}/scripts_backup"
|
||||||
cd "${PORT_WINE_PATH}/data/" || fatal
|
cd "${PORT_WINE_PATH}/data/" || fatal
|
||||||
tar -czpf "${PORT_WINE_TMP_PATH}/scripts_backup/scripts_v.${scripts_install_ver}.tar.gz" \
|
tar -czpf "${PORT_WINE_TMP_PATH}/scripts_backup/scripts_v.${scripts_install_ver}.tar.gz" \
|
||||||
./scripts ./img/gui ./locales ./themes ./changelog* ./dxvk.conf ./vkBasalt.conf ./tmp/scripts_ver
|
./scripts ./img/gui ./locales ./themes ./changelog* ./dxvk.conf ./vkBasalt.conf ./tmp/scripts_ver
|
||||||
try_remove_dir "${PORT_WINE_PATH}/data/scripts/"
|
try_remove_dir "${PORT_WINE_PATH}/data/scripts/"
|
||||||
cp -fr "${PORT_WINE_TMP_PATH}/PortWINE-master/data_from_portwine/"* "${PORT_WINE_PATH}/data/"
|
cp -fr "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}/data_from_portwine/"* "${PORT_WINE_PATH}/data/"
|
||||||
try_remove_file "${PORT_WINE_TMP_PATH}/PortWINE-master.tar.gz"
|
try_remove_file "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}.tar.gz"
|
||||||
try_remove_dir "${PORT_WINE_TMP_PATH}/PortWINE-master/"
|
try_remove_dir "${PORT_WINE_TMP_PATH}/PortWINE-${BRANCH}/"
|
||||||
echo "${scripts_current_ver}" > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
echo "${scripts_current_ver}" > "${PORT_WINE_TMP_PATH}/scripts_ver"
|
||||||
echo "Restarting PP after update..."
|
echo "Restarting PP after update..."
|
||||||
unset SKIP_CHECK_UPDATES
|
unset SKIP_CHECK_UPDATES
|
||||||
@ -5002,10 +5013,10 @@ export -f change_loc
|
|||||||
change_mirror () {
|
change_mirror () {
|
||||||
if [[ "$MIRROR" == "CDN" ]] ; then
|
if [[ "$MIRROR" == "CDN" ]] ; then
|
||||||
sed -i 's/="CDN"/="GITHUB"/g' "$USER_CONF"
|
sed -i 's/="CDN"/="GITHUB"/g' "$USER_CONF"
|
||||||
yad_info "$(gettext "Mirror changed to:") GITHUB"
|
yad_info "$(gettext "Mirror changed to:") <b>GITHUB</b>"
|
||||||
else
|
else
|
||||||
sed -i 's/="GITHUB"/="CDN"/g' "$USER_CONF"
|
sed -i 's/="GITHUB"/="CDN"/g' "$USER_CONF"
|
||||||
yad_info "$(gettext "Mirror changed to:") CDN"
|
yad_info "$(gettext "Mirror changed to:") <b>CDN</b>"
|
||||||
fi
|
fi
|
||||||
print_info "Restarting PP for change mirror..."
|
print_info "Restarting PP for change mirror..."
|
||||||
export SKIP_CHECK_UPDATES=1
|
export SKIP_CHECK_UPDATES=1
|
||||||
@ -5014,6 +5025,24 @@ change_mirror () {
|
|||||||
}
|
}
|
||||||
export -f change_mirror
|
export -f change_mirror
|
||||||
|
|
||||||
|
change_branch () {
|
||||||
|
if [[ "$BRANCH" == "master" ]] ; then
|
||||||
|
sed -i 's/="master"/="devel"/g' "$USER_CONF"
|
||||||
|
if [[ "$MIRROR" != "GITHUB" ]] ; then
|
||||||
|
sed -i 's/="CDN"/="GITHUB"/g' "$USER_CONF"
|
||||||
|
fi
|
||||||
|
export MIRROR="GITHUB"
|
||||||
|
yad_info "$(gettext "Branch changed to:") <b>DEVEL</b>"
|
||||||
|
else
|
||||||
|
sed -i 's/="devel"/="master"/g' "$USER_CONF"
|
||||||
|
yad_info "$(gettext "Branch changed to:") <b>STABLE</b>"
|
||||||
|
fi
|
||||||
|
print_info "Restarting PP for change branch..."
|
||||||
|
/usr/bin/env bash -c ${pw_full_command_line[*]} &
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
export -f change_branch
|
||||||
|
|
||||||
change_gui_start () {
|
change_gui_start () {
|
||||||
if [[ "$PW_GUI_START" == "NOTEBOOK" ]] ; then
|
if [[ "$PW_GUI_START" == "NOTEBOOK" ]] ; then
|
||||||
sed -i 's/="NOTEBOOK"/="PANED"/g' "$USER_CONF"
|
sed -i 's/="NOTEBOOK"/="PANED"/g' "$USER_CONF"
|
||||||
|
@ -171,26 +171,38 @@ else
|
|||||||
echo 'export GUI_THEME="default"' >> "$USER_CONF"
|
echo 'export GUI_THEME="default"' >> "$USER_CONF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# choose branch
|
||||||
|
if [[ -z "$BRANCH" ]] ; then
|
||||||
|
echo 'export BRANCH="master"' >> "$USER_CONF"
|
||||||
|
export BRANCH="master"
|
||||||
|
fi
|
||||||
|
if [[ "$BRANCH" == "master" ]]
|
||||||
|
then print_info "Branch in used: STABLE\n"
|
||||||
|
else print_warning "Branch in used: DEVEL\n"
|
||||||
|
fi
|
||||||
|
|
||||||
# choose mirror
|
# choose mirror
|
||||||
if [[ -z "$MIRROR" ]] \
|
if [[ -z "$MIRROR" ]] \
|
||||||
&& [[ "$LANGUAGE" == "ru" ]]
|
&& [[ "$LANGUAGE" == "ru" ]] \
|
||||||
|
&& [[ "$BRANCH" != "devel" ]]
|
||||||
then
|
then
|
||||||
echo 'export MIRROR="CDN"' >> "$USER_CONF"
|
echo 'export MIRROR="CDN"' >> "$USER_CONF"
|
||||||
export MIRROR="CDN"
|
MIRROR="CDN"
|
||||||
elif [[ -z "$MIRROR" ]] ; then
|
elif [[ -z "$MIRROR" ]] ; then
|
||||||
echo 'export MIRROR="GITHUB"' >> "$USER_CONF"
|
echo 'export MIRROR="GITHUB"' >> "$USER_CONF"
|
||||||
export MIRROR="GITHUB"
|
MIRROR="GITHUB"
|
||||||
fi
|
fi
|
||||||
|
export MIRROR
|
||||||
print_info "The first mirror in used: $MIRROR\n"
|
print_info "The first mirror in used: $MIRROR\n"
|
||||||
|
|
||||||
|
|
||||||
if [[ "${INSTALLING_PORT}" == 1 ]] ; then
|
if [[ "${INSTALLING_PORT}" == 1 ]] ; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# choose gui start
|
# choose gui start
|
||||||
case "$PW_GUI_START" in
|
case "$PW_GUI_START" in
|
||||||
PANED) : ;;
|
PANED|NOTEBOOK) : ;;
|
||||||
NOTEBOOK) : ;;
|
|
||||||
*)
|
*)
|
||||||
sed -i '/export PW_GUI_START=/d' "$USER_CONF"
|
sed -i '/export PW_GUI_START=/d' "$USER_CONF"
|
||||||
echo 'export PW_GUI_START="NOTEBOOK"' >> "$USER_CONF"
|
echo 'export PW_GUI_START="NOTEBOOK"' >> "$USER_CONF"
|
||||||
@ -560,9 +572,9 @@ else
|
|||||||
else NEW_MIRROR="CDN"
|
else NEW_MIRROR="CDN"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$PW_GUI_START" == "NOTEBOOK" ]]
|
if [[ "$BRANCH" == "master" ]]
|
||||||
then NEW_PW_GUI_START="PANED"
|
then NEW_BRANCH="DEVEL"
|
||||||
else NEW_PW_GUI_START="NOTEBOOK"
|
else NEW_BRANCH="STABLE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
orig_IFS="$IFS" && IFS=$'\n'
|
orig_IFS="$IFS" && IFS=$'\n'
|
||||||
@ -603,6 +615,7 @@ else
|
|||||||
--field=" Xterm"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click pw_start_cont_xterm"' \
|
--field=" Xterm"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click pw_start_cont_xterm"' \
|
||||||
--field=" $(gettext "Credits")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click gui_credits"' \
|
--field=" $(gettext "Credits")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click gui_credits"' \
|
||||||
--field=" $(gettext "Change mirror to") $NEW_MIRROR"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click change_mirror"' \
|
--field=" $(gettext "Change mirror to") $NEW_MIRROR"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click change_mirror"' \
|
||||||
|
--field=" $(gettext "Change branch to") $NEW_BRANCH"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click change_branch"' \
|
||||||
--field=" $(gettext "Change start gui")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click change_gui_start"' \
|
--field=" $(gettext "Change start gui")"!"$PW_GUI_ICON_PATH/$BUTTON_SIZE_MM.png"!"":"FBTN" '@bash -c "button_click change_gui_start"' \
|
||||||
2>/dev/null &
|
2>/dev/null &
|
||||||
|
|
||||||
@ -767,6 +780,7 @@ fi
|
|||||||
open_changelog) open_changelog ;;
|
open_changelog) open_changelog ;;
|
||||||
change_loc) change_loc ;;
|
change_loc) change_loc ;;
|
||||||
change_mirror) change_mirror ;;
|
change_mirror) change_mirror ;;
|
||||||
|
change_branch) change_branch ;;
|
||||||
change_gui_start) change_gui_start ;;
|
change_gui_start) change_gui_start ;;
|
||||||
118) gui_edit_db ;;
|
118) gui_edit_db ;;
|
||||||
120) gui_vkbasalt ;;
|
120) gui_vkbasalt ;;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#Author: Castro-Fidel (linux-gaming.ru)
|
#Author: Castro-Fidel (linux-gaming.ru)
|
||||||
#SCRIPTS_NEXT_VERSION=2316
|
#SCRIPTS_NEXT_VERSION=2317
|
||||||
#SCRIPTS_STABLE_VERSION=2316
|
#SCRIPTS_STABLE_VERSION=2317
|
||||||
########################################################################
|
########################################################################
|
||||||
export LANGUAGES_LIST="ru es"
|
export LANGUAGES_LIST="ru es"
|
||||||
export PW_VKBASALT="0"
|
export PW_VKBASALT="0"
|
||||||
|
Loading…
Reference in New Issue
Block a user