From 4d2643f79685966a3f4faee36d7795377ab38bd5 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Fri, 25 Sep 2020 14:30:03 -0700 Subject: [PATCH] Add --compressed flag only if URL does not end in .gz. Addresses #68 --- installinstallmacos.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 0b817a6..bafe611 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -263,8 +263,11 @@ def replicate_url(full_url, options = '-sfL' curl_cmd = ['/usr/bin/curl', options, '--create-dirs', - '--compressed', '-o', local_file_path] + if not full_url.endswith(".gz"): + # stupid hack for stupid Apple behavior where it sometimes returns + # compressed files even when not asked for + curl_cmd.append('--compressed') if not ignore_cache and os.path.exists(local_file_path): curl_cmd.extend(['-z', local_file_path]) if attempt_resume: