forked from Mirror/pmbootstrap
pmb.helpers.http.download respects --offline flag (MR 1930)
fixes #1837
This commit is contained in:
parent
9c2d951fc9
commit
44ab2f8c40
1 changed files with 4 additions and 0 deletions
|
@ -38,6 +38,10 @@ def download(args, url, prefix, cache=True, loglevel=logging.INFO,
|
||||||
return path
|
return path
|
||||||
pmb.helpers.run.user(args, ["rm", 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
|
# Download the file
|
||||||
logging.log(loglevel, "Download " + url)
|
logging.log(loglevel, "Download " + url)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue