chiark / gitweb /
Cope properly with `3.0 (quilt)' with single-debian-patch. Closes:#796016.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2015 12:11:28 +0000 (13:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2015 16:28:08 +0000 (17:28 +0100)
debian/changelog
dgit

index 1ab75e1e1593e221f9349752aeda42a795e76278..d362977aab9bd35e6f61b87cc508a77d57612620 100644 (file)
@@ -14,6 +14,8 @@ dgit (1.4~~) UNRELEASED; urgency=low
   * In --dry-run mode, _do_ actually run dpkg-source --commit so that we
     actually do construct the quilt fixup commit; instead, honour
     --dry-run by avoiding pulling it back to your HEAD.
+  * Cope properly with `3.0 (quilt)' with single-debian-patch.
+    Closes:#796016.
 
  --
 
diff --git a/dgit b/dgit
index 352ff8ee8244b949c518bb45930b4359bd2d9064..eaba82b4143d2babd6157f89c746184e55ee9a6d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2754,8 +2754,7 @@ sub build_maybe_quilt_fixup () {
     $upstreamversion =~ s/-[^-]*$//;
 
     if ($fopts->{'single-debian-patch'}) {
-       #quilt_fixup_singlepatch($clogp, $headref, $upstreamversion);
-       die;
+       quilt_fixup_singlepatch($clogp, $headref, $upstreamversion);
     } else {
        quilt_fixup_multipatch($clogp, $headref, $upstreamversion);
     }
@@ -2791,6 +2790,31 @@ sub quilt_fixup_delete_pc () {
     commit_admin "Commit removal of .pc (quilt series tracking data)";
 }
 
+sub quilt_fixup_singlepatch ($$$) {
+    my ($clogp, $headref, $upstreamversion) = @_;
+
+    # dpkg-source --commit generates new patches even if
+    # single-debian-patch is in debian/source/options.  In order to
+    # get it to generate debian/patches/debian-changes, it is
+    # necessary to build the source package.
+
+    quilt_fixup_linkorigs($upstreamversion, sub { });
+    quilt_fixup_mkwork($headref);
+
+    rmtree("debian/patches");
+
+    runcmd @dpkgsource, qw(-b .);
+    chdir "..";
+    runcmd @dpkgsource, qw(-x), (srcfn $version, ".dsc");
+    rename srcfn("$upstreamversion", "/debian/patches"), 
+           "work/debian/patches";
+
+    chdir "work";
+    commit_quilty_patch();
+
+    
+}
+
 sub quilt_fixup_multipatch ($$$) {
     my ($clogp, $headref, $upstreamversion) = @_;