build: live view for source builds, pin LC_ALL for the pipeline
Route 'pkh build' through the DebUi capture machinery 'pkh deb' already uses instead of letting dpkg-source inherit the terminal: - pin LANG=C and LC_ALL=C so dpkg-source emits deterministic English diagnostics regardless of the session locale; - new DpkgSourceClassifier rewrites info:/warning:/error: lines into colored pane entries, telling benign tar warnings from failures; - DebUi generalizes for reuse (arbitrary phase labels, build-specific log naming); run_source_build() drives phases and pipes subprocess output through the sink when a UI is present; - glyph-free house-style summaries: 'Built in Ns:' plus artifact paths relative to cwd; failures print captured errors + log path; - drop/capitalize pipeline chatter, add 'pkh build --verbose' to bypass the view like 'pkh deb --verbose'.
This commit is contained in:
+20
-3
@@ -58,7 +58,11 @@ fn main() {
|
||||
.arg(arg!(--backport "This changelog is for a backport entry").required(false))
|
||||
.arg(arg!(-v --version <version> "Target version").required(false)),
|
||||
)
|
||||
.subcommand(Command::new("build").about("Build the source package (into a .dsc)"))
|
||||
.subcommand(
|
||||
Command::new("build")
|
||||
.about("Build the source package (into a .dsc)")
|
||||
.arg(arg!(--verbose "Show raw tool output instead of the live build view").required(false)),
|
||||
)
|
||||
.subcommand(
|
||||
Command::new("deb")
|
||||
.about("Build the source package into binary package (.deb)")
|
||||
@@ -248,9 +252,22 @@ fn main() {
|
||||
std::process::exit(1);
|
||||
});
|
||||
}
|
||||
Some(("build", _sub_matches)) => {
|
||||
Some(("build", sub_matches)) => {
|
||||
let cwd = current_dir_or_exit();
|
||||
if let Err(e) = pkh::build::build_source_package(Some(&cwd)) {
|
||||
let verbose = sub_matches
|
||||
.get_one::<bool>("verbose")
|
||||
.copied()
|
||||
.unwrap_or(false);
|
||||
|
||||
// Live build view: disabled by --verbose or when stdout is not a
|
||||
// terminal (DebUi handles the non-TTY case itself)
|
||||
let ui = if verbose {
|
||||
None
|
||||
} else {
|
||||
Some(std::sync::Arc::new(pkh::ui::deb::DebUi::new(&multi)))
|
||||
};
|
||||
|
||||
if let Err(e) = pkh::build::build_source_package(Some(&cwd), ui) {
|
||||
error!("{}", e);
|
||||
// Unmet build dependencies/conflicts exit with status 3,
|
||||
// like dpkg-buildpackage does.
|
||||
|
||||
Reference in New Issue
Block a user