Alexandre Julliard : transl: Store all output data in a single directory.

Alexandre Julliard julliard at winehq.org
Thu Jul 23 09:42:45 CDT 2009


Module: tools
Branch: master
Commit: 6060307e9768c1f1b6126cbbe3cf3b43b1d938f5
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=6060307e9768c1f1b6126cbbe3cf3b43b1d938f5

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul 23 12:44:21 2009 +0200

transl: Store all output data in a single directory.

---

 transl/.gitignore               |    3 +--
 transl/php/config.php           |    2 +-
 transl/php/index.php            |    4 ++--
 transl/php/lang.php             |    4 ++--
 transl/php/lib.php              |    5 +++--
 transl/php/resfile.php          |    2 +-
 transl/php/runlog.php           |    4 ++--
 transl/scripts/Master.sh        |   21 ++++++++-------------
 transl/scripts/checkmakefile.pl |   12 ++++++------
 winetest/make-winetest          |   15 ++++++---------
 10 files changed, 32 insertions(+), 40 deletions(-)

diff --git a/transl/.gitignore b/transl/.gitignore
index 9e6aaf8..3be2009 100644
--- a/transl/.gitignore
+++ b/transl/.gitignore
@@ -2,5 +2,4 @@
 /scripts/config
 /scripts/local-posthook.sh
 /scripts/local-prehook.sh
-/php/dumps
-/php/langs
\ No newline at end of file
+/php/data
diff --git a/transl/php/config.php b/transl/php/config.php
index 1d5f276..eb14c09 100644
--- a/transl/php/config.php
+++ b/transl/php/config.php
@@ -1,5 +1,5 @@
 <?php
-$DATAROOT = ".";
+$DATAROOT = "data";
 $TITLE_APPENDIX = " - Wine 1.1.x";
 $TITLE_DESCR = "This page shows the translation status of the most recent Wine 1.1.x. To see the Wine 1.0.x line see <a href=\"http://www.mikolaj.zalewski.pl/wine-transl/1.0.x/\">here</a>";
 ?>
diff --git a/transl/php/index.php b/transl/php/index.php
index 904fc47..5a1772e 100644
--- a/transl/php/index.php
+++ b/transl/php/index.php
@@ -2,7 +2,7 @@
 include_once("config.php");
 include_once("lib.php");
 
-$summary = fopen("$DATAROOT/langs/summary", "r");
+$summary = fopen("$DATAROOT/summary", "r");
 $transl = array();
 $sum = 0;
 while ($line = fgets($summary, 1024))
@@ -118,7 +118,7 @@ for ($i = 0; $i < count($transl); $i++)
 </div>
 </div>
 <?php
-if ($time = filemtime("$DATAROOT/langs/summary"))
+if ($time = filemtime("$DATAROOT/summary"))
 {
     echo "<p><small>Generated on ".gmdate("j M Y, G:i:s T", $time)." (see <a href=\"runlog.php\">run log</a>)</small></p>";
 }
diff --git a/transl/php/lang.php b/transl/php/lang.php
index 21b2dea..9f36d0c 100644
--- a/transl/php/lang.php
+++ b/transl/php/lang.php
@@ -12,10 +12,10 @@ function parse_file($lang)
 {
     global $transl, $partial, $notransl;
     global $DATAROOT;
-    if (!file_exists("$DATAROOT/langs/$lang"))
+    if (!file_exists("$DATAROOT/$lang"))
         return;
 
-    $file = fopen("$DATAROOT/langs/$lang", "r");
+    $file = fopen("$DATAROOT/$lang", "r");
     $curr_file = "";
     while ($line = fgets($file, 4096))
     {
diff --git a/transl/php/lib.php b/transl/php/lib.php
index 1499d7b..8d23291 100644
--- a/transl/php/lib.php
+++ b/transl/php/lib.php
@@ -47,13 +47,14 @@ function res_enum($header, $f)
 function enum_locale_names()
 {
     include_once "lib_res.php";
+    include "config.php";
     global $LOCALE_NAMES;
 
     if (!empty($LOCALE_NAMES))
     {
         return;
     }
-    $res = new ResFile("dumps/res/dlls-kernel32.res");
+    $res = new ResFile("$DATAROOT/res/dlls-kernel32.res");
     $res->enumResources("res_enum");
     ksort($LOCALE_NAMES);
 }
@@ -160,7 +161,7 @@ function get_res_path($resfile)
     global $DATAROOT;
 
     $resfile = preg_replace("/\\.rc(#.*)?$/", "", $resfile);
-    return "$DATAROOT/dumps/res/".preg_replace("/[^a-zA-Z0-9]/", "-", $resfile).".res";
+    return "$DATAROOT/res/".preg_replace("/[^a-zA-Z0-9]/", "-", $resfile).".res";
 }
 
 function get_resfile_name($resfile)
diff --git a/transl/php/resfile.php b/transl/php/resfile.php
index 45bae3a..4fcd2d7 100644
--- a/transl/php/resfile.php
+++ b/transl/php/resfile.php
@@ -29,7 +29,7 @@ if (preg_match("/:00/", $lang))
     exit();
 }
 
