chiark / gitweb /
dgit: New command: push-source
authorSean Whitton <spwhitton@spwhitton.name>
Sat, 4 Feb 2017 23:30:13 +0000 (16:30 -0700)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Jan 2018 19:31:59 +0000 (19:31 +0000)
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit
dgit.1

diff --git a/dgit b/dgit
index 3420d5ca9715ebf26a6b4eeebf9d0c5e4aba45ca..5557df5f953736502cbe14cacf318eb45d05eb34 100755 (executable)
--- 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] 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<keyid>           sign tag and package with <keyid> instead of default
   dgit [dgit-opts] rpush build-host:build-dir ...
 important dgit options:
   -k<keyid>           sign tag and package with <keyid> instead of default
@@ -4592,6 +4593,21 @@ sub cmd_push {
     dopush();
 }
 
     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 {
 #---------- 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 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();
 sub build_source {
     build_prep_early();
     build_prep();
diff --git a/dgit.1 b/dgit.1
index 1bf4a2c767345d6a2036379993edccc5947e69ce..047695b9228de711af5ee31b5f37e8f60fee040a 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -17,7 +17,7 @@ dgit \- git integration with the Debian archive
 [\fIbuild\-opts\fp]
 .br
 .B dgit
 [\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
 [\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
 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
 \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