From 9f70ab9c13f3007e295c01fafd8bfc921b75e9ca Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 30 Mar 2020 16:58:09 -0400 Subject: [PATCH] nixenv: filter out user setting warninsg too --- ofborg/src/nix.rs | 2 +- ofborg/src/nixenv.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 3f438a3..49d05f9 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -353,7 +353,7 @@ fn lines_from_file(file: fs::File) -> Vec { .collect() } -fn is_user_setting_warning(line: &str) -> bool { +pub fn is_user_setting_warning(line: &str) -> bool { let line = line.trim(); line.starts_with("warning: ignoring the user-specified setting '") && line.ends_with("because it is a restricted setting and you are not a trusted user") diff --git a/ofborg/src/nixenv.rs b/ofborg/src/nixenv.rs index fee1b8b..656dd41 100644 --- a/ofborg/src/nixenv.rs +++ b/ofborg/src/nixenv.rs @@ -43,6 +43,7 @@ impl HydraNixEnv { .collect::, _>>()? .into_iter() .filter(|msg| msg.trim().len() > 0) + .filter(|line| !nix::is_user_setting_warning(line)) .collect::>(); if evaluation_errors.len() > 0 {