From dcb708dd096f28d66f76ee7547516007ddaa0150 Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Thu, 25 Nov 2021 21:54:29 +0000 Subject: [PATCH] [KERNEL][TEST] Use urllib instead of wget git-svn-id: svn://kolibrios.org@9314 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/runtests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/runtests.py b/kernel/trunk/runtests.py index 616e696684..7488ccad30 100755 --- a/kernel/trunk/runtests.py +++ b/kernel/trunk/runtests.py @@ -4,6 +4,7 @@ import os import sys +import urllib from importlib.machinery import SourceFileLoader from shutil import which import timeit @@ -31,6 +32,11 @@ def stage(name, command, mute = False): execute(command, mute = mute) print("Done.") +def download(link, path): + log(f"Downloading {path}... ", end = "") + urllib.urlretrieve(link, path) + log("Done.") + def tool_exists(name): assert(type(name) == str) return which(name) != None @@ -79,14 +85,13 @@ if __name__ == "__main__": # Check available tools tools = (("mcopy", "mtools"), ("qemu-system-i386", "qemu-system-x86"), - ("wget", "wget"), ("fasm", "fasm")) check_tools(tools) # Get IMG if not os.path.exists("kolibri_test.img"): if len(sys.argv) == 1: - execute("wget -q --show-progress http://builds.kolibrios.org/eng/data/data/kolibri.img -O kolibri_test.img") + download("http://builds.kolibrios.org/eng/data/data/kolibri.img", "kolibri_test.img") else: builds_eng = sys.argv[1] execute(f"cp {builds_eng}/data/data/kolibri.img kolibri_test.img")