From c355e004ec28cc757a676f7a5f8a1b5c3cfb1e1f Mon Sep 17 00:00:00 2001 From: xuezhixin Date: Wed, 6 Nov 2024 10:12:05 +0800 Subject: [PATCH] process os version and os name --- 0043-process-os-version-and-os-name.patch | 38 +++++++++++++++++++++++ migration-tools.spec | 7 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0043-process-os-version-and-os-name.patch diff --git a/0043-process-os-version-and-os-name.patch b/0043-process-os-version-and-os-name.patch new file mode 100644 index 0000000..1272589 --- /dev/null +++ b/0043-process-os-version-and-os-name.patch @@ -0,0 +1,38 @@ +From 1683b7dbd84ce4bdc399d3da731c9c5b22ed07fe Mon Sep 17 00:00:00 2001 +From: xuezhixin +Date: Fri, 10 Nov 2023 14:33:19 +0800 +Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=B3=BB=E7=BB=9F=E7=89=88?= + =?UTF-8?q?=E6=9C=AC=E5=92=8C=E7=B3=BB=E7=BB=9F=E5=90=8D=E7=A7=B0?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + sysmig_agent/migration.py | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/sysmig_agent/migration.py b/sysmig_agent/migration.py +index ebee24d..fec143a 100644 +--- a/sysmig_agent/migration.py ++++ b/sysmig_agent/migration.py +@@ -221,3 +221,17 @@ def get_old_osnameversion(): + return str(state) + except: + return None ++ ++ ++def get_old_osname(): ++ nv = get_old_osnameversion() ++ oldosname = re.sub(r'[0-9]', '', nv) ++ return oldosname ++ ++ ++def get_old_osversion(): ++ nv = get_old_osnameversion() ++ oldosversion = re.sub(r'[A-Z,a-z]', '', nv) ++ return oldosversion ++ ++ +-- +2.20.1 + diff --git a/migration-tools.spec b/migration-tools.spec index c3e4938..b8e69dd 100644 --- a/migration-tools.spec +++ b/migration-tools.spec @@ -1,6 +1,6 @@ Name: migration-tools Version: 1.0.2 -Release: 42 +Release: 43 License: MulanPSL-2.0 Summary: A tool to help users migrate the Centos system to the UOS system and openEuler system Source0: %{name}-%{version}.tar.gz @@ -49,6 +49,8 @@ Patch39: 0039-repository-file-choose-kernel-version-to-migration.patch Patch40: 0040-intial-logfile-and-tmpfile.patch Patch41: 0041-get-migration-status-from-database.patch Patch42: 0042-get-initial-os-version-from-agent_info-interface.patch +Patch43: 0043-process-os-version-and-os-name.patch + BuildArch: noarch BuildRequires: systemd @@ -147,6 +149,9 @@ rm -rf /usr/bin/migration-tools %endif %changelog +* Tue Nov 5 2024 xuezhixin - 1.0.2-43 +- 0043-process-os-version-and-os-name.patch + * Tue Nov 5 2024 xuezhixin - 1.0.2-42 - 0042-get-initial-os-version-from-agent_info-interface.patch -- Gitee