Control: tags -1 pending

Mattia Rizzolo writes ("Bug#910725: dgit: something eats 
../foo_1.2.3.orig.tar.gz"):
> Thanks for prodding here.  Indeed, trying to reproduce cleanly revealed
> that it is more involved than suspected.

Thanks.  Oh god, this is a horror.  As I wrote on irc, I'm going to
"fix" this by forbidding --include-dirty with bpd not set to ..
The reasons are explained in the comment in the commit below.

Sorry.

OTOH if dpkg-source were better, this would be fairly
straightforward.  Any of the following would suffice:

 (i) New option: dpkg-source --build-products-dir

 (ii) fix: dpkg-source -b /absolute/path
 (iii) fix: dpkg-source -b symlink-to-somewhere

NB that while having (i) for dpkg-buildpackage would be great, for
these purposes having it for dpkg-source would suffice.

Currently (ii) and (iii) seems to malfunction, although I didn't
investigate very systematically.  It is probably a bug that they are
not currently rejected, at the very least.  I haven't looked for
existing bugs against dpkg-dev about (ii) and (iii).

As discussed on irc, please do file (a) appropriate bug(s) against
dpkg-dev, and (b) a bug against dgit asking for --include-dirty
--build-products-dir to work, blocked by (a).

Regards,
Ian.

commit 7e5b054e22287250c05d43501d40b163ef3fec69
Author: Ian Jackson <[email protected]>
Date:   Wed Oct 10 13:40:46 2018 +0100

    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 <[email protected]>

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;

Reply via email to