-$file = fopen("$DATAROOT/langs/$lang", "r");
+$file = fopen("$DATAROOT/$lang", "r");
 while ($line = fgets($file, 4096))
 {
     if (preg_match("@$resfile: (.*)@", $line, $m))
diff --git a/transl/php/runlog.php b/transl/php/runlog.php
index f6e0591..ac4bbaa 100644
--- a/transl/php/runlog.php
+++ b/transl/php/runlog.php
@@ -2,6 +2,6 @@
 include("config.php");
 
 header("Content-type: text/plain");
-$f = fopen("$DATAROOT/dumps/run.log", "r");
+$f = fopen("$DATAROOT/run.log", "r");
 fpassthru($f);
-?>
\ No newline at end of file
+?>
diff --git a/transl/scripts/Master.sh b/transl/scripts/Master.sh
index 4a0df39..0baa873 100755
--- a/transl/scripts/Master.sh
+++ b/transl/scripts/Master.sh
@@ -39,28 +39,23 @@ if [ "$PREPARE_TREES" -eq 1 ]; then
 fi
 
 # Do cleanup for new run
-rm -Rf $WORKDIR/langs
-rm -Rf $WORKDIR/dumps
-mkdir $WORKDIR/langs
-mkdir $WORKDIR/dumps
-mkdir $WORKDIR/dumps/res
+rm -Rf $WORKDIR/data
+mkdir $WORKDIR/data
+mkdir $WORKDIR/data/res
 
 # Analyze all the Makefiles
-$SCRIPTSDIR/checkmakefile.pl -S "$SOURCEROOT" -T "$BUILDROOT" -t "$WRCROOT" -w "$WORKDIR" 2>>"$WORKDIR/run.log" || exit
+./checkmakefile.pl -S "$SOURCEROOT" -T "$BUILDROOT" -t "$WRCROOT" -w "$WORKDIR/data" 2>>"$WORKDIR/run.log" || exit
 
 # Show any changes in the log
 diff -u $WORKDIR/run.log.old $WORKDIR/run.log
 
 # Copy the new data from the working directory to the PHP scripts input
-mv -f $DESTDIR/langs $DESTDIR/langs.old
-mv -f $DESTDIR/dumps $DESTDIR/dumps.old
-mv -f $WORKDIR/langs $DESTDIR/langs
-mv -f $WORKDIR/dumps $DESTDIR/dumps
-cp -f $WORKDIR/run.log $DESTDIR/dumps/run.log
+mv -f $DESTDIR/data $DESTDIR/data.old
+mv -f $WORKDIR/data $DESTDIR/data
+cp -f $WORKDIR/run.log $DESTDIR/data/run.log
 
 # Deleting can take a bit longer so we do it after the new version is set up
-rm -Rf $DESTDIR/langs.old
-rm -Rf $DESTDIR/dumps.old
+rm -Rf $DESTDIR/data.old
 
 # Optional hooks
 if [ -x ./local-posthook.sh ]; then
diff --git a/transl/scripts/checkmakefile.pl b/transl/scripts/checkmakefile.pl
index 66a0909..ae964f0 100755
--- a/transl/scripts/checkmakefile.pl
+++ b/transl/scripts/checkmakefile.pl
@@ -80,7 +80,7 @@ sub mycheck
     my $objs = join( " ", map { (my $ret = "$objdir/$dir/$_") =~ s/.rc$/.res/; $ret; } @rcfiles );
 
     shell "make -C $objdir/$dir -s $targets";
-    shell "$toolsdir/tools/winebuild/winebuild --resources -o $workdir/dumps/res/$norm_fn.res $objs";
+    shell "$toolsdir/tools/winebuild/winebuild --resources -o $workdir/res/$norm_fn.res $objs";
 
     my $type = -1;
     my $resource;
@@ -263,7 +263,7 @@ sub mycheck
 
         next if (($lang eq "009:01") && ($transl_count{$lang} == 0));
 
-        open(LANGOUT, ">>$workdir/langs/$lang");
+        open(LANGOUT, ">>$workdir/$lang");
         print LANGOUT "FILE STAT $dir ".($transl_count{$lang}+0)." ".($missing_count{$lang}+0)." ".($err_count{$lang}+0)."\n";
 
         foreach my $warn (@{$warns{$lang}})
@@ -297,7 +297,7 @@ sub mycheck
         my @transl = grep {$_ eq $lang} keys %file_langs;
         if ($#transl == -1)
         {
-            open(LANGOUT, ">>$workdir/langs/$lang");
+            open(LANGOUT, ">>$workdir/$lang");
             print LANGOUT "FILE NONE $dir 0 ".$transl_count{"009:01"}." 0\n";
             close(LANGOUT);
         }
@@ -344,7 +344,7 @@ while (@ARGV && $ARGV[0] =~ /^-/)
 $srcdir ||= $CONFIG{"SOURCEROOT"};
 $objdir ||= $CONFIG{"BUILDROOT"} || $srcdir;
 $toolsdir ||= $CONFIG{"WRCROOT"} || $objdir;
-$workdir ||= $CONFIG{"WORKDIR"};
+$workdir ||= $CONFIG{"WORKDIR"} . "/data";
 $wrc = $toolsdir . "/tools/wrc/wrc";
 
 if ($srcdir eq "" || $wrc eq "/tools/wrc/wrc" || $workdir eq "")
@@ -427,13 +427,13 @@ foreach my $path (keys %checks)
 }
 
 # create the summary file
-open(OUT, ">$workdir/langs/summary");
+open(OUT, ">$workdir/summary");
 foreach my $lang (keys %languages)
 {
     my $transl = 0;
     my $missing = 0;
     my $errors = 0;
-    open(FILE, "<$workdir/langs/$lang");
+    open(FILE, "<$workdir/$lang");
     while (<FILE>)
     {
         if (m/^FILE [A-Z]+ .* ([0-9]+) ([0-9]+) ([0-9]+)$/) {
diff --git a/winetest/make-winetest b/winetest/make-winetest
index 50903f6..2521b28 100755
--- a/winetest/make-winetest
+++ b/winetest/make-winetest
@@ -130,15 +130,12 @@ umask 022
 
     # update the translations status
 
-    rm -rf work
-    mkdir work work/langs work/dumps work/dumps/res
-    $toolsdir/transl/scripts/checkmakefile.pl -S ./wine -T ./build-mingw -t ./build-native -w ./work 2>>work/run.log
-    mv -f $transldir/langs $transldir/langs.old
-    mv -f $transldir/dumps $transldir/dumps.old
-    mv -f work/langs $transldir/langs
-    mv -f work/dumps $transldir/dumps
-    mv -f work/run.log $transldir/dumps/run.log
-    rm -rf $transldir/langs.old $transldir/dumps.old
+    rm -rf data
+    mkdir data data/res
+    $toolsdir/transl/scripts/checkmakefile.pl -S ./wine -T ./build-mingw -t ./build-native -w ./data 2>>data/run.log
+    mv -f $transldir/data $transldir/data.old
+    mv -f data $transldir/data
+    rm -rf $transldir/data.old
 
     echo "translations updated"
 




More information about the wine-cvs mailing list