chiark / gitweb /
Split brain: Run dpkg-source --before-build separately (nfc)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index b5082c96360439d98f6d9cae560f9db0d2954fc3..5910c778f2f7d0798150cd2ac89aaa15171ccbfe 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2532,8 +2532,8 @@ sub quiltify_tree_sentinelfiles ($) {
     return $r;
 }
 
-sub quiltify ($$) {
-    my ($clogp,$target) = @_;
+sub quiltify ($$$) {
+    my ($clogp,$target,$origtree) = @_;
 
     # Quilt patchification algorithm
     #
@@ -2919,7 +2919,8 @@ END
 
     quilt_fixup_linkorigs($upstreamversion, $dscaddfile);
 
-    my @files=qw(debian/source/format debian/rules);
+    my @files=qw(debian/source/format debian/rules
+                 debian/control debian/changelog);
     foreach my $maybe (qw(debian/patches debian/source/options)) {
         next unless stat_exists "../../../$maybe";
         push @files, $maybe;
@@ -2931,18 +2932,26 @@ END
     $dscaddfile->($debtar);
     close $fakedsc or die $!;
 
-    runcmd qw(sh -ec), 'exec dpkg-source --no-check -x fake.dsc >/dev/null';
+    runcmd qw(sh -ec),
+        'exec dpkg-source --no-check --skip-patches -x fake.dsc >/dev/null';
 
     my $fakexdir= $package.'-'.(stripepoch $upstreamversion);
     rename $fakexdir, "fake" or die "$fakexdir $!";
 
     changedir 'fake';
 
+    ensuredir '.pc';
+
     remove_stray_gits();
     mktree_in_ud_here();
 
+    runcmd qw(sh -ec),
+        'exec dpkg-source --before-build . >/dev/null';
+
     changedir '..';
 
+    my $origtree='';
+
     quilt_fixup_mkwork($headref);
 
     my $mustdeletepc=0;
@@ -2954,7 +2963,7 @@ END
         rename '../fake/.pc','.pc' or die $!;
     }
 
-    quiltify($clogp,$headref);
+    quiltify($clogp,$headref,$origtree);
 
     if (!open P, '>>', ".pc/applied-patches") {
        $!==&ENOENT or die $!;