chiark / gitweb /
dgit: Forbid source building with --include-dirty non-.. bpd
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Oct 2018 12:40:46 +0000 (13:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Oct 2018 23:58:18 +0000 (00:58 +0100)
Right now, this does bizarre damage to ..
Fixing this is very hard without bpd support in dpkg-source.

Closes: #910725.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 8cea07b..d443c34 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6567,6 +6567,24 @@ sub build_source {
         }
     } else {
         $leafdir = basename $maindir;
+
+       if ($buildproductsdir ne '..') {
+           # Well, we are going to run dpkg-source -b which consumes
+           # origs from .. and generates output there.  To make this
+           # work when the bpd is not .. , we would have to (i) link
+           # origs from bpd to .. , (ii) check for files that
+           # dpkg-source -b would/might overwrite, and afterwards
+           # (iii) move all the outputs back to the bpd (iv) except
+           # for the origs which should be deleted from .. if they
+           # weren't there beforehand.  And if there is an error and
+           # we don't run to completion we would necessarily leave a
+           # mess.  This is too much.  The real way to fix this
+           # is for dpkg-source to have bpd support.
+           confess unless $includedirty;
+           fail __
+ "--include-dirty not supported with --build-products-dir, sorry";
+       }
+
         changedir '..';
     }
     runcmd_ordryrun_local @cmd, $leafdir;