put: pre-upload mistake guards adapted from cpaelzer's dput hooks

Stop uploads whose Changed-By is a container or VM identity (ubuntu@,
root@) and uploads of native packages carrying debian/patches/series
(quilt patches never apply there). Question, through the prompter and
defaulting to no, uploads without Launchpad bug references, with
placeholder bug numbers (1234, 9999), with a backport suffix not
matching the target series, and Ubuntu-marked versions whose
Maintainer is not an ubuntu.com address (update-maintainer forgotten).
--force skips the guards, together with the duplicate and superseded
checks it already bypassed.

Two deviations from the hooks: the maintainer check also covers
point-update SRU versions (1ubuntu2.3), which dpkg's \dubuntu\d*$
reading misses, and the ~ppa version hook is left out: pkh put uploads
to PPAs only, where keeping the archive version (an SRU test build) is
a legitimate choice. The archive half belongs with the future archive
uploads.

parse changed_by, maintainer and launchpad_bugs_fixed from the
.changes, and share the source-tree decision with the Section check
(the tree-level guards skip when the upload was collected away from
the tree).
This commit is contained in:
vhaudiquet committed 2026-11-17 10:35:49 +01:00
1 parent 8fceb13bcf
commit 891bacd055
4 files changed
+670 -5

No files matched your search

+1 -1
View File
@@ -367,7 +367,7 @@ fn main() {
.about("Upload the built source package to a PPA")
.arg(arg!(--ppa <ppa> "Upload to a PPA (format: user/ppa_name)"))
.arg(arg!([changes] "Explicit .changes file to upload (default: the one built from this package, next to the source tree)").required(false))
.arg(arg!(--force "Upload even if this exact .changes file was already uploaded to the target")),
.arg(arg!(--force "Upload even if this exact .changes file was already uploaded to the target, skipping the pre-upload mistake checks")),
)
.subcommand(
Command::new("deb")