Alexandre Julliard : transl: Get rid of the config file parsing in parse_resfiles.php.

Alexandre Julliard julliard at winehq.org
Thu Aug 13 10:28:15 CDT 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Aug 13 16:00:06 2009 +0200

transl: Get rid of the config file parsing in parse_resfiles.php.

---

 transl/php/parse_resfiles.php |   29 +----------------------------
 1 files changed, 1 insertions(+), 28 deletions(-)

diff --git a/transl/php/parse_resfiles.php b/transl/php/parse_resfiles.php
index c6db13b..4c2feca 100644
--- a/transl/php/parse_resfiles.php
+++ b/transl/php/parse_resfiles.php
@@ -11,7 +11,6 @@ function resource_name2($resource)
 function create_resfiles($dir, $check)
 {
     global $objdir, $srcdir, $toolsdir, $workdir;
-    global $wrc;
 
     $srcs = "";
     $targets = "";
@@ -55,30 +54,6 @@ function create_resfiles($dir, $check)
     system("$toolsdir/tools/winebuild/winebuild --resources -o $workdir/res/$norm_fn.res $objs");
 }
 
-// Parse config file
-$CONFIG = array();
-if (file_exists("config"))
-{
-    $config = fopen("config", "r");
-    while ($line = fgets($config, 4096))
-    {
-        if (preg_match("/^([A-Z_]+)=([^\s]+)\s*$/", $line, $m))
-        {
-            $CONFIG[$m[1]] = $m[2];
-        }
-        else if (!preg_match("/(^#|^$)/", $line))
-        {
-            print("checkmakefile.pl: Can't parse config line: $line\n");
-        }
-    }
-    fclose($config);
-}
-
-$srcdir = isset($CONFIG['SOURCEROOT']) ? $CONFIG['SOURCEROOT'] : "";
-$objdir = isset($CONFIG['BUILDROOT']) ? $CONFIG['BUILDROOT'] : "";
-$toolsdir = isset($CONFIG['WRCROOT']) ? $CONFIG['WRCROOT'] : "";
-$workdir = isset($CONFIG['WORKDIR']) ? $CONFIG['WORKDIR'] : "";
-
 $script = $argv[0];
 array_shift($argv);
 while (count($argv) != 0 && preg_match("/^-/", $argv[0]))
@@ -108,9 +83,7 @@ if ($objdir == "")
 if ($toolsdir == "")
     $toolsdir = $objdir;
 
-$wrc = "$toolsdir/tools/wrc/wrc";
-
-if ($srcdir == "" || $wrc == "/tools/wrc/wrc" || $workdir == "")
+if ($srcdir == "" || $toolsdir == "" || $workdir == "")
 {
     die("Config entry for SOURCEROOT, WRCROOT or WORKDIR missing\n");
 }




More information about the wine-cvs mailing list