[Debian-l10n-commits] r1050 - /dl10n/trunk/dl10n-txt
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Thu Jun 5 09:22:58 UTC 2008
Author: nekral-guest
Date: Thu Jun 5 09:22:58 2008
New Revision: 1050
URL: http://svn.debian.org/wsvn/?sc=1&rev=1050
Log:
Re-indent.
Modified:
dl10n/trunk/dl10n-txt
Modified: dl10n/trunk/dl10n-txt
URL: http://svn.debian.org/wsvn/dl10n/trunk/dl10n-txt?rev=1050&op=diff
==============================================================================
--- dl10n/trunk/dl10n-txt (original)
+++ dl10n/trunk/dl10n-txt Thu Jun 5 09:22:58 2008
@@ -43,30 +43,30 @@
} else {
print "$BANNER\n";
}
- print
+ print
"Syntax: $0 [options] [lang]+
General options:
-h, --help display short help text
-V, --version display version and exit
-
+
Package selection:
--debian Only take debian specific packages
--list=file Only handle the packages listed in the provided file
-t,--todo Display only when the translation is NOT completed
-e,--empty Display even if there is no translation to this language
--diff-only Only take debian specific packages based only on the diff presence
-
+
Informations to display:
--total Show only summary for the lang, not each package details
-s,--status Show status (hard to read when there is more than one format)
--show=fmt Show only selected format (instead of $fmt)
-a,--assume-bts Assume that the content bugs in the BTS were applied.
-
+
Database to use:
- --db=DB_FILE use DB_FILE as database file
+ --db=DB_FILE use DB_FILE as database file
(instead of $DB_FILE)
- --sdb=STATUS_FILE use STATUS_FILE as status file
+ --sdb=STATUS_FILE use STATUS_FILE as status file
(instead of $STATUS_FILE)
--edb=STATUS_EN_FILE use STATUS_EN_FILE as status file
(instead of $STATUS_EN_FILE)
@@ -96,14 +96,14 @@
"help|h" => \&syntax_msg,
"version|V" => \&banner,
"print-version" => \&banner,
-
+
# ------------------ configuration options
"todo|t" => \$mask_done,
"empty|e" => \$show_empty,
"status|s" => \$show_status,
"total" => \$show_total,
"assume-bts|a" => \$assume_bts,
-
+
"debian" => \$take_debian,
"diff-only" => \$diff_only,
"show=s" => \$fmt,
@@ -125,7 +125,7 @@
#-----------------------------------------------------------------------------
-# The main program
+# The main program
#-----------------------------------------------------------------------------
###
### initialisation
@@ -180,7 +180,7 @@
my %parts;
map {$parts{$_} = 1} split (/,/, $fmt);
my @poparts=qw(po templates podebconf po4a);
-
+
my $format_top = "format STDOUT_TOP = \n".
' '.($parts{'po'}?'______________________':'').($parts{'po4a'}?'_______________________':'').($parts{'templates'}?'______________________':'').($parts{'podebconf'}?'______________________':'').($parts{'man'}?'_______':'')."\n".
' __________________|'.($parts{'po'}?'_________po__________|':'').($parts{'po4a'}?'________po4a_________|':'').($parts{'templates'}?'______templates______|':'').($parts{'podebconf'}?'_____po-debconf______|':'').($parts{'man'}?' # man |':'')."\n".
@@ -220,7 +220,7 @@
$statusEnDB->read($statusEnDBname,0) if $show_status;
print "Status of the ".($take_debian?"debian ":"")."packages ".($mask_done?"to do ":"")."in $lang\n\n" unless $show_total;
-
+
my %total;
foreach (@todo_pkg) {
$pkg = $_;
@@ -228,7 +228,7 @@
# Take only packages having material and not ignored
next if defined $ignored_pkgs{$pkg};
next unless $data->has_po($pkg) || $data->has_templates($pkg) || $data->has_podebconf($pkg) || $data->has_man($pkg) || $data->has_po4a($pkg) || $show_empty;
-
+
# Take only debian packages
if ($take_debian) {
next if ($data->has_upstream($pkg) && $data->upstream($pkg) ne "debian");
@@ -249,7 +249,7 @@
my $bts_reported=0;
$status .= "$part(";
$score{$part} = '---';
-
+
if ($show_status && $statusDB->has_package($pkg) && $statusDB->has_status($pkg)) {
my $nobts = 0;
foreach my $statusline (@{$statusDB->status($pkg)}) {
@@ -257,7 +257,7 @@
if ($kind eq $part) {
my $days = "??";
if ($date =~ m/^(\d{4})-(\d\d)-(\d\d) (\d*):(\d*):(\d*)/) { # 2003-07-26
- $days = sprintf "%.0f",
+ $days = sprintf "%.0f",
(time - timelocal ($6,$5,$4,$3,$2-1,$1)) / (60 * 60 * 24);
}
$status .= "$status_from_db, $days days ";
@@ -281,65 +281,66 @@
}
}
}
- $status .= ') ';
+ $status .= ') ';
$status =~ s/ \)/)/;
- $status =~ s/$part\(\)//;
-
- foreach my $line (@{$data->$part($pkg)}){
- my ($pofile, $langfound, $stat) = @{$line};
- if ($langfound eq $lang) {
- $score{$part} = add_stat($stat,$score{$part});
-
- if ($mask_done) {
- unless (($assume_bts && $bts_reported) || (output_percent($stat) eq '100%')) {
- $found = 1;
- }
- } else {
- $found = 1;
- }
- } elsif ($langfound eq '_') {
- $ori{$part} = add_stat($stat, $ori{$part});
- } elsif ($langfound ne '') {
- $extra{$part} = $stat;
- }
- }
-
- if ($score{$part} eq '---' && defined($ori{$part})) {
- $score{$part} = normalize_score($ori{$part},"0t0f0u");
- $found = 1 if $show_empty && !($assume_bts && $bts_reported);
- } elsif (defined($ori{$part})) {
- $score{$part} = normalize_score($ori{$part},$score{$part});
- $found = 1 if ((not $score{$part} =~ /0f0u/) && !($assume_bts && $bts_reported));
- } elsif(not defined($ori{$part}) and $score{$part} eq '---' and defined $extra{$part}) {
- $score{$part} = "---";
- $found = 1 if $show_empty && !($assume_bts && $bts_reported);
- }
-# print STDERR "show_empty=$show_empty; assume_bts=$assume_bts; bts_reported=$bts_reported; found=$found\n";
- if ($score{$part} =~ /([0-9]*)t([0-9]*)f-([0-9]*)u/) {
- $score{$part} = '---';
- $d{$part}=output_details($score{$part});
- next;
- }
-
- $p{$part}=output_percent($score{$part});
- $d{$part}=output_details($score{$part});
-
-
- if (defined $score{$part} && $score{$part} ne '---') {
+ $status =~ s/$part\(\)//;
+
+ foreach my $line (@{$data->$part($pkg)}){
+ my ($pofile, $langfound, $stat) = @{$line};
+ if ($langfound eq $lang) {
+ $score{$part} = add_stat($stat,$score{$part});
+
+ if ($mask_done) {
+ unless ( ($assume_bts && $bts_reported)
+ or (output_percent($stat) eq '100%')) {
+ $found = 1;
+ }
+ } else {
+ $found = 1;
+ }
+ } elsif ($langfound eq '_') {
+ $ori{$part} = add_stat($stat, $ori{$part});
+ } elsif ($langfound ne '') {
+ $extra{$part} = $stat;
+ }
+ }
+
+ if ($score{$part} eq '---' && defined($ori{$part})) {
+ $score{$part} = normalize_score($ori{$part},"0t0f0u");
+ $found = 1 if $show_empty && !($assume_bts && $bts_reported);
+ } elsif (defined($ori{$part})) {
+ $score{$part} = normalize_score($ori{$part},$score{$part});
+ $found = 1 if ((not $score{$part} =~ /0f0u/) && !($assume_bts && $bts_reported));
+ } elsif(not defined($ori{$part}) and $score{$part} eq '---' and defined $extra{$part}) {
+ $score{$part} = "---";
+ $found = 1 if $show_empty && !($assume_bts && $bts_reported);
+ }
+# print STDERR "show_empty=$show_empty; assume_bts=$assume_bts; bts_reported=$bts_reported; found=$found\n";
+ if ($score{$part} =~ /([0-9]*)t([0-9]*)f-([0-9]*)u/) {
+ $score{$part} = '---';
+ $d{$part}=output_details($score{$part});
+ next;
+ }
+
+ $p{$part}=output_percent($score{$part});
+ $d{$part}=output_details($score{$part});
+
+
+ if (defined $score{$part} && $score{$part} ne '---') {
if ($assume_bts) {
my $stat_to_add=$score{$part};
if ($bts_reported) {
$stat_to_add =~ /([0-9]*)t([0-9]*)f([0-9]*)u/;
$stat_to_add = ($1+$2+$3)."t0f0u";
}
- $total{$part} = add_stat($stat_to_add,$total{$part});
+ $total{$part} = add_stat($stat_to_add,$total{$part});
} else {
$total{$part} = add_stat($score{$part},$total{$part});
}
}
}
}
-
+
# Search for mans
if ($parts{'man'} && $data->has_man($pkg)) {
my $en=0;
@@ -348,16 +349,16 @@
my ($name, $langfound) = @{$line};
$en++ if ($langfound eq 'english');
$fr++ if ($langfound eq 'french');
- }
+ }
$man="$fr/$en";
$man_fr_total += $fr;
$man_en_total += $en;
$found = 1 unless $mask_done && $fr == $en ;
}
-
+
write if ($found && !$show_total);
}
-
+
if ($show_total) {
print "$lang: ";
foreach my $part (@poparts) {
@@ -367,15 +368,15 @@
if ($parts{$part});
}
print "\n";
-
+
} else {
print "|__________________|";
- foreach my $part (@poparts) {
+ foreach my $part (@poparts) {
print "_____|_______________|" if $parts{$part};
}
print "_______|" if $parts{'man'};
print "\n";
-
+
$pkg = "TOTAL ($lang)";
foreach my $part (@poparts) {
$p{$part}=output_percent($total{$part});
@@ -388,14 +389,14 @@
$status = "";
}
write;
-
+
print "|__________________|";
- foreach my $part (@poparts) {
+ foreach my $part (@poparts) {
print "_____|_______________|" if $parts{$part};
}
print "_______|" if $parts{'man'};
print "\n\n\n";
-
+
print "When there is some ---, that means that the material exists, but is not \n".
"translated to this language and that some issue (in pot file or DB) prevent to find the amount of string.\n\n";
print "Significance of the 'details' columns:\n".
@@ -476,3 +477,4 @@
$res =~ s/^([0-9]*)\..*/$1/;
return $res;
}
+
More information about the Debian-l10n-commits
mailing list