summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-13 17:27:03 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-13 18:07:01 +0000
commit306828d91540e9ce11cafc701d7021845610d14b (patch)
tree99392d00bd0425cdd2a16502deb84a03db8afb08
parentf559074ff68c29e0c40f544ac57e09fe5ade766d (diff)
dgit: Break out parse_dsc_field_def_dsc_distro as global sub
No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit14
1 files changed, 7 insertions, 7 deletions
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";