diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-07 18:51:37 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-08 22:14:48 +0000 |
commit | dda17d8a6fec27f631653cf8ac63ba6d96e642c3 (patch) | |
tree | be0f379548e3da17e30ce24f4b2d4f18ccdbf217 | |
parent | 76c7db35e2ddaa0c517128fae11cd5893099fffc (diff) |
dgit: Dgit parsing: Move @ourdscfield loop into parse_dsc_field
This gives it the $dsc. Also it means that import-dsc will understand
very old .dscs with Vcs-Dgit-Master.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-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)]) { |