Stage package downloads before disruptive installs

This commit is contained in:
ushan0v
2026-06-12 21:29:30 +03:00
parent 02c2398cfc
commit 30820a6f1c
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -1913,12 +1913,12 @@ main() {
ensure_bootstrap_tool "ucode" "ucode"
resolve_podkop_plus_release
download_podkop_plus_packages
remove_conflicting_dns_proxy
remove_old_sing_box_if_needed
install_selected_sing_box
cleanup_legacy_installation
download_podkop_plus_packages
install_packages
post_install
+9 -9
View File
@@ -2026,9 +2026,6 @@ updates_install_sing_box_extended_package() {
updates_check_success "sing_box" "$normalized_current" "$normalized_latest" "$UPDATES_SING_BOX_EXTENDED_RELEASE_URL"
fi
updates_stop_podkop_before_sing_box_change
updates_prepare_sing_box_package_service_install
package_file="$UPDATES_TMP_DIR/$UPDATES_SING_BOX_EXTENDED_ASSET_NAME"
if ! updates_download_with_retry "$UPDATES_SING_BOX_EXTENDED_ASSET_URL" "$package_file" "$UPDATES_SING_BOX_EXTENDED_ASSET_NAME"; then
updates_fail "sing_box" "$action" "Failed to download sing-box-extended package" "$current_version" "$latest_version"
@@ -2037,6 +2034,9 @@ updates_install_sing_box_extended_package() {
updates_log_command "Updating package lists before sing-box-extended package installation" updates_pkg_list_update ||
updates_fail "sing_box" "$action" "Failed to update package lists" "$current_version" "$latest_version"
updates_stop_podkop_before_sing_box_change
updates_prepare_sing_box_package_service_install
backup_binary=""
backup_cronet=""
cronet_touched=0
@@ -2163,8 +2163,6 @@ updates_install_sing_box_extended() {
updates_check_success "sing_box" "$normalized_current" "$normalized_latest" "$UPDATES_SING_BOX_EXTENDED_RELEASE_URL"
fi
updates_stop_podkop_before_sing_box_change
backup_binary=""
backup_cronet=""
cronet_touched=0
@@ -2229,6 +2227,8 @@ updates_install_sing_box_extended() {
updates_fail "sing_box" "$action" "Downloaded $label failed validation" "$current_version" "$latest_version"
}
updates_stop_podkop_before_sing_box_change
if [ -e /usr/bin/sing-box ]; then
backup_binary="/usr/bin/sing-box.podkop-backup.$$"
if ! updates_move_file_to_backup /usr/bin/sing-box "$backup_binary"; then
@@ -2336,8 +2336,6 @@ updates_install_stable_sing_box() {
updates_check_success "sing_box" "$current_version" "$latest_version"
fi
updates_stop_podkop_before_sing_box_change
updates_log_command "Updating package lists before sing-box installation" updates_pkg_list_update ||
updates_fail "sing_box" "$action" "Failed to update package lists" "$current_version" "$latest_version"
@@ -2345,6 +2343,8 @@ updates_install_stable_sing_box() {
[ -n "$latest_version" ] || latest_version="$(updates_get_installed_package_version "sing-box")"
[ -n "$latest_version" ] || updates_fail "sing_box" "$action" "Failed to resolve stable sing-box package version" "$current_version"
updates_stop_podkop_before_sing_box_change
if ! updates_log_command "Installing stable sing-box package" updates_replace_sing_box_package_variant "sing-box" "sing-box-tiny"; then
updates_fail "sing_box" "$action" "Failed to install stable sing-box" "$current_version" "$latest_version"
fi
@@ -2396,8 +2396,6 @@ updates_install_tiny_sing_box() {
updates_check_success "sing_box" "$current_version" "$latest_version"
fi
updates_stop_podkop_before_sing_box_change
updates_log_command "Updating package lists before sing-box-tiny installation" updates_pkg_list_update ||
updates_fail "sing_box" "$action" "Failed to update package lists" "$current_version" "$latest_version"
@@ -2405,6 +2403,8 @@ updates_install_tiny_sing_box() {
[ -n "$latest_version" ] || latest_version="$(updates_get_installed_package_version "sing-box-tiny")"
[ -n "$latest_version" ] || updates_fail "sing_box" "$action" "Failed to resolve tiny sing-box package version" "$current_version"
updates_stop_podkop_before_sing_box_change
if ! updates_log_command "Installing tiny sing-box package" updates_replace_sing_box_package_variant "sing-box-tiny" "sing-box"; then
updates_fail "sing_box" "$action" "Failed to install sing-box-tiny" "$current_version" "$latest_version"
fi