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:
+15
-5
@@ -26,7 +26,7 @@ use crate::debian::checksums::FileChecksums;
|
||||
use crate::debian::control::ControlInfo;
|
||||
use crate::debian::version::DebianVersion;
|
||||
use crate::launchpad;
|
||||
use crate::report::{BuildView, Prompter};
|
||||
use crate::report::{BuildTarget, BuildView, Prompter};
|
||||
|
||||
/// Everything `put` needs to run.
|
||||
pub struct PutOptions<'a> {
|
||||
@@ -89,10 +89,20 @@ async fn put_impl(opts: &PutOptions<'_>) -> Result<(), Box<dyn std::error::Error
|
||||
};
|
||||
let changes = changes::parse(&changes_path)?;
|
||||
|
||||
opts.view.message(&format!(
|
||||
"Uploading {} {} to {}",
|
||||
changes.source, changes.version, target.label
|
||||
));
|
||||
// The summary line stays up for the whole flow: rendered as the view's
|
||||
// persistent status, with the per-step messages below it
|
||||
opts.view.target(BuildTarget {
|
||||
package: &changes.source,
|
||||
version: &changes.version,
|
||||
target: &target.label,
|
||||
display: format!(
|
||||
"Uploading {} {} to {}",
|
||||
changes.source, changes.version, target.label
|
||||
),
|
||||
source_only: false,
|
||||
// An upload runs no subprocess: nothing to tee
|
||||
tee_log: false,
|
||||
});
|
||||
changes::validate(&changes)?;
|
||||
|
||||
// Pre-flight checks for everything the upload queue only rejects after
|
||||
|
||||
Reference in New Issue
Block a user