Paul Vriens : transl: Merge summary.pl with checkmakefile.pl.
Alexandre Julliard
julliard at winehq.org
Thu Jul 16 11:57:01 CDT 2009
Module: tools
Branch: master
Commit: 42929a4dab87309bf3373a20555277dc052610e6
URL: http://source.winehq.org/git/tools.git/?a=commit;h=42929a4dab87309bf3373a20555277dc052610e6
Author: Paul Vriens <paul at acer.famvriens.nl>
Date: Wed Jul 15 21:54:48 2009 +0200
transl: Merge summary.pl with checkmakefile.pl.
---
transl/scripts/Master.sh | 1 -
transl/scripts/checkmakefile.pl | 27 +++++++++++++++++++
transl/scripts/summary.pl | 54 ---------------------------------------
winetest/make-winetest | 1 -
4 files changed, 27 insertions(+), 56 deletions(-)
diff --git a/transl/scripts/Master.sh b/transl/scripts/Master.sh
index 2391a28..a1e1747 100755
--- a/transl/scripts/Master.sh
+++ b/transl/scripts/Master.sh
@@ -49,7 +49,6 @@ mkdir $WORKDIR/new-langs
# Analyze all the Makefiles
$SCRIPTSDIR/checkmakefile.pl -S "$SOURCEROOT" -T "$BUILDROOT" -t "$WRCROOT" -s "$SCRIPTSDIR" -w "$WORKDIR" 2>>"$WORKDIR/run.log" || exit
-$SCRIPTSDIR/summary.pl "$WORKDIR" "$SCRIPTSDIR" || exit
# Check for a new languages
for i in $WORKDIR/new-langs/*; do
diff --git a/transl/scripts/checkmakefile.pl b/transl/scripts/checkmakefile.pl
index 66c7fe5..c0294fd 100755
--- a/transl/scripts/checkmakefile.pl
+++ b/transl/scripts/checkmakefile.pl
@@ -487,3 +487,30 @@ foreach my $makefile (@makefiles)
mycheck("normal", $path,$defs, at files);
}
}
+
+# create the summary file
+opendir(DIR, "$scriptsdir/conf");
+my @files = grep(!/^\./, readdir(DIR));
+closedir(DIR);
+
+open(OUT, ">$workdir/langs/summary");
+foreach my $lang (@files)
+{
+ next if (!($lang eq collapse($lang)));
+ my $transl = 0;
+ my $missing = 0;
+ my $errors = 0;
+ open(FILE, "<$workdir/langs/$lang");
+ while (<FILE>)
+ {
+ if (m/^FILE [A-Z]+ .* ([0-9]+) ([0-9]+) ([0-9]+)$/) {
+ $transl += $1;
+ $missing += $2;
+ $errors += $3;
+ }
+ }
+ close(FILE);
+ my $sum = $transl + $missing + $errors;
+ print OUT "LANG $lang $sum $transl $missing $errors\n";
+}
+close(OUT);
diff --git a/transl/scripts/summary.pl b/transl/scripts/summary.pl
deleted file mode 100755
index f1290b5..0000000
--- a/transl/scripts/summary.pl
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-
-# Helper script - create a summary for each language about how
-# many resources are translated
-
-die "This helper script takes two arguments" unless ($#ARGV == 1);
-
-$workdir = $ARGV[0];
-$scriptsdir = $ARGV[1];
-
-sub collapse {
- my($name) = shift @_;
- $base_name = $name;
- $base_name =~ s/:[0-9a-f]{2}/:00/;
- if (not exists $tab_should_collapse{$name})
- {
- open(NAMEFILE, "<$scriptsdir/conf/$base_name");
- $content = <NAMEFILE>;
- close(NAMEFILE);
- if ($content =~ /\[ignore-sublang\]/) {
- $tab_should_collapse{$name} = TRUE;
- }
- }
-
- if ($tab_should_collapse{$name} eq TRUE) {
- $name = $base_name;
- }
- return $name;
-}
-
-opendir(DIR, "$scriptsdir/conf");
- at files = grep(!/^\./, readdir(DIR));
-closedir(DIR);
-
-open(OUT, ">$workdir/langs/summary");
-foreach $lang (@files) {
- next if (!($lang eq collapse($lang)));
- $transl = 0;
- $missing = 0;
- $errors = 0;
- open(FILE, "<$workdir/langs/$lang");
- while (<FILE>)
- {
- if (m/^FILE [A-Z]+ .* ([0-9]+) ([0-9]+) ([0-9]+)$/) {
- $transl += $1;
- $missing += $2;
- $errors += $3;
- }
- }
- close(FILE);
- $sum = $transl + $missing + $errors;
- print OUT "LANG $lang $sum $transl $missing $errors\n";
-}
-close(OUT);
diff --git a/winetest/make-winetest b/winetest/make-winetest
index 7394638..3b492ce 100755
--- a/winetest/make-winetest
+++ b/winetest/make-winetest
@@ -133,7 +133,6 @@ umask 022
rm -rf work
mkdir work work/langs work/dumps work/dumps/res work/new-langs
$toolsdir/transl/scripts/checkmakefile.pl -S ./wine -T ./build-mingw -t ./build-native -w ./work -s "$toolsdir/transl/scripts" 2>>work/run.log
- $toolsdir/transl/scripts/summary.pl ./work "$toolsdir/transl/scripts"
for i in work/new-langs/*
do
if [ -f "$i" ]
More information about the wine-cvs
mailing list