Conversation
TheJJ
commented
Sep 24, 2026
Member
- orig tarball handling
- upstream source switching
- optional build time tests
- the dpkg-driver
- and some drive-bys
Move the pure Debian packaging models into debmagic-common so both the CLI and future tooling (lint) share one implementation: - package::SourcePackage: the source tree aggregate, constructed with a FileReader closure plus a Location, exposing changelog head and source format eagerly and further substructures lazily - debian::changelog: ChangelogHead extraction and the Ubuntu deltarebase-onto-Debian detection - debian::control: deb822 checksum fields (parse, verify, rewrite) - debian::copyright: Files-Excluded parsing - debian::source: 3.0 (native)/(quilt) source format - changes: orig tarball naming and .changes orig entry transformation - PackageVersion ordering with full dpkg comparison semantics Common owns bytes to structure only; no I/O side effects.
Replace the CLI's own PackageIdentity changelog parsing with the SourcePackage model from debmagic-common: - package.rs: load_package builds the FileReader closure over the source dir; PackageTarget carries a SourcePackage - build/, test/: take &SourcePackage instead of &PackageIdentity - main.rs: load_package at every call site The changelog is now read once through the common model; name, version and distributions come from it.
debmagic upstream list/switch replace uscan/uupdate, reading the package's existing debian/watch and debian/copyright: - watch: debian/watch v2-v5 parsing with the common options (mangles, pgp, repack, component, untrackable) - query: candidate discovery from download listings, anchored uscan-style matching, and direct URL construction by inverting the watch pattern for concrete versions (listing only as fallback) - orig: orig tarball fetching for builds and switches — output dir, source parent, XDG download cache, then the configured method: launchpad (default, distro archives via Launchpad's API), debian/ ubuntu archive pools (with configurable mirrors), custom command, or disabled - repack: Files-Excluded-driven repacking with debian/copyright - switch: replace the source tree with the new upstream tarball, keeping debian/ and .git, verifying PGP signatures against debian/upstream/signing-key.asc - launchpad/requests: Launchpad REST API access and shared http helpers (reqwest, tokio runtime) - sign: verify_signature with gpg/sq/custom backends; sign.command split into sign_command and verify_command - control/changelog/changes: CLI-side readers over the common models, PGP armor stripping for archive .dsc files
debmagic upload pushes a signed .changes (and everything it references) to archives and PPAs via scp/sftp, dput-style: - upload/target: named targets resolved from [upload.targets] over the builtins (ppa, ubuntu, debian), with per-invocation overrides - upload/scp, sftp: batched transports (one scp invocation / one sftp session per upload instead of per file) - pre_upload_commands run via sh -c before anything is transferred; dput-ng hooks can be bridged by wrapping them - .upload.json next to the .changes records every successful upload (target, time, upstream version); a duplicate upload is refused unless --force - --include-orig=auto|yes|no decides whether the orig tarball rides along: auto includes it when the target has not seen this upstream version yet (no record, different version, or a deltarebase onto a Debian version Ubuntu never had); a disagreeing .changes is rewritten and re-signed, the tarball verified against its .dsc first - build source --upload and --changes-option=... for git-ubuntu-style Vcs-Git correlation fields
TheJJ
marked this pull request as draft
September 24, 2026 16:01
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.