summaryrefslogtreecommitdiff
path: root/fix-hostname-info.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-19 03:19:34 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-19 03:19:34 +0000
commite9f07e4582f7977395d5c26d41e3fc97ed9e077c (patch)
tree478a9376a299c9450151b72c29c5c790c1023564 /fix-hostname-info.patch
parenta4252603249fd648f2870ce2dcbaf86ebcf1f118 (diff)
automatic import of anacondaopeneuler20.03
Diffstat (limited to 'fix-hostname-info.patch')
-rw-r--r--fix-hostname-info.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/fix-hostname-info.patch b/fix-hostname-info.patch
new file mode 100644
index 0000000..a217dca
--- /dev/null
+++ b/fix-hostname-info.patch
@@ -0,0 +1,61 @@
+From cc1706cdbcabab80ab867c2a8f5a517884faa048 Mon Sep 17 00:00:00 2001
+From: t_feng <fengtao40@huawei.com>
+Date: Thu, 18 Jun 2020 17:13:47 +0800
+Subject: [PATCH] fix hostname info
+
+---
+ po/zh_CN.po | 6 +++---
+ pyanaconda/core/regexes.py | 2 +-
+ pyanaconda/network.py | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/po/zh_CN.po b/po/zh_CN.po
+index 18b0925..c2216e6 100644
+--- a/po/zh_CN.po
++++ b/po/zh_CN.po
+@@ -4089,11 +4089,11 @@ msgstr "本地主机名不能以英文句号“.”结尾。"
+ #: pyanaconda/network.py:119
+ msgid ""
+ "Host names can only contain the characters 'a-z', 'A-Z', '0-9', '-', or '.', "
+-"parts between periods must contain something and cannot start or end with "
+-"'-'."
++"parts between periods must contain something being 63 or fewer "
++"characters and cannot start or end with '.' and '-'."
+ msgstr ""
+ "主机名只能包含 'a-z'、'A-Z'、 '0-9'、 '-'(英文减号),或者 '.'(英文点号),"
+-"其中两个点号中不能为空且不能以 '-' 开头或结尾。"
++"其中两个点号中不能为空,必须少于64个字符且不能以'.'和'-'开头或结尾。"
+
+ #: pyanaconda/network.py:457
+ msgid "Status not available"
+diff --git a/pyanaconda/core/regexes.py b/pyanaconda/core/regexes.py
+index cc00702..388d1ff 100644
+--- a/pyanaconda/core/regexes.py
++++ b/pyanaconda/core/regexes.py
+@@ -103,7 +103,7 @@ IPV4_NETMASK_WITH_ANCHORS = re.compile("^" + IPV4_NETMASK_WITHOUT_ANCHORS + "$")
+ # with a period, but it can end with one.
+ # This regex uses negative lookahead and lookback assertions to enforce the
+ # hyphen rules and make it way more confusing
+-HOSTNAME_PATTERN_WITHOUT_ANCHORS = r'(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)(?:\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.?)'
++HOSTNAME_PATTERN_WITHOUT_ANCHORS = r'(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)(?:\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*)'
+
+ # URL Hostname
+ # This matches any hostname, IPv4 literal or properly encased IPv6 literal
+diff --git a/pyanaconda/network.py b/pyanaconda/network.py
+index 38fe957..8f04d63 100644
+--- a/pyanaconda/network.py
++++ b/pyanaconda/network.py
+@@ -114,8 +114,8 @@ def is_valid_hostname(hostname, local=False):
+ if not re.match('^' + HOSTNAME_PATTERN_WITHOUT_ANCHORS + '$', hostname):
+ return (False, _("Host names can only contain the characters 'a-z', "
+ "'A-Z', '0-9', '-', or '.', parts between periods "
+- "must contain something and cannot start or end with "
+- "'-'."))
++ "must contain something being 63 or fewer "
++ "characters and cannot start or end with '.' and '-'."))
+
+ return (True, "")
+
+--
+2.23.0
+