From 16ccc5dda376696f4cb37639017dc13e70ca9324 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 4 Feb 2017 16:30:13 -0700 Subject: dgit: New command: push-source Signed-off-by: Sean Whitton Acked-by: Ian Jackson --- dgit | 22 ++++++++++++++++++++++ dgit.1 | 10 +++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/dgit b/dgit index 3420d5c..5557df5 100755 --- a/dgit +++ b/dgit @@ -540,6 +540,7 @@ main usages: dgit [dgit-opts] build [dpkg-buildpackage-opts] dgit [dgit-opts] sbuild [sbuild-opts] dgit [dgit-opts] push [dgit-opts] [suite] + dgit [dgit-opts] push-source [dgit-opts] [suite] dgit [dgit-opts] rpush build-host:build-dir ... important dgit options: -k sign tag and package with instead of default @@ -4592,6 +4593,21 @@ sub cmd_push { dopush(); } +sub cmd_push_source { + prep_push(); + if ($changesfile) { + my $changes = parsecontrol("$buildproductsdir/$changesfile", + "source changes file"); + unless (test_source_only_changes($changes)) { + fail "user-specified changes file is not source-only"; + } + } else { + # Building a source package is very fast, so just do it + build_source_for_push(); + } + dopush(); +} + #---------- remote commands' implementation ---------- sub pre_remote_push_build_host { @@ -6177,6 +6193,12 @@ sub cmd_gbp_build { } sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0 +sub build_source_for_push { + build_source(); + maybe_unapply_patches_again(); + $changesfile = $sourcechanges; +} + sub build_source { build_prep_early(); build_prep(); diff --git a/dgit.1 b/dgit.1 index 1bf4a2c..047695b 100644 --- a/dgit.1 +++ b/dgit.1 @@ -17,7 +17,7 @@ dgit \- git integration with the Debian archive [\fIbuild\-opts\fp] .br .B dgit -[\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP] +[\fIdgit\-opts\fP] \fBpush\fP|\fBpush-source\fP [\fIdgit\-opts\fP] [\fIsuite\fP] .br .B dgit @@ -185,6 +185,14 @@ dgit push always uses the package, suite and version specified in the debian/changelog and the .dsc, which must agree. If the command line specifies a suite then that must match too. .TP +\fBdgit push-source\fR [\fIsuite\fP] +Without \fB-C\fR, builds a source package and dgit pushes it. Saying +\fBdgit push-source\fR is like saying "update the source code in the +archive to match my git HEAD, and let the autobuilders do the rest." + +With \fB-C\fR, performs a dgit push, additionally ensuring that no +binary packages are uploaded. +.TP \fBdgit rpush\fR \fIbuild-host\fR\fB:\fR\fIbuild-dir\fR [\fIpush args...\fR] Pushes the contents of the specified directory on a remote machine. This is like running dgit push on build-host with build-dir as the -- cgit v1.2.3