diff --git a/Cargo.toml b/Cargo.toml index c9f48fb..4fac2f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } rpm-rs = { git = "https://git.zhgsun.com:8089/jiachao2130/rpm-rs.git", version = "0.1.0" } lazy_static = { version = "1.5" } +ccutils = { git = "https://git.zhgsun.com:8089/jiachao2130/ccutils.git", version = "0.1.0" } diff --git a/src/analyzer/mod.rs b/src/analyzer/mod.rs index b3c02a2..0aa1f98 100644 --- a/src/analyzer/mod.rs +++ b/src/analyzer/mod.rs @@ -1,6 +1,8 @@ use std::collections::{HashMap, HashSet}; +use std::process::Command; use std::str::FromStr; +use ccutils::cmd::IsOk; use cvrf_xmlparser::{Severity, CUSA}; use lazy_static::lazy_static; 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<()> { + let cmd = Command::new("dnf") + .arg("updateinfo") + .output() + .expect("执行 `dnf udpateinfo` 命令失败"); + + match cmd.result() { + Ok(res) => println!("{res}"), + Err(err) => eprintln!("{err}"), + } + Ok(()) }