Retire the ProgressCallback option-of-closure, the one pre-port reporting idiom left in the tree: pull and package_info::lookup now take &dyn BuildView like every other core flow, and the announcements map onto message (unsized work), progress (item counts: series probes, git objects, extraction) and progress again for byte downloads, which the old callback carried in the same 4-argument shape. The terminal side swaps the (ProgressBar, closure) pair for PullView, a BuildView implementation owning one bar of the shared MultiProgress with the same spinner/transfer style switching; it releases the line on drop, which the CLI triggers explicitly on both outcomes since exit(1) skips destructors. Headless callers (tests, internal lookups) pass &report::Quiet. git clone sideband parsing is skipped entirely when the view is not enabled, matching the old None-callback shortcut.
77 lines
2.7 KiB
Rust
77 lines
2.7 KiB
Rust
//! pkh: Debian packaging helper
|
|
//!
|
|
//! pkh allows working with Debian packages, with multiple actions/submodules
|
|
#![deny(missing_docs)]
|
|
|
|
/// Handle apt data (apt sources)
|
|
pub mod apt;
|
|
/// Build a Debian source package (into a .dsc)
|
|
pub mod build;
|
|
/// Parse or edit a Debian changelog of a source package
|
|
pub mod changelog;
|
|
/// Embedding convention for static reference data (`data/*.yml`), applied
|
|
/// by each owning module via the `embed_data!` macro
|
|
pub(crate) mod data;
|
|
/// Build a Debian package into a binary (.deb)
|
|
pub mod deb;
|
|
/// Reusable Debian format primitives (control/deb822, checksums, versions,
|
|
/// changelog entries, test metadata, artifact registries)
|
|
pub mod debian;
|
|
/// Obtain general information about distribution, series, etc
|
|
pub mod distro_info;
|
|
/// Passive interrupt state: the interrupted flag, the cleanup hook registry
|
|
/// and the live view's reporter slot (the CLI owns the signal handling)
|
|
pub mod interrupt;
|
|
/// Launchpad integration: PPA upload targets and account discovery
|
|
pub mod launchpad;
|
|
/// Lint a source tree: lintian wrapper for full parity plus pkh-native checks (`pkh lint`)
|
|
pub mod lint;
|
|
/// Scaffold a new Debian source package (`pkh new`)
|
|
pub mod new;
|
|
/// Obtain information about one or multiple packages
|
|
pub mod package_info;
|
|
/// Prune residual pkh build artifacts and caches
|
|
pub mod prune;
|
|
/// Download a source package locally
|
|
pub mod pull;
|
|
/// Upload a built source package to a PPA (or archive)
|
|
pub mod put;
|
|
/// Handle package-specific quirks and workarounds
|
|
pub mod quirks;
|
|
/// Run a source package's DEP-8 as-installed tests (`pkh test`)
|
|
pub mod test;
|
|
|
|
/// Line classifiers rewriting raw subprocess output into display actions
|
|
/// and countable progress (pure logic, shared by build views)
|
|
pub mod logfmt;
|
|
|
|
/// Reporting ports: environment-agnostic build observation ([`BuildView`])
|
|
/// and question answering ([`Prompter`]), implemented by terminal views,
|
|
/// server bridges or the inert [`Quiet`]
|
|
pub mod report;
|
|
|
|
/// Terminal UI helpers (progress bars, live build views, prompts)
|
|
pub mod ui;
|
|
|
|
/// Handle context for .deb building: locally, over ssh, in a chroot...
|
|
pub mod context;
|
|
|
|
/// Quiet test runs: per-test log files, subprocess capture and failure
|
|
/// matrix (inert passthrough outside test binaries)
|
|
pub(crate) mod test_support;
|
|
|
|
/// Utility functions
|
|
pub(crate) mod utils;
|
|
|
|
/// Returns the architecture of current CPU, debian-compatible
|
|
pub fn get_current_arch() -> String {
|
|
match std::env::consts::ARCH {
|
|
"x86" => "i386".to_string(),
|
|
"x86_64" => "amd64".to_string(),
|
|
"arm" => "armhf".to_string(),
|
|
"aarch64" => "arm64".to_string(),
|
|
"powerpc64" => "ppc64el".to_string(),
|
|
x => x.to_string(),
|
|
}
|
|
}
|