Commit Graph
25 Commits
Author SHA1 Message Date
vhaudiquet d0b5ce65a4 deps: build against the crates packaged in Debian
The audit of the lock against Debian's archive (qa.debian.org
madison, sid/trixie/bookworm) showed 255 of 291 crates packaged, the
36 missing ones all Windows/wasm/apple/redox-only. Making the tree
build against the Debian-packaged crates — the difference between a
vendored source package and a thin debcargo one — needed:

- sha1/sha2/md-5 bumped to the digest 0.11 line (sid moved, 0.10 is
  trixie-only): finalize() now returns hybrid-array Output without
  LowerHex (hex::encode it) and no io::Write impl (sha256_file reads
  chunks into update()). The digest outputs are unchanged; the full
  suite including the checksums tests passes.
- crossterm 0.28 -> 0.29: Debian skipped 0.28 entirely.
- reqwest 0.12 -> 0.13: the blocking/json/stream usages carried over
  unchanged.
- suppaftp behind an opt-out 'ftp' feature: the one dependency absent
  from the archive, used only by the plain-FTP upload fallback of
  'pkh put' — the Debian build drops it and the SFTP failure path
  reports the transport as unavailable instead.
- every patch-level requirement pin relaxed to the minor level
  (4.5.51 -> 4.5, 1.0.228 -> 1.0, ...) — semver-compatible, and what
  lets trixie's slightly older crates satisfy the manifest.

