Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion toolchain/scripts/lib/config_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ config_set_defaults() {
CONFIG_CACHE["TARGET_CPU"]="native"
CONFIG_CACHE["LOG_LINES"]="200"
CONFIG_CACHE["show_help"]="false"
CONFIG_CACHE["DOWNLOADER_FLAGS"]=""

# Version strategy defaults (NEW)
CONFIG_CACHE["VERSION_STRATEGY"]="main"
Expand Down
14 changes: 11 additions & 3 deletions toolchain/scripts/tool_kit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,20 @@ download_pkg_from_url() {
local __sha256="$1" # if set to "--no-checksum", do not check checksum
local __filename="$2"
local __url="$3"

# Hide the progress bar in containers to prevent flooding output
local DOWNLOADER_FLAGS
if [ -f /.dockerenv ] || [ -f /run/.containerenv ]; then
DOWNLOADER_FLAGS="--quiet"
else
DOWNLOADER_FLAGS="--quiet --show-progress"
fi

# Smart certificate validation strategy
case "${DOWNLOAD_CERT_POLICY:-smart}" in
"strict")
echo "Downloading with strict certificate validation: $__url"
if ! wget --quiet --show-progress ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
rm -f "$__filename"
report_error "failed to download $__url (strict certificate validation)"
recommend_offline_installation "$__filename" "$__url"
Expand All @@ -938,7 +946,7 @@ download_pkg_from_url() {
;;
"skip")
echo "Downloading with certificate validation disabled: $__url"
if ! wget --quiet --show-progress ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
if ! wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename" --no-check-certificate; then
rm -f "$__filename"
report_error "failed to download $__url"
recommend_offline_installation "$__filename" "$__url"
Expand All @@ -950,7 +958,7 @@ download_pkg_from_url() {
"smart"|*)
# Smart fallback: try with certificate validation first, then without
echo "Attempting secure download: $__url"
if wget --quiet --show-progress ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
if wget ${DOWNLOADER_FLAGS} "$__url" -O "$__filename"; then
echo "Download successful with certificate validation"
else
echo "Certificate validation failed, retrying without certificate check..."
Expand Down
Loading