diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 9555a0433..49f3ea2ff 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -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() diff --git a/src/modules/packages/packages.conf b/src/modules/packages/packages.conf index 6cccfc490..2d6ca116f 100644 --- a/src/modules/packages/packages.conf +++ b/src/modules/packages/packages.conf @@ -14,9 +14,20 @@ # backend: dummy -# If set to true, a package-manager specific update procedure -# is run first (only if there is internet) to update the list -# of packages and dependencies. +# Often package installation needs an internet connection. +# Since you may allow system installation without a connection +# and want to offer **optional** package installation, it's +# possible to have no internet, yet have this packages module +# enabled in settings. +# +# You can skip the whole module when there is no internet +# by setting *skip_if_no_internet* to true. +# +# You can run a package-manager specific update procedure +# before installing packages (for instance, to update the +# list of packages and dependencies); this is done only if there +# is an internet connection. Set *update_db* to true to do so. +skip_if_no_internet: false update_db: true #