1 Star 0 Fork 58

yangcheng1203/dnf

forked from src-openEuler/dnf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-dnf-history-undo-error-when-history-sqlite-missing.patch 925 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 4f0e1d880f5e0f28b623f3be094552553384cf98 Mon Sep 17 00:00:00 2001
From: cjavaphp <1010881517@qq.com>
Date: Fri, 18 Mar 2022 16:29:20 +0800
Subject: [PATCH] fix dnf history undo error
fix dnf history undo error when history sqlite missing
---
dnf/cli/commands/history.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dnf/cli/commands/history.py b/dnf/cli/commands/history.py
index 293d93f..dd2ea6f 100644
--- a/dnf/cli/commands/history.py
+++ b/dnf/cli/commands/history.py
@@ -265,6 +265,9 @@ class HistoryCommand(commands.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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangcheng1203/dnf.git
git@gitee.com:yangcheng1203/dnf.git
yangcheng1203
dnf
dnf
master

搜索帮助