137: Fix FreeBSD r=r-darwish a=r-darwish



Co-authored-by: Roey Darwish Dror <roey.ghost@gmail.com>
This commit is contained in:
bors[bot]
2019-03-13 12:12:10 +00:00
3 changed files with 7 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ main() {
cargo fmt --all -- --check
cross clippy --all-targets -- -D warnings
cross clippy --all-targets --all-features -- -D warnings
cross check --target $TARGET --release --all-features
if [ ! -z $DISABLE_TESTS ]; then
cross test

View File

@@ -158,7 +158,7 @@ fn run() -> Result<(), Error> {
execute(
&mut report,
"FreeBSD Packages",
|| freebsd::upgrade_packages(&sudo, run_type),
|| freebsd::upgrade_packages(sudo.as_ref(), run_type),
config.no_retry(),
)?;
#[cfg(unix)]
@@ -410,7 +410,7 @@ fn run() -> Result<(), Error> {
execute(
&mut report,
"FreeBSD Upgrade",
|| freebsd::upgrade_freebsd(&sudo, run_type),
|| freebsd::upgrade_freebsd(sudo.as_ref(), run_type),
config.no_retry(),
)?;
}

View File

@@ -1,11 +1,12 @@
use crate::error::{Error, ErrorKind};
use crate::executor::RunType;
use crate::terminal::{print_separator, print_warning};
use crate::terminal::print_separator;
use crate::utils::require_option;
use failure::ResultExt;
use std::path::PathBuf;
use std::process::Command;
pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(), Error> {
pub fn upgrade_freebsd(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
let sudo = require_option(sudo)?;
print_separator("FreeBSD Update");
run_type
@@ -14,7 +15,7 @@ pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(),
.check_run()
}
pub fn upgrade_packages(sudo: &Option<PathBuf>, run_type: RunType) -> Result<(), Error> {
pub fn upgrade_packages(sudo: Option<&PathBuf>, run_type: RunType) -> Result<(), Error> {
let sudo = require_option(sudo)?;
print_separator("FreeBSD Packages");
run_type.execute(sudo).args(&["/usr/sbin/pkg", "upgrade"]).check_run()