pmb.helpers.http.download respects --offline flag (MR 1930)
fixes #1837
This commit is contained in:
parent
9c2d951fc9
commit
44ab2f8c40
|
@ -38,6 +38,10 @@ def download(args, url, prefix, cache=True, loglevel=logging.INFO,
|
|||
return path
|
||||
pmb.helpers.run.user(args, ["rm", path])
|
||||
|
||||
# Offline and not cached
|
||||
if args.offline:
|
||||
raise RuntimeError(f"File not found in cache and offline flag is enabled: {url}")
|
||||
|
||||
# Download the file
|
||||
logging.log(loglevel, "Download " + url)
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue