X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=examples%2Fdebian%2Fversions%2Fbuild-mldbm.pl;h=4b4d3594b26d336d1797015554cac8b19185ac4b;hb=e6b6b7adafee01d875c5af5a8a7d907b2060fe1f;hp=f8bc3c2eca580e319b74a57ba92c73a5fe3b3c4b;hpb=71f939175be364d4feb9eb93e06efa1151d19084;p=debbugs.git diff --git a/examples/debian/versions/build-mldbm.pl b/examples/debian/versions/build-mldbm.pl index f8bc3c2..4b4d359 100755 --- a/examples/debian/versions/build-mldbm.pl +++ b/examples/debian/versions/build-mldbm.pl @@ -19,17 +19,34 @@ print "$archive/$dist/$arch\n"; my $time = time; my ($p, $v); +my $extra_source_only = 0; while (<>) { if (/^Package: (.*)/) { $p = $1; } elsif (/^Version: (.*)/) { $v = $1; } + elsif (/^Extra-Source-Only: yes/) { + $extra_source_only = 1; + } elsif (/^$/) { + if ($extra_source_only) { + $extra_source_only = 0; + next; + } + update_package_version($p,$v,$time); + } +} +update_package_version($p,$v,$time) unless $extra_source_only; + +sub update_package_version { + my ($p,$v,$t) = @_; # see MLDBM(3pm)/BUGS my $tmp = $db{$p}; - $tmp->{$dist}{$arch} = $v; + # we allow multiple versions in an architecture now; this + # should really only happen in the case of source, however. + push @{$tmp->{$dist}{$arch}}, $v; $db{$p} = $tmp; $tmp = $db2{$p}; $tmp->{$dist}{$arch}{$v} = $time if not exists $tmp->{$dist}{$arch}{$v}; $db2{$p} = $tmp; - } } +