* dgit: Do not nedlessly re-fetch the rewrite map.
* dgit: After downloading .debian.* files, save them in `..', too
(ie do this not just for .origs).
+ * dgit: When fetching, refetch files with hash mismatches (and save them
+ as `...,fetch'), so we can distinguish them from any built locally.
+ Closes:#850824.
Test suite:
* Add test for import-dsc with default distro. (Detects #850781.)
die "$f ?" if $f =~ m#/|^\.|\.dsc$|\.tmp$#;
my $upper_f = "../../../../$f";
- printdebug "considering linking $f: ";
-
- link_ltarget $upper_f, $f
- or ((printdebug "($!) "), 0)
- or $!==&ENOENT
- or die "$f $!";
-
- printdebug "linked.\n";
+ printdebug "considering reusing $f: ";
+
+ if (link_ltarget "$upper_f,fetch", $f) {
+ printdebug "linked (using ...,fetch).\n";
+ } elsif ((printdebug "($!) "),
+ $! != ENOENT) {
+ fail "accessing ../$f,fetch: $!";
+ } elsif (link_ltarget $upper_f, $f) {
+ printdebug "linked.\n";
+ } elsif ((printdebug "($!) "),
+ $! != ENOENT) {
+ fail "accessing ../$f: $!";
+ } else {
+ printdebug "absent.\n";
+ }
- complete_file_from_dsc('.', $fi)
+ my $refetched;
+ complete_file_from_dsc('.', $fi, \$refetched)
or next;
- link $f, $upper_f
- or $!==&EEXIST
- or die "$f $!";
+ printdebug "considering saving $f: ";
+
+ if (link $f, $upper_f) {
+ printdebug "linked.\n";
+ } elsif ((printdebug "($!) "),
+ $! != EEXIST) {
+ fail "saving ../$f: $!";
+ } elsif (!$refetched) {
+ printdebug "no need.\n";
+ } elsif (link $f, "$upper_f,fetch") {
+ printdebug "linked (using ...,fetch).\n";
+ } elsif ((printdebug "($!) "),
+ $! != EEXIST) {
+ fail "saving ../$f,fetch: $!";
+ } else {
+ printdebug "cannot.\n";
+ }
}
# We unpack and record the orig tarballs first, so that we only