代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dnf 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 7438ca37b6e688637a87cbdc87490e70a61e1829 Mon Sep 17 00:00:00 2001
From: fengtao40 <fengtao40@huawei.com>
Date: Sat, 13 Jun 2020 16:54:09 +0800
Subject: [PATCH] unlock-pidfile-if-current-proccess-is-NOT-dnf
---
dnf/lock.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/dnf/lock.py b/dnf/lock.py
index 13d8c27..589aa0a 100644
--- a/dnf/lock.py
+++ b/dnf/lock.py
@@ -32,6 +32,7 @@ import logging
import os
import threading
import time
+import re
logger = logging.getLogger("dnf")
@@ -106,6 +107,19 @@ class ProcessLock(object):
if old_pid == pid:
# already locked by this process
return pid
+
+ try:
+ with open('/proc/%d/status' % old_pid) as f:
+ for line in f:
+ if not re.match(r'Name:(.*)(dnf|yum)$', line, re.I):
+ os.write(fd, str(pid).encode('utf-8'))
+ return pid
+ except Exception as e:
+ msg = _('Malformed lock file found: %s.\n'
+ 'But pid in lock file is invalid '
+ 'Ensure no other dnf/yum process is running and '
+ 'remove the lock file manually.') % (self.target)
+ raise LockError(msg)
if not os.access('/proc/%d/stat' % old_pid, os.F_OK):
# locked by a dead process, write our pid
--
2.18.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。