|
Boost-Commit : |
From: bdawes_at_[hidden]
Date: 2008-07-08 21:05:34
Author: bemandawes
Date: 2008-07-08 21:05:33 EDT (Tue, 08 Jul 2008)
New Revision: 47252
URL: http://svn.boost.org/trac/boost/changeset/47252
Log:
Initial commit
Added:
trunk/tools/release/compare_trees.cpp (contents, props changed)
trunk/tools/release/msvc/
trunk/tools/release/msvc/compare_trees/
trunk/tools/release/msvc/compare_trees/compare_trees.vcproj (contents, props changed)
trunk/tools/release/msvc/msvc.sln (contents, props changed)
Added: trunk/tools/release/compare_trees.cpp
==============================================================================
--- (empty file)
+++ trunk/tools/release/compare_trees.cpp 2008-07-08 21:05:33 EDT (Tue, 08 Jul 2008)
@@ -0,0 +1,91 @@
+// compare_trees.cpp -------------------------------------------------------//
+
+// Copyright Beman Dawes 2008
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//----------------------------------------------------------------------------//
+
+#include <boost/filesystem.hpp>
+#include <iostream>
+#include <fstream>
+#include <string>
+
+using namespace boost::filesystem;
+using std::string;
+
+namespace
+{
+
+// load_file ---------------------------------------------------------------//
+
+ void load_file( const path & p, string & target )
+ {
+
+ std::ifstream fin( p.string().c_str(),
+ std::ios_base::in|std::ios_base::binary );
+ if ( !fin )
+ std::cout << "could not open input file: " << p.string() << '\n';
+ std::getline( fin, target, '\0' ); // read the whole file
+ }
+}
+
+// main --------------------------------------------------------------------//
+
+int main( int argc, char * argv[] )
+{
+ if ( argc != 3 )
+ {
+ std::cout << "Usage: compare_trees [options ...] path1 path2\n";
+ return 1;
+ }
+
+ path p1(argv[1]);
+ path p2(argv[2]);
+
+ recursive_directory_iterator it( p1 );
+ recursive_directory_iterator end;
+
+ for ( ; it != end; ++it )
+ {
+ //std::cout << it->string() << "\n";
+ if ( it->filename()[0] == '.' )
+ {
+ it.no_push();
+ continue;
+ }
+ string s = it->string();
+ s.erase(0, p1.string().size());
+ path t(p2);
+ t /= s;
+ if ( !exists(t) )
+ {
+ std::cout << t.string() << " does not exist\n";
+ if ( is_directory( it.status() ) )
+ it.no_push();
+ }
+ else if ( is_regular_file( it.status() ) )
+ {
+ if ( file_size(*it) != file_size(t) )
+ {
+ std::cout << t.string() << " different size\n";
+ }
+
+ // size of the two files is the same, so compare contents
+ else
+ {
+ string contents1, contents2;
+ load_file(*it, contents1);
+ load_file(t, contents2);
+ if ( contents1 != contents2 )
+ {
+ std::cout << t.string() << " different content\n";
+ }
+ }
+ }
+ }
+
+ return 0;
+}
Added: trunk/tools/release/msvc/compare_trees/compare_trees.vcproj
==============================================================================
--- (empty file)
+++ trunk/tools/release/msvc/compare_trees/compare_trees.vcproj 2008-07-08 21:05:33 EDT (Tue, 08 Jul 2008)
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="compare_trees"
+ ProjectGUID="{7E6AD5ED-4168-4613-A342-0217AA82DEC1}"
+ RootNamespace="compare_trees"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\..\..\stage\lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="..\..\..\.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\..\..\stage\lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\compare_trees.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: trunk/tools/release/msvc/msvc.sln
==============================================================================
--- (empty file)
+++ trunk/tools/release/msvc/msvc.sln 2008-07-08 21:05:33 EDT (Tue, 08 Jul 2008)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compare_trees", "compare_trees\compare_trees.vcproj", "{7E6AD5ED-4168-4613-A342-0217AA82DEC1}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Debug|Win32.Build.0 = Debug|Win32
+ {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Release|Win32.ActiveCfg = Release|Win32
+ {7E6AD5ED-4168-4613-A342-0217AA82DEC1}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk