9 Star 1 Fork 23

src-anolis-os/anaconda

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0011-Set-the-default-timezone-to-Beijing.patch 5.85 KB
一键复制 编辑 原始数据 按行查看 历史
Jacob Wang 提交于 2023-05-04 22:29 . Set default timezone to Beijing
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)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/anaconda.git
git@gitee.com:src-anolis-os/anaconda.git
src-anolis-os
anaconda
anaconda
a8

搜索帮助