From e905327c94775dc97192e4c8f613c77cbcf8983e Mon Sep 17 00:00:00 2001 From: wangcichen Date: Tue, 16 May 2023 23:56:02 +0800 Subject: [PATCH] Fix bug with existing symlink in handleyumconfig --- ...-existing-symlink-in-handleyumconfig.patch | 37 +++++++++++++++++++ leapp-repository.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0044-Fix-bug-with-existing-symlink-in-handleyumconfig.patch diff --git a/0044-Fix-bug-with-existing-symlink-in-handleyumconfig.patch b/0044-Fix-bug-with-existing-symlink-in-handleyumconfig.patch new file mode 100644 index 0000000..9f621ea --- /dev/null +++ b/0044-Fix-bug-with-existing-symlink-in-handleyumconfig.patch @@ -0,0 +1,37 @@ +From b9b3830dfeb2626bd936585150aeffb558c37a60 Mon Sep 17 00:00:00 2001 +From: wangcichen +Date: Tue, 16 May 2023 23:20:44 +0800 +Subject: [PATCH] Fix bug with existing symlink in handleyumconfig + +Signed-off-by: wangcichen +--- + repos/system_upgrade/el7toel8/tools/handleyumconfig | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/repos/system_upgrade/el7toel8/tools/handleyumconfig b/repos/system_upgrade/el7toel8/tools/handleyumconfig +index af0bc48..67dc94d 100755 +--- a/repos/system_upgrade/el7toel8/tools/handleyumconfig ++++ b/repos/system_upgrade/el7toel8/tools/handleyumconfig +@@ -10,15 +10,17 @@ is_dir_empty() { + + handle_dir() { + # Move all files from $1 to $2 when the /etc/yum/$1 is not empty ++ # and not already a link + # Then remove the $1 directory and relink it to $2 + # param $1: dirname under /etc/yum path + # param $2: dirname under /etc/dnf path ++ if [ "$(readlink /etc/yum/$1)" == "../dnf/$2" ]; then ++ return ++ fi + if ! is_dir_empty "/etc/yum/$1"; then + mv /etc/yum/$1/* /etc/dnf/$2/ + fi + +- # FIXME: do not care whether these were already symlinks for now +- # just remove it + rm -rf /etc/yum/$1 + + #relink +-- +2.22.0 + diff --git a/leapp-repository.spec b/leapp-repository.spec index 20eead2..4499b6b 100644 --- a/leapp-repository.spec +++ b/leapp-repository.spec @@ -11,7 +11,7 @@ }\ py2_byte_compile "%1" "%2"} -%define anolis_release 22 +%define anolis_release 23 Name: leapp-repository Version: 0.13.0 @@ -69,6 +69,7 @@ Patch40: 0040-Fix-colloecting-virtio-nic-info-error.patch Patch41: 0041-Add-python-devel-version-check-and-update.patch Patch42: 0042-Report-inhibitor-message-to-SMC.patch Patch43: 0043-Fix-the-memory-unit-error.patch +Patch44: 0044-Fix-bug-with-existing-symlink-in-handleyumconfig.patch BuildArch: noarch BuildRequires: python-devel @@ -196,6 +197,9 @@ done; # no files here %changelog +* Thu May 18 2023 Cichen Wang - 0.13.0-2.23 +- Fix bug with existing symlink in handleyumconfig + * Fri May 12 2023 wangzhe - 0.13.0-2.22 - Fix the memory unit error -- Gitee