From ed0fa21524d1dec12022aaf22e9a3d5ca742db08 Mon Sep 17 00:00:00 2001 From: wangcichen Date: Wed, 17 May 2023 03:39:56 +0800 Subject: [PATCH] Enforce locale when running the IPU workflow --- ...locale-when-running-the-IPU-workflow.patch | 37 +++++++++++++++++++ leapp.spec | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 leapp-0010-Enforce-locale-when-running-the-IPU-workflow.patch diff --git a/leapp-0010-Enforce-locale-when-running-the-IPU-workflow.patch b/leapp-0010-Enforce-locale-when-running-the-IPU-workflow.patch new file mode 100644 index 0000000..6b4eaff --- /dev/null +++ b/leapp-0010-Enforce-locale-when-running-the-IPU-workflow.patch @@ -0,0 +1,37 @@ +From 20879add50aabcef28eca75a10094b8c41f845bc Mon Sep 17 00:00:00 2001 +From: wangcichen +Date: Wed, 17 May 2023 03:26:25 +0800 +Subject: [PATCH] Enforce locale when running the IPU workflow. + +Signed-off-by: wangcichen +--- + leapp/cli/upgrade/__init__.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/leapp/cli/upgrade/__init__.py b/leapp/cli/upgrade/__init__.py +index e130a72..672ad61 100644 +--- a/leapp/cli/upgrade/__init__.py ++++ b/leapp/cli/upgrade/__init__.py +@@ -274,6 +274,9 @@ def upgrade(args): + workflow.load_answers(answerfile_path, userchoices_path) + skip_actors = configuration.get('skip_actor') + logger.info("The skipped actors will be:" + " ".join(skip_actors)) ++ os.environ['LANGUAGE'] = 'en_US.UTF-8' ++ os.environ['LC_ALL'] = 'en_US.UTF-8' ++ os.environ['LANG'] = 'en_US.UTF-8' + workflow.run(context=context, skip_phases_until=skip_phases_until, skip_dialogs=True, actor_name=actor_name, skip_actors=skip_actors) + + logger.info("Answerfile will be created at %s", answerfile_path) +@@ -332,6 +335,9 @@ def preupgrade(args): + logger.info('Executing workflow until phase: %s', until_phase) + skip_actors = configuration.get('skip_actor') + logger.info("The skipped actors will be:" + " ".join(skip_actors)) ++ os.environ['LANGUAGE'] = 'en_US.UTF-8' ++ os.environ['LC_ALL'] = 'en_US.UTF-8' ++ os.environ['LANG'] = 'en_US.UTF-8' + workflow.run(context=context, until_phase=until_phase, skip_dialogs=True, actor_name=actor_name, skip_actors=skip_actors) + + logger.info("Answerfile will be created at %s", answerfile_path) +-- +2.22.0 + diff --git a/leapp.spec b/leapp.spec index 5bf6195..a0a17c0 100644 --- a/leapp.spec +++ b/leapp.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.10 +%define anolis_release .0.11 # IMPORTANT: this is for the leapp-framework capability (it's not the real # version of the leapp). The capability reflects changes in api and whatever # functionality important from the point of repository. In case of @@ -46,6 +46,7 @@ Patch0006: leapp-0006-add-customrepo-command.patch Patch0007: leapp-0007-remove-failure-exit-code-check.patch Patch0008: leapp-0008-More-failure-details.patch Patch0009: leapp-0009-System-enviroment-exception-is-defined.patch +Patch0010: leapp-0010-Enforce-locale-when-running-the-IPU-workflow.patch %if !0%{?fedora} %if %{with python3} @@ -173,6 +174,7 @@ Python 3 leapp framework libraries. %patch0007 -p1 %patch0008 -p1 %patch0009 -p1 +%patch0010 -p1 ################################################## # Build @@ -295,6 +297,9 @@ rm -f %{buildroot}/%{_bindir}/leapp # no files here %changelog +* Thu May 18 2023 Cichen Wang - 0.12.0-1.0.11 +- Enforce locale when running the IPU workflow. + * Mon Mar 13 2023 Weitao Zhou - 0.12.0-1.0.10 - set confirm=True if need to update grub2-tools -- Gitee