Jelajahi Sumber

2003-03-27 Gonzalo Paniagua Javier <[email protected]>

	* AspGenerator.cs: generate correct appbase path. It was working with
	mcs but not with csc.

	* BaseCompiler.cs: quote arguments and removed GetRandomFileName.

	* CachingCompiler.cs: quote source file.

svn path=/trunk/mcs/; revision=12862
Gonzalo Paniagua Javier 23 tahun lalu
induk
melakukan
abebeaccec

+ 4 - 1
mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs

@@ -347,8 +347,11 @@ class AspGenerator
 			
 		if (!Path.IsPathRooted (privateBinPath)) {
 			string appbase = setup.ApplicationBase;
-			if (appbase.StartsWith ("file://"))
+			if (appbase.StartsWith ("file://")) {
 				appbase = appbase.Substring (7);
+				if (Path.DirectorySeparatorChar != '/')
+					appbase = appbase.Replace ('/', Path.DirectorySeparatorChar);
+			}
 			privateBinPath = Path.Combine (appbase, privateBinPath);
 		}
 		

+ 8 - 14
mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs

@@ -86,7 +86,7 @@ namespace System.Web.Compilation
 				string [] split = assemblies.Split (',');
 				StringBuilder result = new StringBuilder ();
 				foreach (string assembly in split)
-					result.AppendFormat ("/r:{0} ", assembly.TrimStart ());
+					result.AppendFormat ("/r:\"{0}\" ", assembly.TrimStart ());
 				
 				if (options == null)
 					return result.ToString ();
@@ -109,21 +109,15 @@ namespace System.Web.Compilation
 			}
 		}
 
-		static string GetRandomFileName ()
-		{
-			string output;
-
-			do { 
-				output = "tmp" + rnd.Next () + ".dll";
-			} while (File.Exists (output));
-
-			return output;
-		}
-
 		public virtual string TargetFile {
 			get {
-				if (randomName == null)
-					randomName = GetRandomFileName ();
+				if (randomName == null) {
+					randomName = Path.GetTempFileName ();
+					try {
+						File.Delete (randomName);
+					} catch {}
+					randomName += ".dll";
+				}
 
 				return randomName;
 			}

+ 2 - 2
mcs/class/System.Web/System.Web.Compilation/CachingCompiler.cs

@@ -147,8 +147,8 @@ namespace System.Web.Compilation
 			if (compiler.CompilerOptions != null)
 				options.Append (compiler.CompilerOptions + ' ');
 
-			options.AppendFormat ("/out:{0} ", compiler.TargetFile);
-			options.Append (compiler.SourceFile);
+			options.AppendFormat ("/out:\"{0}\" ", compiler.TargetFile);
+			options.Append ('"' + compiler.SourceFile + '"');
 
 			//Console.WriteLine ("mcs {0}", options);
 			Process proc = new Process ();

+ 9 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,12 @@
+2003-03-27  Gonzalo Paniagua Javier <[email protected]>
+
+	* AspGenerator.cs: generate correct appbase path. It was working with
+	mcs but not with csc.
+
+	* BaseCompiler.cs: quote arguments and removed GetRandomFileName.
+
+	* CachingCompiler.cs: quote source file.
+
 2003-03-26  Gonzalo Paniagua Javier <[email protected]>
 
 	* AspGenerator.cs: now the Inherits attribute works as expected for