diff options
-rwxr-xr-x | dgit | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -2704,7 +2704,12 @@ sub fetch_from_archive_record_2 ($) { } sub parse_dsc_field ($$) { - my ($f, $what) = @_; + my ($dsc, $what) = @_; + my $f; + foreach my $field (@ourdscfield) { + $f = $dsc->{$field}; + last if defined $f; + } if (!defined $f) { progress "$what: NO git hash"; } elsif ($f =~ m/^\w+/) { @@ -2726,12 +2731,7 @@ sub fetch_from_archive () { get_archive_dsc(); if ($dsc) { - my $f; - foreach my $field (@ourdscfield) { - $f = $dsc->{$field}; - last if defined $f; - } - parse_dsc_field($f, 'last upload to archive'); + parse_dsc_field($dsc, 'last upload to archive'); } else { progress "no version available from the archive"; } @@ -5901,8 +5901,7 @@ sub cmd_import_dsc { parse_dscdata(); - my $dgit_field = $dsc->{$ourdscfield[0]}; - parse_dsc_field($dgit_field, "$ourdscfield[0] field in .dsc"); + parse_dsc_field($dsc, "Dgit metadata in .dsc"); if (defined $dsc_hash && !forceing [qw(import-dsc-with-dgit-field)]) { |