X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=fbf844e08370225f191f4bdc3a63ce602c80d703;hb=a6c66a1add35c473a32e72938374b5ffc1017b92;hp=fabf83bb8d96002f11c31f79f86918f592750f92;hpb=31b14133b081055c15b0f70edb9d75a85615010d;p=dgit.git diff --git a/dgit b/dgit index fabf83bb..fbf844e0 100755 --- a/dgit +++ b/dgit @@ -34,7 +34,6 @@ use POSIX; use IPC::Open2; use Digest::SHA; use Digest::MD5; -use List::Util qw(any); use List::MoreUtils qw(pairwise); use Text::Glob qw(match_glob); use Fcntl qw(:DEFAULT :flock); @@ -2763,8 +2762,8 @@ sub git_fetch_us () { } elsif ($here{$lref} eq $objid) { lrfetchref_used $fullrefname; } else { - print STDERR \ - "Not updateting $lref from $here{$lref} to $objid.\n"; + print STDERR + "Not updating $lref from $here{$lref} to $objid.\n"; } }); } @@ -2799,6 +2798,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; @@ -2806,16 +2810,17 @@ sub parse_dsc_field ($$) { $f = $dsc->{$field}; last if defined $f; } + if (!defined $f) { progress "$what: NO git hash"; + 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 = $&; - $dsc_distro //= cfg qw(dgit.default.old-dsc-distro - dgit.default.distro); + parse_dsc_field_def_dsc_distro(); $dsc_hint_tag = [ debiantags +(getfield $dsc, 'Version'), $dsc_distro ]; progress "$what: specified git hash"; @@ -2911,7 +2916,7 @@ but we could not obtain that object anywhere. END foreach my $t (@tags) { my $fullrefname = $lrf.'/'.$t; - print STDERR "CHK $t $fullrefname ".Dumper(\%lrfetchrefs_f); +# print STDERR "CHK $t $fullrefname ".Dumper(\%lrfetchrefs_f); next unless $lrfetchrefs_f{$fullrefname}; next unless is_fast_fwd "$fullrefname~0", $dsc_hash; lrfetchref_used $fullrefname; @@ -6111,6 +6116,12 @@ sub cmd_import_dsc { parse_dsc_field($dsc, "Dgit metadata in .dsc") unless forceing [qw(import-dsc-with-dgit-field)]; + parse_dsc_field_def_dsc_distro(); + + $isuite = 'DGIT-IMPORT-DSC'; + $idistro //= $dsc_distro; + + notpushing(); if (defined $dsc_hash) { progress "dgit: import-dsc of .dsc with Dgit field, using git hash"; @@ -6148,8 +6159,6 @@ Specify +$specbranch to overwrite, discarding existing history END if $oldhash && !$force; - notpushing(); - my @dfi = dsc_files_info(); foreach my $fi (@dfi) { my $f = $fi->{Filename};