Add exception capture
This commit is contained in:
parent
a5d4496684
commit
405261dd10
5
dnf.spec
5
dnf.spec
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: dnf
|
Name: dnf
|
||||||
Version: 4.14.0
|
Version: 4.14.0
|
||||||
Release: 10
|
Release: 11
|
||||||
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
|
||||||
@ -252,6 +252,9 @@ popd
|
|||||||
%{_mandir}/man8/%{name}-automatic.8*
|
%{_mandir}/man8/%{name}-automatic.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Feb 22 2023 xiasenlin <xiasenlin1@huawei.com> - 4.14.0-11
|
||||||
|
- DESC:Add exception capture to get-lockfile-exists-before-unlick.patch
|
||||||
|
|
||||||
* Fri Feb 17 2023 chenhaixing <chenhaixing@huawei.com> 4.14.0-10
|
* Fri Feb 17 2023 chenhaixing <chenhaixing@huawei.com> 4.14.0-10
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
|
|||||||
@ -1,24 +1,29 @@
|
|||||||
From 5cf9fbe5096c807668da3c1685c917996b91c960 Mon Sep 17 00:00:00 2001
|
From a569c1cd79d225f928e00b5ab3e0084ddaa41334 Mon Sep 17 00:00:00 2001
|
||||||
From: Duan Pengjie <pengjieduan@gmail.com>
|
From: small_leek <xiasenlin1@huawei.com>
|
||||||
Date: Wed, 4 Jan 2023 11:51:23 +0800
|
Date: Tue, 21 Feb 2023 20:29:39 +0800
|
||||||
Subject: [PATCH] add exists
|
Subject: [PATCH] add patch
|
||||||
|
|
||||||
---
|
---
|
||||||
dnf/lock.py | 2 +-
|
dnf/lock.py | 8 ++++++--
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/dnf/lock.py b/dnf/lock.py
|
diff --git a/dnf/lock.py b/dnf/lock.py
|
||||||
index ee7a0db..a94132a 100644
|
index ee7a0db..851030e 100644
|
||||||
--- a/dnf/lock.py
|
--- a/dnf/lock.py
|
||||||
+++ b/dnf/lock.py
|
+++ b/dnf/lock.py
|
||||||
@@ -161,6 +161,6 @@ class ProcessLock(object):
|
@@ -161,6 +161,10 @@ class ProcessLock(object):
|
||||||
pid = self._try_lock(my_pid)
|
pid = self._try_lock(my_pid)
|
||||||
|
|
||||||
def __exit__(self, *exc_args):
|
def __exit__(self, *exc_args):
|
||||||
- if self.count == 1:
|
- if self.count == 1:
|
||||||
+ if self.count == 1 and os.path.exists(self.target):
|
- os.unlink(self.target)
|
||||||
os.unlink(self.target)
|
+ if self.count == 1 and os.path.exists(self.target):
|
||||||
self._unlock_thread()
|
+ try:
|
||||||
--
|
+ os.unlink(self.target)
|
||||||
2.37.1 (Apple Git-137.1)
|
+ except FileNotFoundError as err:
|
||||||
|
+ msg = _('No %s existed, please check!') % (self.target)
|
||||||
|
+ logger.warning(msg)
|
||||||
|
self._unlock_thread()
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user