From 306828d91540e9ce11cafc701d7021845610d14b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 13 Jan 2017 17:27:03 +0000 Subject: dgit: Break out parse_dsc_field_def_dsc_distro as global sub No functional change. Signed-off-by: Ian Jackson --- dgit | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index 1f3179f..a0802eb 100755 --- 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"; -- cgit v1.2.3