Author: cfinck Date: Sat Aug 25 13:00:19 2007 New Revision: 28536
URL: http://svn.reactos.org/svn/reactos?rev=28536&view=rev Log: Revert r28526 for now until a problem for the livecd breakage has been found
Modified: trunk/reactos/media/inf/inf.rbuild trunk/reactos/tools/rbuild/automaticdependency.cpp trunk/reactos/tools/rbuild/bootstrap.cpp trunk/reactos/tools/rbuild/cdfile.cpp trunk/reactos/tools/rbuild/directory.cpp trunk/reactos/tools/rbuild/installfile.cpp trunk/reactos/tools/rbuild/module.cpp trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/media/inf/inf.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/inf.rbuild?rev=28... ============================================================================== --- trunk/reactos/media/inf/inf.rbuild (original) +++ trunk/reactos/media/inf/inf.rbuild Sat Aug 25 13:00:19 2007 @@ -1,23 +1,21 @@ <group> - <installfile base="inf">acpi.inf</installfile> - <installfile base="inf">cdrom.inf</installfile> - <installfile base="inf">display.inf</installfile> - <installfile base="inf">hdc.inf</installfile> - <installfile base="inf">keyboard.inf</installfile> - <installfile base="inf">layout.inf</installfile> - <installfile base="inf">machine.inf</installfile> - <installfile base="inf">msmouse.inf</installfile> - <installfile base="inf">NET_NIC.inf</installfile> - <installfile base="inf">netamd.inf</installfile> - <installfile base="inf">netisa.inf</installfile> - <installfile base="inf">netrtpnt.inf</installfile> - <installfile base="inf">nettcpip.inf</installfile> - <installfile base="inf">ports.inf</installfile> - <installfile base="inf">scsi.inf</installfile> - <installfile base="inf">usbport.inf</installfile> - <installfile base="inf">usbstor.inf</installfile> - <installfile base="inf">xboxdisp.inf</installfile> - - <!-- Don't change this , rbuild places the generated file there--> - <installfile base="inf" base="$(OUTPUT)">syssetup.inf</installfile> -</group> +<installfile base="inf">acpi.inf</installfile> +<installfile base="inf">cdrom.inf</installfile> +<installfile base="inf">display.inf</installfile> +<installfile base="inf">hdc.inf</installfile> +<installfile base="inf">keyboard.inf</installfile> +<installfile base="inf">layout.inf</installfile> +<installfile base="inf">machine.inf</installfile> +<installfile base="inf">msmouse.inf</installfile> +<installfile base="inf">NET_NIC.inf</installfile> +<installfile base="inf">netamd.inf</installfile> +<installfile base="inf">netisa.inf</installfile> +<installfile base="inf">netrtpnt.inf</installfile> +<installfile base="inf">nettcpip.inf</installfile> +<installfile base="inf">ports.inf</installfile> +<installfile base="inf">scsi.inf</installfile> +<installfile base="inf" root="output">syssetup.inf</installfile> +<installfile base="inf">usbport.inf</installfile> +<installfile base="inf">usbstor.inf</installfile> +<installfile base="inf">xboxdisp.inf</installfile> +<group>
Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/automaticdepen... ============================================================================== --- trunk/reactos/tools/rbuild/automaticdependency.cpp (original) +++ trunk/reactos/tools/rbuild/automaticdependency.cpp Sat Aug 25 13:00:19 2007 @@ -354,7 +354,6 @@ return path; }
-/* string AutomaticDependency::ResolveVariablesInPath ( const string& path ) { @@ -363,7 +362,6 @@ s = ReplaceVariable ( "$(INSTALL)", Environment::GetInstallPath (), s ); return s; } -*/
bool AutomaticDependency::LocateIncludedFile ( const string& directory,
Modified: trunk/reactos/tools/rbuild/bootstrap.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/bootstrap.cpp?... ============================================================================== --- trunk/reactos/tools/rbuild/bootstrap.cpp (original) +++ trunk/reactos/tools/rbuild/bootstrap.cpp Sat Aug 25 13:00:19 2007 @@ -74,6 +74,18 @@ __LINE__ ); }
+string +Bootstrap::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + void Bootstrap::Initialize () {
Modified: trunk/reactos/tools/rbuild/cdfile.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/cdfile.cpp?rev... ============================================================================== --- trunk/reactos/tools/rbuild/cdfile.cpp (original) +++ trunk/reactos/tools/rbuild/cdfile.cpp Sat Aug 25 13:00:19 2007 @@ -22,7 +22,6 @@
using std::string;
-/* string CDFile::ReplaceVariable ( const string& name, const string& value, @@ -34,7 +33,6 @@ else return path; } -*/
CDFile::CDFile ( const Project& project_, const XMLElement& cdfileNode, @@ -44,7 +42,7 @@ { const XMLAttribute* att = node.GetAttribute ( "base", false ); if ( att != NULL ) - base = ResolveVariablesInPath ( att->value ); + base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); else base = "";
Modified: trunk/reactos/tools/rbuild/directory.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/directory.cpp?... ============================================================================== --- trunk/reactos/tools/rbuild/directory.cpp (original) +++ trunk/reactos/tools/rbuild/directory.cpp Sat Aug 25 13:00:19 2007 @@ -116,6 +116,28 @@ return directoryWasCreated; }
+string +Directory::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + +void +Directory::ResolveVariablesInPath ( char* buf, + const string& path ) +{ + string s = ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path ); + s = ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s ); + s = ReplaceVariable ( "$(INSTALL)", Environment::GetInstallPath (), s ); + strcpy ( buf, s.c_str () ); +} + void Directory::GenerateTree ( const string& parent, bool verbose ) @@ -130,10 +152,8 @@ path = parent + sSep + name; else path = parent; - - path = ResolveVariablesInPath ( path ); - - if ( CreateDirectory ( path ) && verbose ) + ResolveVariablesInPath ( buf, path ); + if ( CreateDirectory ( buf ) && verbose ) printf ( "Created %s\n", buf ); } else
Modified: trunk/reactos/tools/rbuild/installfile.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/installfile.cp... ============================================================================== --- trunk/reactos/tools/rbuild/installfile.cpp (original) +++ trunk/reactos/tools/rbuild/installfile.cpp Sat Aug 25 13:00:19 2007 @@ -28,22 +28,7 @@ : project ( project_ ), node ( installfileNode ) { -} - -InstallFile::~InstallFile () -{ -} - -void -InstallFile::ProcessXML() -{ - const XMLAttribute* att = node.GetAttribute ( "root", false ); - if ( att != NULL ) - this->path = ResolveVariablesInPath ( att->value ); - else - this->path = path; - - att = node.GetAttribute ( "base", false ); + const XMLAttribute* att = node.GetAttribute ( "base", false ); if ( att != NULL ) base = att->value; else @@ -55,6 +40,28 @@ else newname = node.value; name = node.value; + + att = node.GetAttribute ( "root", false ); + if ( att != NULL) + { + if ( att->value == "intermediate" ) + this->path = "$(INTERMEDIATE)" + sSep + path; + else if ( att->value == "output" ) + this->path = "$(OUTPUT)" + sSep + path; + else + { + throw InvalidAttributeValueException ( + node.location, + "root", + att->value ); + } + } + else + this->path = path; +} + +InstallFile::~InstallFile () +{ }
string @@ -63,3 +70,7 @@ return path + sSep + name; }
+void +InstallFile::ProcessXML() +{ +}
Modified: trunk/reactos/tools/rbuild/module.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?rev... ============================================================================== --- trunk/reactos/tools/rbuild/module.cpp (original) +++ trunk/reactos/tools/rbuild/module.cpp Sat Aug 25 13:00:19 2007 @@ -22,31 +22,6 @@
using std::string; using std::vector; - -string -ResolveVariablesInPath ( const string& path ) -{ - string s; - - s = ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path ); - s = ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s ); - s = ReplaceVariable ( "$(INSTALL)", Environment::GetInstallPath (), s ); - s = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), s ); - - return s; -} - -string -ReplaceVariable ( const string& name, - const string& value, - string path ) -{ - size_t i = path.find ( name ); - if ( i != string::npos ) - return path.replace ( i, name.length (), value ); - else - return path; -}
string Right ( const string& s, size_t n )
Modified: trunk/reactos/tools/rbuild/rbuild.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=2... ============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h (original) +++ trunk/reactos/tools/rbuild/rbuild.h Sat Aug 25 13:00:19 2007 @@ -119,9 +119,12 @@ const std::string& parent ); private: bool mkdir_p ( const char* path ); + std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); std::string GetEnvironmentVariable ( const std::string& name ); - //void ResolveVariablesInPath ( char* buf, - // const std::string& path ); + void ResolveVariablesInPath ( char* buf, + const std::string& path ); bool CreateDirectory ( std::string path ); };
@@ -780,7 +783,7 @@ std::string ReplaceVariable ( const std::string& name, const std::string& value, std::string path ); -// std::string ResolveVariablesInPath ( const std::string& path ); + std::string ResolveVariablesInPath ( const std::string& path ); std::map<std::string, SourceFile*> sourcefile_map; };
@@ -802,6 +805,9 @@ private: bool IsSupportedModuleType ( ModuleType type ); void Initialize(); + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); };
@@ -822,6 +828,9 @@ void ProcessXML(); std::string GetPath () const; private: + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); };
@@ -841,7 +850,6 @@ ~InstallFile (); void ProcessXML (); std::string GetPath () const; -private: };
@@ -989,14 +997,6 @@ InitializeEnvironment ();
extern std::string -ResolveVariablesInPath ( const std::string& path ); - -extern std::string -ReplaceVariable ( const std::string& name, - const std::string& value, - std::string path ); - -extern std::string Right ( const std::string& s, size_t n );
extern std::string