From 274f71d7d9047bb2bdf6b5c2cca7a6ff9d63142b Mon Sep 17 00:00:00 2001 From: Niek van der Maas Date: Tue, 6 Aug 2019 21:13:08 +0900 Subject: [PATCH] Allow offline building - skip package updater if there is no connection (#1841) --- code/extra_script_pre.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/extra_script_pre.py b/code/extra_script_pre.py index 7f809a5e..c9533325 100644 --- a/code/extra_script_pre.py +++ b/code/extra_script_pre.py @@ -66,9 +66,12 @@ def get_shared_libdeps_dir(section, name): def ensure_platform_updated(): - if PIO_PLATFORM.are_outdated_packages(): - print("updating platform packages", file=sys.stderr) - PIO_PLATFORM.update_packages() + try: + if PIO_PLATFORM.are_outdated_packages(): + print("updating platform packages", file=sys.stderr) + PIO_PLATFORM.update_packages() + except Exception: + print("Warning: no connection, cannot check for outdated packages", file=sys.stderr) # latest toolchain is still optional with PIO (TODO: recheck after 2.6.0!)