[packages] Feature: skip if no internet.

Update documentation, add a new key *skip_if_no_internet* to support
systems that **recommend** having an internet connection (but don't
require it), and which also use the packages module. This prevents
a long delay while the package manager tries to access the internet
and times out (repeatedly).

Existing configurations are unchanged.
This commit is contained in:
Adriaan de Groot 2017-12-02 05:04:30 -05:00
parent 7b145c2a36
commit 150007c138
2 changed files with 19 additions and 3 deletions

View file

@ -426,6 +426,11 @@ def run():
else:
return "Bad backend", "backend=\"{}\"".format(backend)
skip_this = libcalamares.job.configuration.get("skip_if_no_internet", false)
if skip_this and not libcalamares.globalstorage.value("hasInternet"):
cDebug() << "WARNING: packages installation has been skipped: no internet";
return None
update_db = libcalamares.job.configuration.get("update_db", False)
if update_db and libcalamares.globalstorage.value("hasInternet"):
pkgman.update_db()