diff --git a/dnf.spec b/dnf.spec index 177c6d8a96c6d148c058f47773879419a2bad6bb..c3726e59e1849c640c620a63f4b021ea61c003ff 100644 --- a/dnf.spec +++ b/dnf.spec @@ -3,7 +3,7 @@ Name: dnf Version: 4.14.0 -Release: 8 +Release: 9 Summary: A software package manager that manages packages on Linux distributions. License: GPLv2+ and GPLv2 and GPL URL: https://github.com/rpm-software-management/dnf @@ -16,6 +16,10 @@ Patch9003: adapt-test-another-process.patch Patch9004: fix-dnf-history-undo-error-when-history-sqlite-missing.patch Patch9005: huawei-lock-file-add-verify-parameter.patch +%if 0%{?check_target_before_unlink} +Patch9006: get-lockfile-exists-before-unlick.patch +%endif + %ifarch sw_64 Patch6000: dnf-4.10.0-sw.patch %endif @@ -247,6 +251,9 @@ popd %{_mandir}/man8/%{name}-automatic.8* %changelog +* Tue Jan 10 2023 xiasenlin - 4.14.0-9 +- DESC:add get-lockfile-exists-before-unlick.patch + * Fri Jan 6 2023 Wenlong Zhang - 4.14.0-8 - DESC: fix build error for loongarch64 diff --git a/get-lockfile-exists-before-unlick.patch b/get-lockfile-exists-before-unlick.patch new file mode 100644 index 0000000000000000000000000000000000000000..ead5c8c063972769bb9f091e489c2696a8189258 --- /dev/null +++ b/get-lockfile-exists-before-unlick.patch @@ -0,0 +1,24 @@ +From 5cf9fbe5096c807668da3c1685c917996b91c960 Mon Sep 17 00:00:00 2001 +From: Duan Pengjie +Date: Wed, 4 Jan 2023 11:51:23 +0800 +Subject: [PATCH] add exists + +--- + dnf/lock.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dnf/lock.py b/dnf/lock.py +index ee7a0db..a94132a 100644 +--- a/dnf/lock.py ++++ b/dnf/lock.py +@@ -161,6 +161,6 @@ class ProcessLock(object): + pid = self._try_lock(my_pid) + + def __exit__(self, *exc_args): +- if self.count == 1: ++ if self.count == 1 and os.path.exists(self.target): + os.unlink(self.target) + self._unlock_thread() +-- +2.37.1 (Apple Git-137.1) +