]> git.deb.at Git - deb/packages.git/commitdiff
create_index_pages: Avoid needless slices due to unused translations
authorFrank Lichtenheld <frank@lichtenheld.de>
Sat, 9 Feb 2008 00:24:29 +0000 (01:24 +0100)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sat, 9 Feb 2008 00:24:29 +0000 (01:24 +0100)
Ignore DDTP translations of languages that have no po translation.
We will not use them here and we might create needless slices
otherwise.

bin/create_index_pages

index 0766f78fe5a275ebc192f0fcfe2089520fe6dab0..8b1f6577550dc0b732123b648715d852c3e0dd94 100755 (executable)
@@ -230,11 +230,13 @@ foreach my $pkg (@PACKAGES) {
                my %sdescs;
                my %trans_desc = split /\000|\001/, $trans_desc;
                while (my ($l, $d) = each %trans_desc) {
-                   $d =~ s/\n.*//os;
+                   # filter out non-po languages
+                   next unless exists $lang_vars{$l};
 
+                   $d =~ s/\n.*//os;
                    $sdescs{$l} = $d;
                }
-               $p{trans_desc} = \%sdescs;
+               $p{trans_desc} = \%sdescs if %sdescs;
            }
            $p{priority} = $entry->get_newest( 'priority' );
        }