Skip to content

uploading features - #32

Draft
TheJJ wants to merge 13 commits into
SFTtech:mainfrom
TheJJ:uploading
Draft

TheJJ wants to merge 13 commits into
SFTtech:mainfrom
TheJJ:uploading

Conversation

@TheJJ

@TheJJ TheJJ commented Sep 24, 2026

Copy link
Copy Markdown
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
TheJJ marked this pull request as draft September 24, 2026 16:01

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant