[ros-diffs] [hpoussin] 29333: Display error location when possible

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Mon Oct 1 20:02:46 CEST 2007


Author: hpoussin
Date: Mon Oct  1 22:02:45 2007
New Revision: 29333

URL: http://svn.reactos.org/svn/reactos?rev=29333&view=rev
Log:
Display error location when possible

Modified:
    trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
    trunk/reactos/tools/rbuild/cdfile.cpp
    trunk/reactos/tools/rbuild/compilationunit.cpp
    trunk/reactos/tools/rbuild/include.cpp
    trunk/reactos/tools/rbuild/installfile.cpp
    trunk/reactos/tools/rbuild/module.cpp
    trunk/reactos/tools/rbuild/project.cpp
    trunk/reactos/tools/rbuild/rbuild.h

Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Mon Oct  1 22:02:45 2007
@@ -3221,7 +3221,9 @@
 		if ( m.bootstrap != NULL )
 		{
 			FileLocation targetFile ( OutputDirectory,
-			                          bootcdDirectory + sSep + m.bootstrap->base,
+			                          m.bootstrap->base.length () > 0
+			                                   ? bootcdDirectory + sSep + m.bootstrap->base
+			                                   : bootcdDirectory,
 			                          m.bootstrap->nameoncd );
 			OutputCopyCommand ( *m.output, targetFile );
 		}
@@ -3256,7 +3258,9 @@
 		if ( m.bootstrap != NULL )
 		{
 			FileLocation targetDirectory ( OutputDirectory,
-			                               bootcdDirectory + sSep + m.bootstrap->base,
+			                               m.bootstrap->base.length () > 0
+			                                   ? bootcdDirectory + sSep + m.bootstrap->base
+			                                   : bootcdDirectory,
 			                               "" );
 			out.push_back ( targetDirectory );
 		}

Modified: trunk/reactos/tools/rbuild/cdfile.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/cdfile.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/cdfile.cpp (original)
+++ trunk/reactos/tools/rbuild/cdfile.cpp Mon Oct  1 22:02:45 2007
@@ -50,8 +50,10 @@
 
 	source = new FileLocation ( SourceDirectory,
 	                            path,
-	                            cdfileNode.value );
+	                            cdfileNode.value,
+	                            &cdfileNode );
 	target = new FileLocation ( OutputDirectory,
 	                            target_relative_directory,
-	                            nameoncd ? att->value : cdfileNode.value );
+	                            nameoncd ? att->value : cdfileNode.value,
+	                            &cdfileNode );
 }

Modified: trunk/reactos/tools/rbuild/compilationunit.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/compilationunit.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/compilationunit.cpp (original)
+++ trunk/reactos/tools/rbuild/compilationunit.cpp Mon Oct  1 22:02:45 2007
@@ -102,7 +102,8 @@
 	{
 		return new FileLocation ( IntermediateDirectory,
 		                          module ? module->output->relative_path : "",
-		                          local_name );
+		                          local_name,
+		                          node );
 	}
 
 	File* file = files[0];

Modified: trunk/reactos/tools/rbuild/include.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/include.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/include.cpp (original)
+++ trunk/reactos/tools/rbuild/include.cpp Mon Oct  1 22:02:45 2007
@@ -108,7 +108,8 @@
 
 	directory = new FileLocation ( root,
 	                               relative_path,
-	                               "" );
+	                               "",
+	                               node );
 }
 
 DirectoryLocation

Modified: trunk/reactos/tools/rbuild/installfile.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/installfile.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/installfile.cpp (original)
+++ trunk/reactos/tools/rbuild/installfile.cpp Mon Oct  1 22:02:45 2007
@@ -49,12 +49,14 @@
 
 	source = new FileLocation ( source_directory,
 	                            path,
-	                            node.value );
+	                            node.value,
+	                            &node );
 	target = new FileLocation ( InstallDirectory,
 	                            base && base->value != "."
 	                                ? base->value
 	                                : "",
 	                            newname
 	                                ? newname->value
-	                                : node.value );
+	                                : node.value,
+	                            &node );
 }

Modified: trunk/reactos/tools/rbuild/module.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/module.cpp (original)
+++ trunk/reactos/tools/rbuild/module.cpp Mon Oct  1 22:02:45 2007
@@ -280,7 +280,8 @@
 
 	output = new FileLocation ( GetTargetDirectoryTree (),
 	                            modulePath,
-	                            name + extension );
+	                            name + extension,
+	                            &moduleNode );
 
 	att = moduleNode.GetAttribute ( "unicode", false );
 	if ( att != NULL )
@@ -408,7 +409,8 @@
 		const XMLAttribute* installbase = moduleNode.GetAttribute ( "installbase", false );
 		install = new FileLocation ( InstallDirectory,
 		                             installbase ? installbase->value : "",
-		                             att->value );
+		                             att->value,
+		                             &moduleNode );
 	}
 	else
 		install = NULL;
@@ -774,14 +776,14 @@
 		if ( pos == string::npos )
 		{
 			pch = new PchFile (
-				e, *this, FileLocation ( SourceDirectory, relative_path, e.value ) );
+				e, *this, FileLocation ( SourceDirectory, relative_path, e.value, &e ) );
 		}
 		else
 		{
 			string dir = e.value.substr ( 0, pos );
 			string name = e.value.substr ( pos + 1);
 			pch = new PchFile (
-				e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, name ) );
+				e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) );
 		}
 		subs_invalid = true;
 	}
@@ -1556,7 +1558,8 @@
 	{
 		source = new FileLocation ( directory,
 		                            module.output->relative_path,
-		                            definition->value );
+		                            definition->value,
+		                            &node );
 	}
 	else
 	{
@@ -1564,7 +1567,8 @@
 		string name = definition->value.substr ( index + 1);
 		source = new FileLocation ( directory,
 		                            NormalizeFilename ( module.output->relative_path + sSep + dir ),
-		                            name );
+		                            name,
+		                            &node );
 	}
 }
 

Modified: trunk/reactos/tools/rbuild/project.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.cpp?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/project.cpp (original)
+++ trunk/reactos/tools/rbuild/project.cpp Mon Oct  1 22:02:45 2007
@@ -101,7 +101,8 @@
 
 FileLocation::FileLocation ( const DirectoryLocation directory,
                              const std::string& relative_path,
-                             const std::string& name )
+                             const std::string& name,
+                             const XMLElement *node )
 	: directory ( directory ),
 	  relative_path ( NormalizeFilename ( relative_path ) ),
 	  name ( name )
@@ -114,18 +115,32 @@
 	     ( relative_path.length () > 3 && relative_path.find ( ':' ) != string::npos )
 	     )
 	{
-		throw InvalidOperationException ( __FILE__,
-		                                  __LINE__,
-		                                  "Invalid relative path '%s'",
-		                                  relative_path.c_str () );
+		if ( node )
+			throw InvalidOperationException ( __FILE__,
+			                                  __LINE__,
+			                                  "Invalid relative path '%s' at %s",
+			                                  relative_path.c_str (),
+			                                  node->location.c_str () );
+		else
+			throw InvalidOperationException ( __FILE__,
+			                                  __LINE__,
+			                                  "Invalid relative path '%s'",
+			                                  relative_path.c_str () );
 	}
 
 	if ( name.find_first_of ( "/\\:" ) != string::npos )
 	{
-		throw InvalidOperationException ( __FILE__,
-		                                  __LINE__,
-		                                  "Invalid file name '%s'",
-		                                  name.c_str () );
+		if ( node )
+			throw InvalidOperationException ( __FILE__,
+			                                  __LINE__,
+			                                  "Invalid file name '%s' at %s",
+			                                  name.c_str (),
+			                                  node->location.c_str () );
+		else
+			throw InvalidOperationException ( __FILE__,
+			                                  __LINE__,
+			                                  "Invalid file name '%s'",
+			                                  name.c_str () );
 	}
 }
 

Modified: trunk/reactos/tools/rbuild/rbuild.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=29333&r1=29332&r2=29333&view=diff
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Mon Oct  1 22:02:45 2007
@@ -316,7 +316,8 @@
 
 	FileLocation ( const DirectoryLocation directory,
 	               const std::string& relative_path,
-	               const std::string& name );
+	               const std::string& name,
+	               const XMLElement *node = NULL );
 
 	FileLocation ( const FileLocation& other );
 };




More information about the Ros-diffs mailing list