From a44387b654d8d6a079efc16e76b23530ec7b651b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Jan 2019 16:35:08 +0000 Subject: [PATCH] dgit: Transfer origs from .. to bpd when fetching 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 --- dgit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dgit b/dgit index e57f3ea9..68ccc42f 100755 --- 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$#; -- 2.30.2