update: _dnf_summary

Signed-off-by: Jia Chao <jiachao2130@126.com>
This commit is contained in:
Jia Chao 2024-09-12 10:52:27 +08:00
parent e5b9f185c5
commit bb88e5f0b8
2 changed files with 13 additions and 0 deletions

View File

@ -16,3 +16,4 @@ updateinfo-xmlparser = { git = "https://git.zhgsun.com:8089/jiachao2130/updatein
cvrf-xmlparser = { git = "https://git.zhgsun.com:8089/jiachao2130/cvrf-xmlparser.git", version = "0.1.0" } cvrf-xmlparser = { git = "https://git.zhgsun.com:8089/jiachao2130/cvrf-xmlparser.git", version = "0.1.0" }
rpm-rs = { git = "https://git.zhgsun.com:8089/jiachao2130/rpm-rs.git", version = "0.1.0" } rpm-rs = { git = "https://git.zhgsun.com:8089/jiachao2130/rpm-rs.git", version = "0.1.0" }
lazy_static = { version = "1.5" } lazy_static = { version = "1.5" }
ccutils = { git = "https://git.zhgsun.com:8089/jiachao2130/ccutils.git", version = "0.1.0" }

View File

@ -1,6 +1,8 @@
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::process::Command;
use std::str::FromStr; use std::str::FromStr;
use ccutils::cmd::IsOk;
use cvrf_xmlparser::{Severity, CUSA}; use cvrf_xmlparser::{Severity, CUSA};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use rpm_rs::rpm::{get_installed_packages, Package}; use rpm_rs::rpm::{get_installed_packages, Package};
@ -338,6 +340,16 @@ fn summary(cli: &Cli) -> crate::Result<()> {
} }
fn _dnf_summary(_cli: &Cli) -> crate::Result<()> { fn _dnf_summary(_cli: &Cli) -> crate::Result<()> {
let cmd = Command::new("dnf")
.arg("updateinfo")
.output()
.expect("执行 `dnf udpateinfo` 命令失败");
match cmd.result() {
Ok(res) => println!("{res}"),
Err(err) => eprintln!("{err}"),
}
Ok(()) Ok(())
} }