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>
}
sub parse_dsc_field ($$) {
}
sub parse_dsc_field ($$) {
+ 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+/) {
if (!defined $f) {
progress "$what: NO git hash";
} elsif ($f =~ m/^\w+/) {
get_archive_dsc();
if ($dsc) {
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";
}
} else {
progress "no version available from the archive";
}
- 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)]) {
if (defined $dsc_hash
&& !forceing [qw(import-dsc-with-dgit-field)]) {