!167 [sync] PR-165: 提交补丁:支持先判断target(pid文件)是否存在,再执行unlink(可选)
From: @openeuler-sync-bot Reviewed-by: @t_feng Signed-off-by: @t_feng
This commit is contained in:
commit
1342bf24c5
9
dnf.spec
9
dnf.spec
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: dnf
|
Name: dnf
|
||||||
Version: 4.14.0
|
Version: 4.14.0
|
||||||
Release: 8
|
Release: 9
|
||||||
Summary: A software package manager that manages packages on Linux distributions.
|
Summary: A software package manager that manages packages on Linux distributions.
|
||||||
License: GPLv2+ and GPLv2 and GPL
|
License: GPLv2+ and GPLv2 and GPL
|
||||||
URL: https://github.com/rpm-software-management/dnf
|
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
|
Patch9004: fix-dnf-history-undo-error-when-history-sqlite-missing.patch
|
||||||
Patch9005: huawei-lock-file-add-verify-parameter.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
|
%ifarch sw_64
|
||||||
Patch6000: dnf-4.10.0-sw.patch
|
Patch6000: dnf-4.10.0-sw.patch
|
||||||
%endif
|
%endif
|
||||||
@ -247,6 +251,9 @@ popd
|
|||||||
%{_mandir}/man8/%{name}-automatic.8*
|
%{_mandir}/man8/%{name}-automatic.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 10 2023 xiasenlin <xiasenlin1@huawei.com> - 4.14.0-9
|
||||||
|
- DESC:add get-lockfile-exists-before-unlick.patch
|
||||||
|
|
||||||
* Fri Jan 6 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 4.14.0-8
|
* Fri Jan 6 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 4.14.0-8
|
||||||
- DESC: fix build error for loongarch64
|
- DESC: fix build error for loongarch64
|
||||||
|
|
||||||
|
|||||||
24
get-lockfile-exists-before-unlick.patch
Normal file
24
get-lockfile-exists-before-unlick.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
From 5cf9fbe5096c807668da3c1685c917996b91c960 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Duan Pengjie <pengjieduan@gmail.com>
|
||||||
|
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)
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user