Audit FreeBSD packages at summary

This commit is contained in:
Roey Darwish Dror
2018-11-15 11:37:08 +02:00
parent 7a9e1e4bee
commit fa39665bd3
2 changed files with 10 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ use super::terminal::Terminal;
use super::utils::Check; use super::utils::Check;
use failure; use failure;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command;
#[must_use] #[must_use]
pub fn upgrade_freebsd(sudo: &Option<PathBuf>, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> { pub fn upgrade_freebsd(sudo: &Option<PathBuf>, terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
@@ -40,11 +41,6 @@ pub fn upgrade_packages(
.spawn()? .spawn()?
.wait()? .wait()?
.check()?; .check()?;
Executor::new("/usr/sbin/pkg", dry_run)
.arg("audit")
.spawn()?
.wait()?
.check()?;
Ok(()) Ok(())
}().is_ok(); }().is_ok();
@@ -54,3 +50,9 @@ pub fn upgrade_packages(
None None
} }
} }
pub fn audit_packages() -> Result<(), failure::Error> {
println!();
Command::new("/usr/sbin/pkg").args(&["audit", "-Fr"]).spawn()?.wait()?;
Ok(())
}

View File

@@ -456,6 +456,9 @@ fn run() -> Result<(), Error> {
distribution.show_summary(); distribution.show_summary();
} }
} }
#[cfg(target_os = "freebsd")]
freebsd::audit_packages().ok();
} }
if report.data().iter().all(|(_, succeeded)| *succeeded) { if report.data().iter().all(|(_, succeeded)| *succeeded) {