diff --git a/src/build/mod.rs b/src/build/mod.rs index b91920c..983d1fe 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -314,7 +314,7 @@ pub fn run_source_build( entry.version.full(), entry.distribution ), - source_only: true, + kind: crate::report::TargetKind::Source, tee_log: true, }); diff --git a/src/deb/mod.rs b/src/deb/mod.rs index 512bf94..78b7d8b 100644 --- a/src/deb/mod.rs +++ b/src/deb/mod.rs @@ -12,7 +12,7 @@ use crate::logfmt::{ AptInstallClassifier, AptUpdateClassifier, Classifier, GenericClassifier, MakeClassifier, MmdebstrapClassifier, QuiltClassifier, }; -use crate::report::{BuildTarget, BuildView}; +use crate::report::{BuildTarget, BuildView, TargetKind}; use std::error::Error; use std::path::{Path, PathBuf}; use std::sync::Arc; @@ -256,7 +256,7 @@ async fn build_binary_package_impl( version: &version, target: &format!("{series}/{arch}"), display: format!("Building {package} ({version}) for {series}/{arch}"), - source_only: false, + kind: TargetKind::Binary, tee_log: true, }); diff --git a/src/put/mod.rs b/src/put/mod.rs index 8ffb67b..4ce8d04 100644 --- a/src/put/mod.rs +++ b/src/put/mod.rs @@ -94,7 +94,7 @@ async fn put_impl(opts: &PutOptions<'_>) -> Result<(), Box Result<(), String>; +/// Which flow a target belongs to; names the terminal adapter's tee log +/// (`build-*.log`, `deb-*.log`, `test-*.log`). +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum TargetKind { + /// Source-only build (produces a `.dsc`). + Source, + /// Binary build (produces `.debs`). + Binary, + /// DEP-8 test run (`pkh test`). + Test, +} + /// Identity of the build whose events follow, as announced through /// [`BuildView::target`]. #[derive(Debug, Clone)] @@ -45,9 +57,8 @@ pub struct BuildTarget<'a> { /// "Uploading hello (2.10-3) to ppa:user/ppa"): the wording is the /// flow's, adapters render it verbatim. pub display: String, - /// Whether this is a source-only build (producing a `.dsc`); names the - /// terminal adapter's tee log (`build-*.log` vs `deb-*.log`). - pub source_only: bool, + /// The flow driving the events; names the terminal adapter's tee log. + pub kind: TargetKind, /// Whether the view should tee raw subprocess output to its log file. /// Flows without subprocess output (uploads) pass `false` and create /// no log file. diff --git a/src/ui/deb.rs b/src/ui/deb.rs index c5a06b5..b05a320 100644 --- a/src/ui/deb.rs +++ b/src/ui/deb.rs @@ -272,7 +272,11 @@ impl crate::report::BuildView for DebUi { self.shared.top.set_prefix(target.display.clone()); } if target.tee_log { - let kind = if target.source_only { "build" } else { "deb" }; + let kind = match target.kind { + crate::report::TargetKind::Source => "build", + crate::report::TargetKind::Binary => "deb", + crate::report::TargetKind::Test => "test", + }; self.open_log( kind, target.package,