Add --offline flag

Allow working offline with pmbootstrap, as long as all packages that
are being used have already been downloaded.
This commit is contained in:
Oliver Smith 2018-09-30 03:53:55 +02:00
parent 5b33eb7520
commit e458b1fdbc
5 changed files with 15 additions and 1 deletions

View file

@ -118,6 +118,13 @@ def update(args, arch=None, force=False, existing_only=False):
:returns: True when files have been downloaded, False otherwise
"""
# Skip in offline mode, only show once
if args.offline:
if not args.cache["offline_msg_shown"]:
logging.info("NOTE: skipping package index update (offline mode)")
args.cache["offline_msg_shown"] = True
return False
# Architectures and retention time
architectures = [arch] if arch else pmb.config.build_device_architectures
retention_hours = pmb.config.apkindex_retention_time