From d1a29fbe299aba2661eb809c6aa21843926489b6 Mon Sep 17 00:00:00 2001 From: Wei Jiangang Date: Wed, 24 Apr 2024 21:37:06 +0800 Subject: [PATCH] customize/timezone.ml: Add gettext f_ call around an error message Problem has existed since before we moved the code to the current location in 2014 (in commit f1f5208bd5 "customize: Move virt-customize-related code to a separate directory"). Signed-off-by: Wei Jiangang (cherry picked from commit 0f4eb408c126d85709286547965fe1052a78f8f2) --- ...ne.ml-Add-gettext-f_-call-around-an-.patch | 38 +++++++++++++++++++ guestfs-tools.spec | 4 ++ 2 files changed, 42 insertions(+) create mode 100644 0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch diff --git a/0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch b/0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch new file mode 100644 index 0000000..679ca24 --- /dev/null +++ b/0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch @@ -0,0 +1,38 @@ +From 5e5baad0f29b1aff5e99664a19ca9270da9c2af3 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 6 Feb 2023 15:04:03 +0000 +Subject: [PATCH] customize/timezone.ml: Add gettext f_ call around an error + message + +Problem has existed since before we moved the code to the current +location in 2014 (in commit f1f5208bd5 "customize: Move +virt-customize-related code to a separate directory"). +--- + customize/timezone.ml | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/customize/timezone.ml b/customize/timezone.ml +index 2ac7a105..1de566e1 100644 +--- a/customize/timezone.ml ++++ b/customize/timezone.ml +@@ -17,6 +17,7 @@ + *) + + open Tools_utils ++open Common_gettext.Gettext + + open Printf + +@@ -31,7 +32,8 @@ let set_timezone (g : Guestfs.guestfs) root timezone = + | "linux" -> + let target = sprintf "/usr/share/zoneinfo/%s" timezone in + if not (g#exists target) then +- error "timezone '%s' does not exist, use a location like 'Europe/London'" timezone; ++ error (f_"timezone '%s' does not exist, use a location like \ ++ 'Europe/London'") timezone; + g#ln_sf target "/etc/localtime"; + true + +-- +2.39.1 + diff --git a/guestfs-tools.spec b/guestfs-tools.spec index 9d15356..54e938b 100644 --- a/guestfs-tools.spec +++ b/guestfs-tools.spec @@ -25,6 +25,8 @@ Source0: http://download.libguestfs.org/guestfs-tools/%{source_directory}/ Source1: http://download.libguestfs.org/guestfs-tools/%{source_directory}/%{name}-%{version}.tar.gz.sig %endif +Patch1: 0001-customize-timezone.ml-Add-gettext-f_-call-around-an-.patch + %if 0%{patches_touch_autotools} BuildRequires: autoconf, automake, libtool, gettext-devel %endif @@ -375,5 +377,7 @@ end %changelog +* Wed Apr 24 2024 Wei Jiangang - 1.49.5-2 +- Fix error message by adding gettext f_ call around it. * Tue Mar 23 2021 Wei Jiangang - 1.49.5-1 - New guestfs-tools package, split off from libguestfs. -- Gitee