chiark / gitweb /
dgit: Set default dsc import distro when there is no Dgit field.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 845908e325de9fd5e3aa85162709dfeff717f9e2..1f3179f65d1d0aea36b4dc47896475cdd6d908f5 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2806,16 +2806,22 @@ sub parse_dsc_field ($$) {
        $f = $dsc->{$field};
        last if defined $f;
     }
+
+    my $def_dsc_distro = sub {
+       $dsc_distro //= cfg qw(dgit.default.old-dsc-distro
+                              dgit.default.distro);
+    };
+
     if (!defined $f) {
        progress "$what: NO git hash";
+       $def_dsc_distro->();
     } elsif (($dsc_hash, $dsc_distro, $dsc_hint_tag, $dsc_hint_url)
             = $f =~ m/^(\w+)\s+($distro_re)\s+($versiontag_re)\s+(\S+)(?:\s|$)/) {
        progress "$what: specified git info ($dsc_distro)";
        $dsc_hint_tag = [ $dsc_hint_tag ];
     } elsif ($f =~ m/^\w+\s*$/) {
        $dsc_hash = $&;
-       $dsc_distro //= cfg qw(dgit.default.old-dsc-distro
-                              dgit.default.distro);
+       $def_dsc_distro->();
        $dsc_hint_tag = [ debiantags +(getfield $dsc, 'Version'),
                          $dsc_distro ];
        progress "$what: specified git hash";
@@ -2911,7 +2917,7 @@ but we could not obtain that object anywhere.
 END
        foreach my $t (@tags) {
            my $fullrefname = $lrf.'/'.$t;
-           print STDERR "CHK $t $fullrefname ".Dumper(\%lrfetchrefs_f);
+#          print STDERR "CHK $t $fullrefname ".Dumper(\%lrfetchrefs_f);
            next unless $lrfetchrefs_f{$fullrefname};
            next unless is_fast_fwd "$fullrefname~0", $dsc_hash;
            lrfetchref_used $fullrefname;