!147 [sync] PR-145: fix dnf-data downgrade confilct with dnf
From: @openeuler-sync-bot Reviewed-by: @anonymous_z Signed-off-by: @anonymous_z
This commit is contained in:
commit
75c636e576
26
dnf.spec
26
dnf.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: dnf
|
||||
Version: 4.14.0
|
||||
Release: 4
|
||||
Release: 5
|
||||
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
|
||||
@ -14,6 +14,7 @@ Patch9001: fix-pid-file-residue.patch
|
||||
Patch9002: add-rpm-transaction-debuginfo.patch
|
||||
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
|
||||
|
||||
%ifarch sw_64
|
||||
Patch6000: dnf-4.10.0-sw.patch
|
||||
@ -67,7 +68,7 @@ Python 3 interface to DNF.
|
||||
%package data
|
||||
Summary: Common data and configuration files for DNF
|
||||
Requires: libreport-filesystem
|
||||
Obsoletes: %{name}-conf < %{version}-%{release}
|
||||
Obsoletes: %{name}-conf < %{version}-%{release} %{name} < %{version}-%{release}
|
||||
Provides: %{name}-conf = %{version}-%{release}
|
||||
|
||||
%description data
|
||||
@ -144,28 +145,32 @@ popd
|
||||
|
||||
%post
|
||||
%systemd_post dnf-makecache.timer
|
||||
|
||||
%preun
|
||||
%systemd_preun dnf-makecache.timer
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart dnf-makecache.timer
|
||||
|
||||
%post automatic
|
||||
%systemd_post dnf-automatic.timer
|
||||
%systemd_post dnf-automatic-notifyonly.timer
|
||||
%systemd_post dnf-automatic-download.timer
|
||||
%systemd_post dnf-automatic-install.timer
|
||||
|
||||
%preun
|
||||
%preun automatic
|
||||
%systemd_preun dnf-automatic.timer
|
||||
%systemd_preun dnf-makecache.timer
|
||||
%systemd_preun dnf-automatic-notifyonly.timer
|
||||
%systemd_preun dnf-automatic-download.timer
|
||||
%systemd_preun dnf-automatic-install.timer
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart dnf-makecache.timer
|
||||
%postun automatic
|
||||
%systemd_postun_with_restart dnf-automatic.timer
|
||||
%systemd_postun_with_restart dnf-automatic-notifyonly.timer
|
||||
%systemd_postun_with_restart dnf-automatic-download.timer
|
||||
%systemd_postun_with_restart dnf-automatic-install.timer
|
||||
|
||||
%files
|
||||
%license COPYING PACKAGE-LICENSING
|
||||
%doc AUTHORS README.rst
|
||||
%{_bindir}/%{name}
|
||||
%{_sysconfdir}/bash_completion.d/%{name}
|
||||
%{_unitdir}/%{name}-makecache.timer
|
||||
@ -210,14 +215,12 @@ popd
|
||||
%ghost %attr(644,-,-) %{_sharedstatedir}/%{name}/groups.json
|
||||
%ghost %attr(755,-,-) %dir %{_sharedstatedir}/%{name}/yumdb
|
||||
%ghost %attr(755,-,-) %dir %{_sharedstatedir}/%{name}/history
|
||||
%{_mandir}/man5/%{name}.conf.5*
|
||||
%{_tmpfilesdir}/%{name}.conf
|
||||
%{_sysconfdir}/libreport/events.d/collect_dnf.conf
|
||||
|
||||
%files automatic
|
||||
%{_bindir}/%{name}-automatic
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/automatic.conf
|
||||
%{_mandir}/man8/%{name}-automatic.8*
|
||||
%{_unitdir}/%{name}-automatic.service
|
||||
%{_unitdir}/%{name}-automatic.timer
|
||||
%{_unitdir}/%{name}-automatic-notifyonly.service
|
||||
@ -243,6 +246,9 @@ popd
|
||||
%{_mandir}/man8/%{name}-automatic.8*
|
||||
|
||||
%changelog
|
||||
* Tue Dec 13 2022 chenhaixing <chenhaixing@huawei.com> - 4.14.0-5
|
||||
- DESC:fix dnf-data downgrade confilct with dnf
|
||||
|
||||
* Fri Dec 9 2022 chenhaixing <chenhaixing@huawei.com> - 4.14.0-4
|
||||
- DESC:add sw64 and loongarch support for dnf
|
||||
|
||||
|
||||
29
huawei-lock-file-add-verify-parameter.patch
Normal file
29
huawei-lock-file-add-verify-parameter.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From ec8644e42ec2e0d0f98ea1aee3859b2c510f0cc0 Mon Sep 17 00:00:00 2001
|
||||
From: chenhaixing <chenhaixing@huawei.com>
|
||||
Date: Sat, 4 Jun 2022 17:49:53 +0800
|
||||
Subject: [PATCH] verify-parameter
|
||||
|
||||
---
|
||||
dnf/lock.py | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/lock.py b/dnf/lock.py
|
||||
index ab05a3b..12378ec 100644
|
||||
--- a/dnf/lock.py
|
||||
+++ b/dnf/lock.py
|
||||
@@ -116,7 +116,12 @@ class ProcessLock(object):
|
||||
return pid
|
||||
|
||||
try:
|
||||
- with open('/proc/%d/status' % old_pid) as f:
|
||||
+ old_pid_path = f'/proc/{old_pid}/status'
|
||||
+ true_old_pid_path = os.path.realpath(old_pid_path)
|
||||
+ if not true_old_pid_path.startswith("/proc/"):
|
||||
+ return old_pid
|
||||
+
|
||||
+ with open(true_old_pid_path) as f:
|
||||
if not re.findall(r'Name:(.*)(dnf|yum)', f.read(), re.I):
|
||||
os.write(fd, str(pid).encode('utf-8'))
|
||||
return pid
|
||||
--
|
||||
2.27.0
|
||||
Loading…
x
Reference in New Issue
Block a user