report: reproduce the pre-refactor CLI output through the ports
Instead of carrying raw UI in core, the ports now represent everything
the CLI used to do inline:
- Prompter::present shows context outside of a question (the wizard
summary screen, the vendoring notice spacing); TerminalPrompter
prints it on stdout exactly like the println!s it replaces, server
embeds forward it as a display event.
- generate_entry returns the generated entry (package, versions,
series, path) instead of printing; the CLI renders the same lines.
- BuildTarget carries a flow-composed display line and a tee_log flag:
the terminal adapter renders it verbatim ("Building source package
...", "Building ... for series/arch", "Uploading ... to ...") and
uploads open no build log.
- The unmet build-dependency diagnostics are rendered by the CLI from
the typed error, in the original order (details, then summary).
- --verbose constructs no live view at all (an idle widget used to
linger), and the re-vendor offer only logs when it is actually
asked, so headless runs print the error exactly once.
This commit is contained in:
+11
-18
@@ -83,8 +83,7 @@ impl DebUi {
|
||||
let pb = multi.add(ProgressBar::new(0));
|
||||
pb.enable_steady_tick(Duration::from_millis(80));
|
||||
pb.set_style(spinner_style());
|
||||
// Neutral identity until a `target` event names the build
|
||||
pb.set_prefix("pkh");
|
||||
pb.set_prefix("Building package");
|
||||
pb.set_message("(starting…)");
|
||||
pb
|
||||
} else {
|
||||
@@ -270,24 +269,18 @@ impl DebUi {
|
||||
/// widget.
|
||||
impl crate::report::BuildView for DebUi {
|
||||
fn target(&self, target: BuildTarget<'_>) {
|
||||
let kind = if target.source_only {
|
||||
"source package "
|
||||
} else {
|
||||
""
|
||||
};
|
||||
if self.shared.enabled {
|
||||
self.shared.top.set_prefix(format!(
|
||||
"Building {kind}{} ({}) for {}",
|
||||
target.package, target.version, target.target
|
||||
));
|
||||
self.shared.top.set_prefix(target.display.clone());
|
||||
}
|
||||
if target.tee_log {
|
||||
let kind = if target.source_only { "build" } else { "deb" };
|
||||
self.open_log(
|
||||
kind,
|
||||
target.package,
|
||||
target.version,
|
||||
&format!("for {}", target.target),
|
||||
);
|
||||
}
|
||||
let log_kind = if target.source_only { "build" } else { "deb" };
|
||||
self.open_log(
|
||||
log_kind,
|
||||
target.package,
|
||||
target.version,
|
||||
&format!("for {}", target.target),
|
||||
);
|
||||
}
|
||||
|
||||
fn phase(&self, name: &str, classifier: Box<dyn Classifier>) {
|
||||
|
||||
@@ -167,6 +167,10 @@ impl crate::report::Prompter for TerminalPrompter {
|
||||
println!("{key_type} key fingerprint is {fingerprint}.");
|
||||
confirm("Accept and store this host key?", false).unwrap_or(false)
|
||||
}
|
||||
|
||||
fn present(&self, text: &str) {
|
||||
println!("{text}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Run `prompt` with the terminal in raw mode, always restoring it
|
||||
|
||||
Reference in New Issue
Block a user