chiark / gitweb /
dgit: Transfer origs from .. to bpd when fetching
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 16:35:08 +0000 (16:35 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Jan 2019 16:35:08 +0000 (16:35 +0000)
This is the second half of #904878.

When fetching we want to avoid downloading once again origs that are
already in `..', but not in bpd.  So call the facility we now have for
making clones of things from `..' to bpd.

`..' might contain various junk.  We try to treat it with a bit of
suspicion.  In particular, when we have a dsc we know exactly which
orig files we are looking for.

So only try to link those.  We don't do this transfer for debian
tarballs or diffs, or for origs that would be related according to
their filenames, but aren't in the dsc.

This maximises the probability that fetch will succeed even if there
is garbage in the `..'.  (Garbage in the `..' will sometimes
unavoidably cause source builds to fail, because when doing a source
build we don't know what origs to expect.)

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

diff --git a/dgit b/dgit
index e57f3ea9cfded0b0584554247d67553d7370e596..68ccc42f1315f9ce5ced3db67d61cc3f2c753c63 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2273,6 +2273,9 @@ sub generate_commits_from_dsc () {
     my $upstreamv = upstreamversion $dsc->{version};
     my @dfi = dsc_files_info();
 
+    dotdot_bpd_transfer_origs $bpd_abs, $upstreamv,
+       sub { grep { $_->{Filename} eq $_[0] } @dfi };
+
     foreach my $fi (@dfi) {
        my $f = $fi->{Filename};
        die "$f ?" if $f =~ m#/|^\.|\.dsc$|\.tmp$#;