Skip to content
Snippets Groups Projects
Commit df0f7efe authored by Frede H's avatar Frede H :speech_balloon:
Browse files

check for existing mirrors.json before comparing data files

compare breaks if mirrors.json does not exist eg. chroot condition
parent 136d6f5a
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,9 @@ def download_mirrors(config):
jsonfn.json_dump_file(mirrorlist, tempfile)
filecmp.clear_cache()
if filefn.check_file(conf.USR_DIR, dir=True):
if not filecmp.cmp(tempfile, config["mirror_file"]):
if filefn.check_file(config["mirror_file"]):
jsonfn.json_dump_file(mirrorlist, config["mirror_file"])
elif not filecmp.cmp(tempfile, config["mirror_file"]):
jsonfn.json_dump_file(mirrorlist, config["mirror_file"])
os.remove(tempfile)
except (HTTPException, json.JSONDecodeError, URLError):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment