chiark / gitweb /
dgit: parse_dsc_field: Break out $def_dsc_distro
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 13 Jan 2017 17:01:50 +0000 (17:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 13 Jan 2017 17:32:01 +0000 (17:32 +0000)
No functional change.

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

diff --git a/dgit b/dgit
index 68ab4b0..5ca4a81 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2806,6 +2806,12 @@ 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";
     } elsif (($dsc_hash, $dsc_distro, $dsc_hint_tag, $dsc_hint_url)
@@ -2814,8 +2820,7 @@ sub parse_dsc_field ($$) {
        $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";