wez Tue Dec 23 08:11:05 2003 EDT
Modified files:
/php-src/win32/build confutils.js
Log:
Attempt to work around apparent problems with WshShell.CurrentDirectory.
# Andi, please try this now
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.28 php-src/win32/build/confutils.js:1.29
--- php-src/win32/build/confutils.js:1.28 Mon Dec 22 20:55:33 2003
+++ php-src/win32/build/confutils.js Tue Dec 23 08:10:54 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-// $Id: confutils.js,v 1.28 2003/12/23 01:55:33 wez Exp $
+// $Id: confutils.js,v 1.29 2003/12/23 13:10:54 wez Exp $
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
@@ -35,6 +35,12 @@
STDERR.WriteLine("Must be run from the root of the php source");
WScript.Quit(10);
}
+
+var CWD = WshShell.CurrentDirectory;
+
+if (typeof(CWD) == "undefined") {
+ CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.CVS-RULES"));
+}
/* defaults; we pick up the precise versions from configure.in */
var PHP_VERSION = 5;
@@ -80,17 +86,15 @@
function condense_path(path)
{
- var cd = WshShell.CurrentDirectory;
-
path = FSO.GetAbsolutePathName(path);
- if (path.substr(0, cd.length).toLowerCase()
- == cd.toLowerCase() &&
- (path.charCodeAt(cd.length) == 92 ||
path.charCodeAt(cd.length) == 47)) {
- return path.substr(cd.length + 1);
+ if (path.substr(0, CWD.length).toLowerCase()
+ == CWD.toLowerCase() &&
+ (path.charCodeAt(CWD.length) == 92 ||
path.charCodeAt(CWD.length) == 47)) {
+ return path.substr(CWD.length + 1);
}
- var a = cd.split("\\");
+ var a = CWD.split("\\");
var b = path.split("\\");
var i, j;
@@ -836,7 +840,7 @@
STDOUT.WriteLine("Generating main/internal_functions.c");
- infile = FSO.OpenTextFile(WshShell.CurrentDirectory +
"/main/internal_functions.c.in", 1);
+ infile = FSO.OpenTextFile("main/internal_functions.c.in", 1);
indata = infile.ReadAll();
infile.Close();
@@ -852,7 +856,7 @@
}
}
- outfile = FSO.CreateTextFile(WshShell.CurrentDirectory +
"/main/internal_functions.c", true);
+ outfile = FSO.CreateTextFile("main/internal_functions.c", true);
outfile.Write(indata);
outfile.Close();
}
@@ -908,11 +912,11 @@
STDOUT.WriteLine("Generating main/config.w32.h");
- infile = FSO.OpenTextFile(WshShell.CurrentDirectory +
"/win32/build/config.w32.h.in", 1);
+ infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1);
indata = infile.ReadAll();
infile.Close();
- outfile = FSO.CreateTextFile(WshShell.CurrentDirectory + "/main/config.w32.h",
true);
+ outfile = FSO.CreateTextFile("main/config.w32.h", true);
indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix);
outfile.Write(indata);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php