From b998f153232f2afab3fe39b95bd9f69083a07d4f Mon Sep 17 00:00:00 2001 From: Mirko Brombin Date: Sat, 24 Sep 2022 19:13:54 +0200 Subject: [PATCH] make the wizard proceed even without a log path --- VERSION | 2 +- data/io.github.vanilla-os.FirstSetup.appdata.xml.in | 2 +- debian/changelog | 2 +- first-setup.txt | 1 + meson.build | 2 +- vanilla_first_setup/utils/builder.py | 4 ++-- vanilla_first_setup/utils/processor.py | 10 +++++++--- 7 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 first-setup.txt diff --git a/VERSION b/VERSION index 7f20734..e6d5cb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 \ No newline at end of file +1.0.2 \ No newline at end of file diff --git a/data/io.github.vanilla-os.FirstSetup.appdata.xml.in b/data/io.github.vanilla-os.FirstSetup.appdata.xml.in index 4515201..8dcb2c4 100644 --- a/data/io.github.vanilla-os.FirstSetup.appdata.xml.in +++ b/data/io.github.vanilla-os.FirstSetup.appdata.xml.in @@ -21,7 +21,7 @@ 768 - +

First release

diff --git a/debian/changelog b/debian/changelog index aa2c813..18194ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -vanilla-first-setup (1.0.1) jammy; urgency=low +vanilla-first-setup (1.0.2) jammy; urgency=low * Rewrite from scratch to support custom recipes and to be more modular. diff --git a/first-setup.txt b/first-setup.txt new file mode 100644 index 0000000..0ca1049 --- /dev/null +++ b/first-setup.txt @@ -0,0 +1 @@ +# Vanilla First Setup Log FIle diff --git a/meson.build b/meson.build index e77031f..3a02b0f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('io.github.vanilla-os.FirstSetup', - version: '1.0.1', + version: '1.0.2', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', diff --git a/vanilla_first_setup/utils/builder.py b/vanilla_first_setup/utils/builder.py index 4baa2bb..1e8d7f7 100644 --- a/vanilla_first_setup/utils/builder.py +++ b/vanilla_first_setup/utils/builder.py @@ -63,8 +63,8 @@ class Builder: try: open(log_path, 'a').close() except OSError: - logger.critical("failed to create log file: %s" % log_path) - sys.exit(1) + logger.warning("failed to create log file: %s" % log_path) + logging.warning("No log will be stored.") for key, step in self.__recipe.raw["steps"].items(): if step["template"] in templates: diff --git a/vanilla_first_setup/utils/processor.py b/vanilla_first_setup/utils/processor.py index caa8822..65ead6d 100644 --- a/vanilla_first_setup/utils/processor.py +++ b/vanilla_first_setup/utils/processor.py @@ -57,9 +57,13 @@ class Processor: # write the output to the log file so the packager can see what # happened during the installation process - with open(log_path, 'a') as log: - log.write(proc.stdout.decode('utf-8')) - log.flush() + try: + with open(log_path, 'a') as log: + log.write(proc.stdout.decode('utf-8')) + log.flush() + except Exception as e: + logger.warning("failed to write to the log file: %s" % e) + logger.warning("the output of the commands is: %s" % proc.stdout) if proc.returncode != 0: logger.critical(