From 2dcc24eb7233f000e57204375775437030b00b9b Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Thu, 4 May 2023 22:29:43 +0800 Subject: [PATCH] Set default timezone to Beijing Signed-off-by: Jacob Wang --- ...-Set-the-default-timezone-to-Beijing.patch | 106 ++++++++++++++++++ anaconda.spec | 6 +- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 0011-Set-the-default-timezone-to-Beijing.patch diff --git a/0011-Set-the-default-timezone-to-Beijing.patch b/0011-Set-the-default-timezone-to-Beijing.patch new file mode 100644 index 0000000..e2b65ec --- /dev/null +++ b/0011-Set-the-default-timezone-to-Beijing.patch @@ -0,0 +1,106 @@ +diff -Nuar anaconda-33.16.7.12.orig/pyanaconda/modules/timezone/installation.py anaconda-33.16.7.12/pyanaconda/modules/timezone/installation.py +--- anaconda-33.16.7.12.orig/pyanaconda/modules/timezone/installation.py 2023-05-04 22:11:09.810042838 +0800 ++++ anaconda-33.16.7.12/pyanaconda/modules/timezone/installation.py 2023-05-04 22:23:24.306170386 +0800 +@@ -63,8 +63,8 @@ + if not is_valid_timezone(self._timezone): + # this should never happen, but for pity's sake + log.warning("Timezone %s set in kickstart is not valid, " +- "falling back to default (Asia/Shanghai).", self._timezone) +- self._timezone = "Asia/Shanghai" ++ "falling back to default (Asia/Beijing).", self._timezone) ++ self._timezone = "Asia/Beijing" + + def _make_timezone_symlink(self): + """Create the symlink that actually defines timezone.""" +diff -Nuar anaconda-33.16.7.12.orig/pyanaconda/modules/timezone/timezone.py anaconda-33.16.7.12/pyanaconda/modules/timezone/timezone.py +--- anaconda-33.16.7.12.orig/pyanaconda/modules/timezone/timezone.py 2023-05-04 22:11:09.811042809 +0800 ++++ anaconda-33.16.7.12/pyanaconda/modules/timezone/timezone.py 2023-05-04 22:23:24.302170499 +0800 +@@ -39,7 +39,7 @@ + def __init__(self): + super().__init__() + self.timezone_changed = Signal() +- self._timezone = "Asia/Shanghai" ++ self._timezone = "Asia/Beijing" + + self.is_utc_changed = Signal() + self._is_utc = False +diff -Nuar anaconda-33.16.7.12.orig/pyanaconda/ui/gui/spokes/datetime_spoke.py anaconda-33.16.7.12/pyanaconda/ui/gui/spokes/datetime_spoke.py +--- anaconda-33.16.7.12.orig/pyanaconda/ui/gui/spokes/datetime_spoke.py 2023-05-04 22:11:09.811042809 +0800 ++++ anaconda-33.16.7.12/pyanaconda/ui/gui/spokes/datetime_spoke.py 2023-05-04 22:23:24.299170585 +0800 +@@ -66,7 +66,7 @@ + SERVER_WORKING = 2 + SERVER_USE = 3 + +-DEFAULT_TZ = "Asia/Shanghai" ++DEFAULT_TZ = "Asia/Beijing" + + SPLIT_NUMBER_SUFFIX_RE = re.compile(r'([^0-9]*)([-+])([0-9]+)') + +diff -Nuar anaconda-33.16.7.12.orig/tests/gui/summary.py anaconda-33.16.7.12/tests/gui/summary.py +--- anaconda-33.16.7.12.orig/tests/gui/summary.py 2023-05-04 22:11:09.811042809 +0800 ++++ anaconda-33.16.7.12/tests/gui/summary.py 2023-05-04 22:23:24.307170357 +0800 +@@ -57,7 +57,7 @@ + # FIXME: This encodes default information. + for selector in selectors: + if selector.name == "TIME & DATE": +- self.assertEqual(selector.description, "Asia/Shanghai timezone") ++ self.assertEqual(selector.description, "Asia/Beijing timezone") + elif selector.name == "KEYBOARD": + self.assertEqual(selector.description, "English (US)") + elif selector.name == "LANGUAGE SUPPORT": +diff -Nuar anaconda-33.16.7.12.orig/tests/nosetests/pyanaconda_tests/localization_test.py anaconda-33.16.7.12/tests/nosetests/pyanaconda_tests/localization_test.py +--- anaconda-33.16.7.12.orig/tests/nosetests/pyanaconda_tests/localization_test.py 2023-05-04 22:11:09.811042809 +0800 ++++ anaconda-33.16.7.12/tests/nosetests/pyanaconda_tests/localization_test.py 2023-05-04 22:23:24.310170272 +0800 +@@ -85,7 +85,7 @@ + localization.os.environ["LANG"] = "blah" + self.assertRaises(localization.InvalidLocaleSpec, + localization.get_xlated_timezone, +- "Asia/Shanghai") ++ "Asia/Beijing") + + + class SetupLocaleTest(unittest.TestCase): +diff -Nuar anaconda-33.16.7.12.orig/tests/nosetests/pyanaconda_tests/module_timezone_test.py anaconda-33.16.7.12/tests/nosetests/pyanaconda_tests/module_timezone_test.py +--- anaconda-33.16.7.12.orig/tests/nosetests/pyanaconda_tests/module_timezone_test.py 2023-05-04 22:11:09.811042809 +0800 ++++ anaconda-33.16.7.12/tests/nosetests/pyanaconda_tests/module_timezone_test.py 2023-05-04 22:23:24.324169875 +0800 +@@ -88,7 +88,7 @@ + ks_in = None + ks_out = """ + # System timezone +- timezone Asia/Shanghai ++ timezone Asia/Beijing + """ + self._test_kickstart(ks_in, ks_out) + +@@ -160,7 +160,7 @@ + + # ConfigureTimezoneTask + obj = task_objs[0] +- self.assertEqual(obj.implementation._timezone, "Asia/Shanghai") ++ self.assertEqual(obj.implementation._timezone, "Asia/Beijing") + self.assertEqual(obj.implementation._is_utc, False) + # ConfigureNTPTask + obj = task_objs[1] +@@ -238,19 +238,19 @@ + input_isutc=True, + make_adjtime=True, + make_zoneinfo=True, +- expected_symlink="../usr/share/zoneinfo/Asia/Shanghai", ++ expected_symlink="../usr/share/zoneinfo/Asia/Beijing", + expected_adjtime_last_line="UTC") + self._test_timezone_inputs(input_zone="BahBlah", + input_isutc=True, + make_adjtime=True, + make_zoneinfo=True, +- expected_symlink="../usr/share/zoneinfo/Asia/Shanghai", ++ expected_symlink="../usr/share/zoneinfo/Asia/Beijing", + expected_adjtime_last_line="UTC") + self._test_timezone_inputs(input_zone=None, + input_isutc=True, + make_adjtime=True, + make_zoneinfo=True, +- expected_symlink="../usr/share/zoneinfo/Asia/Shanghai", ++ expected_symlink="../usr/share/zoneinfo/Asia/Beijing", + expected_adjtime_last_line="UTC") + + @patch('pyanaconda.modules.timezone.installation.arch.is_s390', return_value=True) diff --git a/anaconda.spec b/anaconda.spec index 6059227..ba1fdc9 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.3 +%define anolis_release .0.4 Summary: Graphical system installer Name: anaconda Version: 33.16.7.12 @@ -25,6 +25,7 @@ Patch0008: 0008-install-fix-kernel-spoke-notify.patch Patch0009: 0001-add-BOOTLOONGARCH64.EFI-for-anaconda-to-support-new-firmware.patch Patch0010: 0009-Fix-smt-description.patch Patch0011: 0010-update-kernel-description.patch +Patch0012: 0011-Set-the-default-timezone-to-Beijing.patch # End of Anolis patches # Versions of required components (done so we make sure the buildrequires @@ -378,6 +379,9 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d %{_prefix}/libexec/anaconda/dd_* %changelog +* Thu May 04 2023 Jacob Wang - 33.16.7.12-1.0.4 +- Set default timezone to Beijing (liwei.glw@alibaba-inc.com) + * Thu Jan 5 2023 wangkaiyuan - 33.16.7.12-1.0.3 - Hide CompatibleKernel in anaconda on Phytium Sever CPU -- Gitee