Result: 30 of 32 direct dependencies resolve from sid as-is; the
remaining two are indicatif 0.18 (sitting in experimental, migrating)
and the feature-gated suppaftp. No vendoring on sid.
2026-10-04 15:59:56 +02:00
vhaudiquet 537bf52656 cli: mark the tree 0.2.0-rc1
CI / snap (push) Successful in 11m56s
CI / build (push) Successful in 6m22s
CI / test (push) Skipped
CI / publish (push) Skipped
The release-candidate version lands in 'pkh --version' and in the
build records' manifests, so an RC-tested tree is distinguishable
from the final release.
2026-10-04 13:00:21 +02:00
vhaudiquet 5c7627925f deps: add thiserror 2026-10-03 02:17:22 +02:00
vhaudiquet 9004a33bae deps: trim the tokio feature set to the APIs in use
The runtime (multi-thread, for Runtime::new + block_on and task
spawning), time (retries, timeouts), sync (channels) and macros
(#[tokio::test]) cover every tokio:: path in the tree; 'full' also
pulled fs, io, net and process support nothing uses. Cargo.lock loses
the corresponding mio/signal deps if nothing else needs them.
2026-10-03 02:17:22 +02:00
vhaudiquet 4d59890d5a deps: drop the lazy_static dependency 2026-10-03 02:17:22 +02:00
vhaudiquet dc01812847 deps: drop the unused cmd_lib dependency
No cmd_lib!/run_cmd!/run_fun! invocation remains anywhere in the tree;
the crate shells out through std::process::Command exclusively.
2026-10-03 01:24:54 +02:00
vhaudiquet 2d57b1f0bc deps: add bzip2-rs for bz2 orig tarballs
Decode-only pure-Rust bzip2, matching flate2's pure-Rust default: no
new system packages for building pkh, and the archive-side origin of
the need is the busybox class of '.tar.bz2' upstream tarballs.
2026-10-01 22:23:34 +02:00
vhaudiquet 02415fa450 pkh: move version to 0.2.0 2026-09-26 11:49:08 +02:00
vhaudiquet b118a54bff deps: describe the crate and dual-license it MIT or GPL-2.0-only
CI / build (push) Successful in 3m2s
CI / test (push) Skipped
CI / snap (push) Failing after 7m15s
Publishing to crates.io requires a description and a license; the
repository and readme give the crates.io page the right links. The
license texts ship as LICENSE-MIT and LICENSE-GPL.

Dual licensing is valid while no lintian-derived code is in tree:
shelling out to lintian is mere aggregation. When derived lint
collections are implemented they must land in a separate GPL-2-only
crate, since their copyright belongs to lintian's authors and
cannot carry an MIT grant; the core crate stays dual.
2026-09-21 20:46:46 +02:00
vhaudiquet ac19fd9d65 deps: add suppaftp and parking_lot
suppaftp 12 is the FTP client behind the put FTP fallback transport:
the maintained continuation of rust-ftp (4.2M downloads, releases this
month), used with its default features only — a plain blocking FTP
stream, no TLS, no async. It brings just lazy-regex into the tree;
chrono is shared.

parking_lot replaces std sync mutex unwrapping in test code, per the
project rule.
2026-09-21 14:34:04 +02:00
vhaudiquet d1056fbbbf ui: ellipsize fake-terminal pane lines wider than the terminal
Overflowing log lines in the pkh deb / pkh build rolling pane used to
wrap onto a second line, corrupting the pane layout. Truncate them to
the terminal width (minus the pane prefix) by display width and append
an ellipsis instead; lines are left whole when the terminal size is
unknown.
2026-09-20 00:15:37 +02:00
vhaudiquet 9d2519ed7b build: re-implement source builds natively, drop dpkg-buildpackage shell-out
Replace the 'dpkg-buildpackage -S' wrapper with a native pipeline in
src/build/:

- deb822 control parser/writer with dpkg-compatible multiline rendering
  (control.rs)
- md5/sha1/sha256 checksum registry, insertion-ordered like dpkg's
  artifact accumulation (checksums.rs)
- Debian version splitting/validation and full changelog entry parsing,
  including binNMU binary-only entries (metadata.rs)
- build-type bitflags and rules-target/artifact-suffix mapping
  (buildtype.rs)
- environment setup: SOURCE_DATE_EPOCH, DEB_BUILD_OPTIONS,
  dpkg-architecture env dump, vendor default profiles and the sanitized
  Environment field recorded in .buildinfo (env.rs)
- debian/files registry with atomic saves (files.rs)
- native .buildinfo writer, including the Installed-Build-Depends
  closure computed over the dpkg status database (buildinfo.rs)
- native .changes writer emitting dpkg's canonical field order with
  legacy Files + Checksums-Sha1/Sha256 (changes.rs)
- gpgme clearsigning with the transitive checksum cascade
  (dsc -> buildinfo -> changes), key discovery from the changelog
  maintainer and UNRELEASED no-sign handling (sign.rs)

dpkg-source (-b/--before-build/--after-build) intentionally remains a
subprocess; debian/rules execution is unchanged.

Validated differentially against real dpkg-buildpackage -S -I -i -nc -d
on native and 3.0 (quilt) fixture packages: .dsc byte-identical, .changes
payload matches modulo machine-dependent Installed-Build-Depends and
Environment content, all signatures verify with gpg, artifact ordering
and UNRELEASED no-sign behavior match dpkg.
2026-08-23 01:29:35 +02:00
vhaudiquet d3a07bc80d chlog: add series selector
CI / build (push) Successful in 15m3s
CI / snap (push) Successful in 2m6s
2026-08-11 14:42:23 +02:00
vhaudiquet e1668d5d80 pull: support Sources.gz without Checksums-Sha256
CI / build (push) Failing after 8m34s
CI / snap (push) Has been skipped
The Ubuntu development series (stonking) Sources.gz no longer ships a
Checksums-Sha256 field, only Checksums-Sha512 and the legacy Files
(MD5) field. The package_info parser only read Checksums-Sha256, so
the file list ended up empty and fetch_orig_tarball panicked on
Option::unwrap() when looking for the orig tarball.

- Add a ChecksumAlgo enum (Md5/Sha256/Sha512) to FileEntry, replacing
  the hardcoded sha256 field, and parse the strongest available
  checksum field (Sha256 > Sha512 > MD5).
- Make download_file_checksum verify against the correct algorithm
  instead of always using SHA-256.
- Replace the unwrap() on the orig tarball search with a proper error
  listing the available files, so future regressions fail clearly
  instead of panicking.
- Add md-5 dependency for MD5 verification.
2026-07-24 12:56:31 +02:00
vhaudiquet 8345f51d2f Multiple changes:
CI / build (push) Successful in 16m23s
CI / snap (push) Successful in 4m1s
- deb: can use ppa as dependency
- deb: cross and regular are using parallel nocheck builds
- deb: ephemeral will not pull keyring if no root powers
2026-02-06 12:04:25 +01:00
vhaudiquet ab35af5fb5 package_info: refactor into distro_info and package_info split, yaml data
CI / build (push) Failing after 9m3s
2026-01-14 21:18:25 +01:00
vhaudiquetandvhaudiquet b724d46f2c deb: fix concurrent testing (by making them serial)
CI / build (push) Successful in 8m34s
Co-authored-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Co-committed-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
2026-01-11 00:32:03 +00:00
vhaudiquet 1c9f6cccd2 build: only sign if a gpg key able to sign is present
CI / build (push) Failing after 1m50s
2026-01-06 18:07:34 +01:00
vhaudiquetandvhaudiquet 1538e9ee19 deb: cross-compilation, ephemeral contexts, local builds
CI / build (push) Successful in 7m18s
Multiple changes:
- New contexts (schroot, unshare)
- Cross-building quirks, with ephemeral contexts and repositories management
- Contexts with parents, global context manager, better lifetime handling
- Local building of binary packages
- Pull: pulling dsc files by default
- Many small bugfixes and changes

Co-authored-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Co-committed-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
2025-12-25 17:10:44 +00:00
vhaudiquet 1d65d1ce31 context: add context
CI / build (push) Successful in 1m50s
pkh context allows to manage contexts (local, ssh) and run contextualized commands (deb)

in other words, this allows building binary packages over ssh
2025-12-15 20:48:44 +01:00
vhaudiquet bead6f5aca deps: updated dependencies
CI / build (push) Failing after 1m1s
2025-11-28 15:36:45 +01:00
vhaudiquet 32705b4b35 get: archive download fallback for non-git packages 2025-11-28 15:20:16 +01:00
vhaudiquet 311304666f better logging
Use callbacks to report progress, indicatif for progress bars, no direct logs but progress messages
2025-11-27 19:34:46 +01:00
vhaudiquet a4d2441b0a changelog: added changelog 2025-11-26 21:30:34 +01:00
vhaudiquet c466ad1846 Initial commit
- pkh created
- basic 'get' command to obtain a source package
2025-11-26 00:22:09 +01:00