chiark / gitweb /
dgit: Break out parse_dsc_field_def_dsc_distro as global sub
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 13 Jan 2017 17:27:03 +0000 (17:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 13 Jan 2017 18:07:01 +0000 (18:07 +0000)
No functional change.

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

diff --git a/dgit b/dgit
index 1f3179f..a0802eb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2799,6 +2799,11 @@ sub fetch_from_archive_record_2 ($) {
     }
 }
 
+sub parse_dsc_field_def_dsc_distro () {
+    $dsc_distro //= cfg qw(dgit.default.old-dsc-distro
+                          dgit.default.distro);
+}
+
 sub parse_dsc_field ($$) {
     my ($dsc, $what) = @_;
     my $f;
@@ -2807,21 +2812,16 @@ sub parse_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->();
+       parse_dsc_field_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 = $&;
-       $def_dsc_distro->();
+       parse_dsc_field_def_dsc_distro();
        $dsc_hint_tag = [ debiantags +(getfield $dsc, 'Version'),
                          $dsc_distro ];
        progress "$what: specified git hash";