!108 [sync] PR-106: fix dnf error when history sqlite missing
From: @openeuler-sync-bot Reviewed-by: @t_feng Signed-off-by: @t_feng
This commit is contained in:
commit
642a5b5d97
@ -0,0 +1,25 @@
|
||||
From 0fefe7c1ad1d9c60f6159b14871837043b5e0d1f Mon Sep 17 00:00:00 2001
|
||||
From: zhanghaolian <65838930+iWhy98@users.noreply.github.com>
|
||||
Date: Tue, 25 Jan 2022 15:41:16 +0800
|
||||
Subject: [PATCH] dnf:fix dnf mark error when history sqlite missing
|
||||
|
||||
Conflict: NA
|
||||
Reference:https://github.com/rpm-software-management/dnf/pull/1808
|
||||
|
||||
---
|
||||
dnf/cli/commands/mark.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dnf/cli/commands/mark.py b/dnf/cli/commands/mark.py
|
||||
index ec16b738dc..cb1f91c135 100644
|
||||
--- a/dnf/cli/commands/mark.py
|
||||
+++ b/dnf/cli/commands/mark.py
|
||||
@@ -89,7 +89,7 @@ def run(self):
|
||||
|
||||
old = self.base.history.last()
|
||||
if old is None:
|
||||
- rpmdb_version = self.sack._rpmdb_version()
|
||||
+ rpmdb_version = self.base.sack._rpmdb_version()
|
||||
else:
|
||||
rpmdb_version = old.end_rpmdb_version
|
||||
|
||||
8
dnf.spec
8
dnf.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: dnf
|
||||
Version: 4.2.23
|
||||
Release: 7
|
||||
Release: 8
|
||||
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
|
||||
@ -20,6 +20,9 @@ Patch7: Pass-the-package-to-rpmkeys-stdin.patch
|
||||
Patch8: Use-rpmkeys-alone-to-verify-signature.patch
|
||||
Patch9: Add-fail_fast-parameter-to-download_payloads-methods.patch
|
||||
Patch10: Fix-reporting-irrecoverable-errors-on-packages-downl.patch
|
||||
Patch6000: backport-fix-dnf-mark-error-when-history-sqlite-missing.patch
|
||||
|
||||
Patch9000: fix-dnf-history-undo-error-when-history-sqlite-missing.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: cmake gettext systemd bash-completion python3-sphinx
|
||||
@ -210,6 +213,9 @@ popd
|
||||
%{_mandir}/man8/%{name}-automatic.8*
|
||||
|
||||
%changelog
|
||||
* Tue Mar 29 2022 yangcheng <yangcheng87@h-partners.com> - 4.2.23-8
|
||||
- fix dnf error when history sqlite missing
|
||||
|
||||
* Thu Mar 10 2022 zhangshaoning <zhangshaoning@uniontech.com> - 4.2.23-7
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
26
fix-dnf-history-undo-error-when-history-sqlite-missing.patch
Normal file
26
fix-dnf-history-undo-error-when-history-sqlite-missing.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 57455df96b6dc9f8c90e8d783a2654896ac483e5 Mon Sep 17 00:00:00 2001
|
||||
From: zhujunhao <zhujunhao11@huawei.com>
|
||||
Date: Thu, 17 Mar 2022 11:40:59 +0800
|
||||
Subject: [PATCH]
|
||||
fix-dnf-history-undo-error-when-history-sqlite-missing
|
||||
|
||||
---
|
||||
dnf/cli/commands/__init__.py | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/dnf/cli/commands/__init__.py b/dnf/cli/commands/__init__.py
|
||||
index 86f560b..088e958 100644
|
||||
--- a/dnf/cli/commands/__init__.py
|
||||
+++ b/dnf/cli/commands/__init__.py
|
||||
@@ -954,6 +954,9 @@ class HistoryCommand(Command):
|
||||
s = s[4:]
|
||||
transaction_id = int(s)
|
||||
if transaction_id <= 0:
|
||||
+ if not self.output.history.last():
|
||||
+ logger.critical("Not found given transaction ID")
|
||||
+ raise ValueError
|
||||
transaction_id += self.output.history.last().tid
|
||||
return transaction_id
|
||||
|
||||
--
|
||||
2.27.0
|
||||
Loading…
x
Reference in New Issue
Block a user