From c6f06a4420584ef27db3510160c16c233f071c06 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 10 Oct 2018 13:40:46 +0100 Subject: [PATCH] dgit: Forbid source building with --include-dirty non-.. bpd 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 --- dgit | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dgit b/dgit index 8cea07b7..d443c34d 100755 --- 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; -- 2.30.2