diff --git a/src/build/mod.rs b/src/build/mod.rs index 0415194..730985e 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -389,7 +389,9 @@ pub fn run_source_build( }; let report = crate::debian::deps::check_build_depends(&ctrl, &check_opts)?; if !report.is_ok() { - eprintln!("{}", report.message()); + // The diagnostics travel inside the error (its Display carries + // report.message()); main renders it and maps the type to exit + // status 3, like dpkg-buildpackage. return Err(Box::new(crate::debian::deps::UnmetBuildDependencies( report, ))); diff --git a/src/changelog.rs b/src/changelog.rs index 64dd429..c631d13 100644 --- a/src/changelog.rs +++ b/src/changelog.rs @@ -20,7 +20,7 @@ pub fn generate_entry( // Parse existing changelog to get current (old) version let (package, old_version, series) = parse_changelog_header(&changelog_path)?; - println!("Found package: {}, version: {}", package, old_version); + log::info!("Found package: {}, version: {}", package, old_version); // Open git repo, and find commits since last version tag let repo_path = if let Some(path) = cwd { @@ -56,7 +56,7 @@ pub fn generate_entry( prepend_to_file(&changelog_path, &new_entry)?; - println!("Added new changelog entry to {}", changelog_path.display()); + log::info!("Added new changelog entry to {}", changelog_path.display()); Ok(()) } diff --git a/src/debian/deps.rs b/src/debian/deps.rs index 71602a9..097141f 100644 --- a/src/debian/deps.rs +++ b/src/debian/deps.rs @@ -890,7 +890,11 @@ pub struct UnmetBuildDependencies(pub UnmetReport); impl std::fmt::Display for UnmetBuildDependencies { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "build dependencies/conflicts unsatisfied; aborting") + write!( + f, + "build dependencies/conflicts unsatisfied; aborting\n{}", + self.0.message() + ) } }