From 70ecb5a9e95cff1cd92bd45213e12f676104cedd Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Thu, 29 May 2025 22:00:43 +0100 Subject: [PATCH] fix: add comprehensive download debugging for tarball issues --- scripts/install-pulse.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/install-pulse.sh b/scripts/install-pulse.sh index ca718934b..7361fc9e5 100755 --- a/scripts/install-pulse.sh +++ b/scripts/install-pulse.sh @@ -328,20 +328,35 @@ download_and_extract_tarball() { local temp_extract_dir="/tmp/pulse-extract-$$" print_info "Downloading Pulse $tag tarball..." + print_info "Download URL: $tarball_url" + if ! curl -sL "$tarball_url" -o "$temp_tarball"; then print_error "Failed to download tarball from $tarball_url" return 1 fi + # Show download info for debugging + local file_size=$(stat -f%z "$temp_tarball" 2>/dev/null || stat -c%s "$temp_tarball" 2>/dev/null || echo "unknown") + print_info "Downloaded file size: $file_size bytes" + # Verify downloaded file is actually a gzip file - if ! file "$temp_tarball" | grep -q "gzip compressed"; then - print_error "Downloaded file is not a valid gzip archive. File type: $(file "$temp_tarball")" - print_error "First few bytes: $(head -c 100 "$temp_tarball" | xxd -l 100)" - print_error "URL: $tarball_url" + local file_type=$(file "$temp_tarball") + print_info "Downloaded file type: $file_type" + + if ! echo "$file_type" | grep -q "gzip compressed"; then + print_error "Downloaded file is not a valid gzip archive!" + print_error "File type: $file_type" + print_error "First 200 bytes as hex:" + head -c 200 "$temp_tarball" | xxd + print_error "First 200 bytes as text:" + head -c 200 "$temp_tarball" | cat -v + print_error "URL attempted: $tarball_url" rm -f "$temp_tarball" return 1 fi + print_success "Tarball download verified as valid gzip archive" + print_info "Extracting tarball..." mkdir -p "$temp_extract_dir" if ! tar -xzf "$temp_tarball" -C "$temp_extract_dir" --strip-components=1; then