Merge pull request #5779 from sylvestre/gnu-dl

gnu compare: try to use a local copy if the download failed
This commit is contained in:
Daniel Hofstetter
2024-01-04 08:19:58 +01:00
committed by GitHub
+15 -4
View File
@@ -11,10 +11,21 @@ import json
import sys
base = "../gnu/tests/"
urllib.request.urlretrieve(
"https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-full-result.json",
"result.json",
)
# Try to download the file, use local copy if download fails
result_json = "result.json"
try:
urllib.request.urlretrieve(
"https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-full-result.json",
result_json
)
except Exception as e:
print(f"Failed to download the file: {e}")
if not os.path.exists(result_json):
print(f"Local file '{result_json}' not found. Exiting.")
sys.exit(1)
else:
print(f"Using local file '{result_json}'.")
types = ("/*/*.sh", "/*/*.pl", "/*/*.xpl")