X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-sources;h=6456c0e1929844751914d2be581701b4759ff4da;hb=27d33ebb54f354d5d0d1fb68c94ff6a5682b54c3;hp=9c97e2f315750f5849a1c2eef5d76cdacd9b906c;hpb=5ca21f1ba07a6b559395bec8d6bc1e528eb238d1;p=deb%2Fpackages.git diff --git a/bin/parse-sources b/bin/parse-sources index 9c97e2f..6456c0e 100755 --- a/bin/parse-sources +++ b/bin/parse-sources @@ -22,6 +22,8 @@ use strict; use lib './lib'; +$| = 1; + my $what = $ARGV[0] ? "non-free" : "*"; # max. distinct results for a given package postfix my $MAX_SOURCE_POSTFIXES = 100; @@ -53,24 +55,36 @@ for my $archive (@ARCHIVES) { while (/^(\S+):\s*(.*)\s*$/mg) { my ($key, $value) = ($1, $2); $value =~ s/\377/\n /g; - $data .= "$key: $value\n"; $key =~ tr [A-Z] [a-z]; $data{$key} = $value; } - $data .= "Archive: $archive\n"; - $sources_all_db{"$data{'package'} $data{'version'}"} - = $data; - $source_names{$data{'package'}} = 1; + delete $data{'binary'}; + + $data{files} =~ s/\s*\n\s*/\01/sog; + $data{files} =~ s/^\01//sg; my $section = 'main'; my $subsection = $data{section} || '-'; if ($data{section} && ($data{section} =~ m=/=o)) { ($section, $subsection) = split m=/=o, $data{section}, 2; + ($subsection, $section) = split m=/=o, $data{section}, 2 + if $section eq 'non-US'; } - $data{'priority'} = "-" if not exists($data{'priority'}); + $data{'section'} = $section; + $data{'subsection'} = $subsection; + $data{'priority'} ||= "-"; $sources_small{$data{'package'}} .= "$archive $suite $section $subsection $data{'priority'} $data{'version'}\000"; + + while (my ($key, $value) = each (%data)) { + next if $key eq 'package' or $key eq 'archive' or $key eq 'suite'; + print STDERR "WARN: $key ($suite/$archive/$data{package}/$data{architecture}\n" unless defined $value; + $data .= "$key\00$value\00"; + } + $data =~ s/.$//so; + $sources_all_db{"$archive $suite $data{'package'}"} + = $data; } untie %sources_all_db;