- merged changes with windows build fixes

- updated svn commands to git for validation params
This commit is contained in:
SoftCoder 2013-12-14 02:44:41 -08:00
parent 1d9f1f9432
commit 65e55d3796
3 changed files with 48 additions and 52 deletions

View File

@ -1584,7 +1584,7 @@ void setupLogging(Config &config, bool haveSpecialOutputCommandLineOption) {
void runTilesetValidationForPath(string tilesetPath, string tilesetName, void runTilesetValidationForPath(string tilesetPath, string tilesetName,
World &world, bool purgeUnusedFiles,bool purgeDuplicateFiles, World &world, bool purgeUnusedFiles,bool purgeDuplicateFiles,
bool showDuplicateFiles, bool svnPurgeFiles,double &purgedMegaBytes) { bool showDuplicateFiles, bool gitPurgeFiles,double &purgedMegaBytes) {
Checksum checksum; Checksum checksum;
bool techtree_errors = false; bool techtree_errors = false;
@ -1690,11 +1690,11 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
purgedMegaBytes += ((double)fileSize / 1048576.0); purgedMegaBytes += ((double)fileSize / 1048576.0);
purgeCount++; purgeCount++;
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",foundFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",foundFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
} }
@ -1790,16 +1790,16 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
replaceAll(expandedNewCommonFileName, "//", "/"); replaceAll(expandedNewCommonFileName, "//", "/");
createDirectoryPaths(extractDirectoryPathFromFile(expandedNewCommonFileName)); createDirectoryPaths(extractDirectoryPathFromFile(expandedNewCommonFileName));
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
copyFileTo(duplicateFile, expandedNewCommonFileName); copyFileTo(duplicateFile, expandedNewCommonFileName);
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",duplicateFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",duplicateFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
printf("*** Duplicate file:\n[%s]\nwas svn deleted and copied to:\n[%s]\n",duplicateFile.c_str(),expandedNewCommonFileName.c_str()); printf("*** Duplicate file:\n[%s]\nwas git rm and copied to:\n[%s]\n",duplicateFile.c_str(),expandedNewCommonFileName.c_str());
} }
else { else {
//int result = 0; //int result = 0;
@ -1816,14 +1816,14 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
} }
} }
else { else {
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",duplicateFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",duplicateFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
printf("*** Duplicate file:\n[%s]\nwas svn deleted\n",duplicateFile.c_str()); printf("*** Duplicate file:\n[%s]\nwas git rm\n",duplicateFile.c_str());
} }
else { else {
removeFile(duplicateFile); removeFile(duplicateFile);
@ -1923,7 +1923,7 @@ void runTilesetValidationForPath(string tilesetPath, string tilesetName,
void runTechValidationForPath(string techPath, string techName, void runTechValidationForPath(string techPath, string techName,
const std::vector<string> &filteredFactionList, World &world, const std::vector<string> &filteredFactionList, World &world,
bool purgeUnusedFiles,bool purgeDuplicateFiles, bool showDuplicateFiles, bool purgeUnusedFiles,bool purgeDuplicateFiles, bool showDuplicateFiles,
bool svnPurgeFiles,double &purgedMegaBytes) { bool gitPurgeFiles,double &purgedMegaBytes) {
string techTreeFolder = techPath + techName; string techTreeFolder = techPath + techName;
string techTreeFactionFolder = techTreeFolder + "/factions/"; string techTreeFactionFolder = techTreeFolder + "/factions/";
@ -2121,11 +2121,11 @@ void runTechValidationForPath(string techPath, string techName,
purgedMegaBytes += ((double)fileSize / 1048576.0); purgedMegaBytes += ((double)fileSize / 1048576.0);
purgeCount++; purgeCount++;
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",foundFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",foundFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
} }
@ -2249,16 +2249,16 @@ void runTechValidationForPath(string techPath, string techName,
replaceAll(expandedNewCommonFileName, "//", "/"); replaceAll(expandedNewCommonFileName, "//", "/");
createDirectoryPaths(extractDirectoryPathFromFile(expandedNewCommonFileName)); createDirectoryPaths(extractDirectoryPathFromFile(expandedNewCommonFileName));
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
copyFileTo(duplicateFile, expandedNewCommonFileName); copyFileTo(duplicateFile, expandedNewCommonFileName);
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",duplicateFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",duplicateFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
printf("*** Duplicate file:\n[%s]\nwas svn deleted and copied to:\n[%s]\n",duplicateFile.c_str(),expandedNewCommonFileName.c_str()); printf("*** Duplicate file:\n[%s]\nwas git rm and copied to:\n[%s]\n",duplicateFile.c_str(),expandedNewCommonFileName.c_str());
} }
else { else {
printf("moving duplicate [%s] to common data [%s] expanded to [%s]\n",duplicateFile.c_str(),newCommonFileName.c_str(),expandedNewCommonFileName.c_str()); printf("moving duplicate [%s] to common data [%s] expanded to [%s]\n",duplicateFile.c_str(),newCommonFileName.c_str(),expandedNewCommonFileName.c_str());
@ -2276,14 +2276,14 @@ void runTechValidationForPath(string techPath, string techName,
} }
} }
else { else {
if(svnPurgeFiles == true) { if(gitPurgeFiles == true) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"svn delete \"%s\"",duplicateFile.c_str()); snprintf(szBuf,8096,"git rm \"%s\"",duplicateFile.c_str());
bool svnOk = executeShellCommand(szBuf,0); bool gitOk = executeShellCommand(szBuf,0);
if(svnOk == false) { if(gitOk == false) {
throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]"); throw megaglest_runtime_error("Call to command failed [" + string(szBuf) + "]");
} }
printf("*** Duplicate file:\n[%s]\nwas svn deleted\n",duplicateFile.c_str()); printf("*** Duplicate file:\n[%s]\nwas git rm\n",duplicateFile.c_str());
} }
else { else {
printf("removing duplicate [%s]\n",duplicateFile.c_str()); printf("removing duplicate [%s]\n",duplicateFile.c_str());
@ -2634,7 +2634,7 @@ void runTechValidationReport(int argc, char** argv) {
bool purgeDuplicateFiles = false; bool purgeDuplicateFiles = false;
bool showDuplicateFiles = true; bool showDuplicateFiles = true;
bool purgeUnusedFiles = false; bool purgeUnusedFiles = false;
bool svnPurgeFiles = false; bool gitPurgeFiles = false;
double purgedMegaBytes=0; double purgedMegaBytes=0;
Config &config = Config::getInstance(); Config &config = Config::getInstance();
@ -2794,9 +2794,9 @@ void runTechValidationReport(int argc, char** argv) {
purgeDuplicateFiles = true; purgeDuplicateFiles = true;
printf("*NOTE All duplicate techtree files will be merged!\n"); printf("*NOTE All duplicate techtree files will be merged!\n");
} }
else if(paramPartTokens[2] == "svndelete") { else if(paramPartTokens[2] == "gitdelete") {
svnPurgeFiles = true; gitPurgeFiles = true;
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n"); printf("*NOTE All unused / duplicate techtree files will be removed from git!\n");
} }
else if(paramPartTokens[2] == "hideduplicates") { else if(paramPartTokens[2] == "hideduplicates") {
showDuplicateFiles = false; showDuplicateFiles = false;
@ -2812,9 +2812,9 @@ void runTechValidationReport(int argc, char** argv) {
purgeDuplicateFiles = true; purgeDuplicateFiles = true;
printf("*NOTE All duplicate techtree files will be merged!\n"); printf("*NOTE All duplicate techtree files will be merged!\n");
} }
else if(paramPartTokens[3] == "svndelete") { else if(paramPartTokens[3] == "gitdelete") {
svnPurgeFiles = true; gitPurgeFiles = true;
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n"); printf("*NOTE All unused / duplicate techtree files will be removed from git!\n");
} }
else if(paramPartTokens[3] == "hideduplicates") { else if(paramPartTokens[3] == "hideduplicates") {
showDuplicateFiles = false; showDuplicateFiles = false;
@ -2830,9 +2830,9 @@ void runTechValidationReport(int argc, char** argv) {
purgeDuplicateFiles = true; purgeDuplicateFiles = true;
printf("*NOTE All duplicate techtree files will be merged!\n"); printf("*NOTE All duplicate techtree files will be merged!\n");
} }
else if(paramPartTokens[4] == "svndelete") { else if(paramPartTokens[4] == "gitdelete") {
svnPurgeFiles = true; gitPurgeFiles = true;
printf("*NOTE All unused / duplicate techtree files will be removed from svn!\n"); printf("*NOTE All unused / duplicate techtree files will be removed from git!\n");
} }
else if(paramPartTokens[4] == "hideduplicates") { else if(paramPartTokens[4] == "hideduplicates") {
showDuplicateFiles = false; showDuplicateFiles = false;
@ -2859,7 +2859,7 @@ void runTechValidationReport(int argc, char** argv) {
runTechValidationForPath(techPath, techName, filteredFactionList, runTechValidationForPath(techPath, techName, filteredFactionList,
world, purgeUnusedFiles,purgeDuplicateFiles, world, purgeUnusedFiles,purgeDuplicateFiles,
showDuplicateFiles,svnPurgeFiles,purgedMegaBytes); showDuplicateFiles,gitPurgeFiles,purgedMegaBytes);
} }
} }
} }
@ -3256,8 +3256,8 @@ void CheckForDuplicateData() {
oldFile = newFile + "/" + tilesetName + ".xml"; oldFile = newFile + "/" + tilesetName + ".xml";
newFile = newFile + "/" + tilesetName + "_custom.xml"; newFile = newFile + "/" + tilesetName + "_custom.xml";
bool rename_result = rename(oldFile.c_str(),newFile.c_str()); int rename_result = rename(oldFile.c_str(),newFile.c_str());
if(rename_result == false) { if(rename_result != 0) {
printf("Error renaming [%s] to [%s]\n",oldFile.c_str(),newFile.c_str()); printf("Error renaming [%s] to [%s]\n",oldFile.c_str(),newFile.c_str());
} }
} }

View File

@ -13,11 +13,9 @@
#define _SHARED_PLATFORM_FACTORYREPOSITORY_H_ #define _SHARED_PLATFORM_FACTORYREPOSITORY_H_
#include <string> #include <string>
#include "graphics_factory.h" #include "graphics_factory.h"
#include "sound_factory.h" #include "sound_factory.h"
#include "graphics_factory_gl.h" #include "graphics_factory_gl.h"
#include "sound_factory_openal.h" #include "sound_factory_openal.h"
#include "sound_factory_none.h" #include "sound_factory_none.h"
#include "leak_dumper.h" #include "leak_dumper.h"
@ -27,7 +25,6 @@ using std::string;
using Shared::Graphics::GraphicsFactory; using Shared::Graphics::GraphicsFactory;
using Shared::Sound::SoundFactory; using Shared::Sound::SoundFactory;
using Shared::Graphics::Gl::GraphicsFactoryGl; using Shared::Graphics::Gl::GraphicsFactoryGl;
using Shared::Sound::OpenAL::SoundFactoryOpenAL; using Shared::Sound::OpenAL::SoundFactoryOpenAL;
using Shared::Sound::SoundFactoryNone; using Shared::Sound::SoundFactoryNone;
@ -45,7 +42,6 @@ private:
private: private:
GraphicsFactoryGl graphicsFactoryGl; GraphicsFactoryGl graphicsFactoryGl;
SoundFactoryOpenAL soundFactoryOpenAL; SoundFactoryOpenAL soundFactoryOpenAL;
SoundFactoryNone soundFactoryNone; SoundFactoryNone soundFactoryNone;

View File

@ -255,7 +255,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
printf("\n%s\t\t\tdisplays your CURL version information.",GAME_ARGS[GAME_ARG_CURL_INFO]); printf("\n%s\t\t\tdisplays your CURL version information.",GAME_ARGS[GAME_ARG_CURL_INFO]);
printf("\n%s\t\t\tdisplays your XERCES version information.",GAME_ARGS[GAME_ARG_XERCES_INFO]); printf("\n%s\t\t\tdisplays your XERCES version information.",GAME_ARGS[GAME_ARG_XERCES_INFO]);
printf("\n%s=x=purgeunused=purgeduplicates=svndelete=hideduplicates",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]); printf("\n%s=x=purgeunused=purgeduplicates=gitdelete=hideduplicates",GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]);
printf("\n \t\tdisplay a report detailing any known problems"); printf("\n \t\tdisplay a report detailing any known problems");
printf("\n \t\trelated to your selected techtrees game data."); printf("\n \t\trelated to your selected techtrees game data.");
printf("\n \t\tWhere x is a comma-delimited list of techtrees"); printf("\n \t\tWhere x is a comma-delimited list of techtrees");
@ -267,9 +267,9 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
printf("\n \t\tWhere purgeduplicates is an optional parameter"); printf("\n \t\tWhere purgeduplicates is an optional parameter");
printf("\n \t\t telling the validation to merge"); printf("\n \t\t telling the validation to merge");
printf("\n \t\t duplicate files in the techtree."); printf("\n \t\t duplicate files in the techtree.");
printf("\n \t\tWhere svndelete is an optional parameter"); printf("\n \t\tWhere gitdelete is an optional parameter");
printf("\n \t\t telling the validation to call"); printf("\n \t\t telling the validation to call");
printf("\n \t\t svn delete on duplicate / unused"); printf("\n \t\t git rm on duplicate / unused");
printf("\n \t\t files in the techtree."); printf("\n \t\t files in the techtree.");
printf("\n \t\tWhere hideduplicates is an optional parameter"); printf("\n \t\tWhere hideduplicates is an optional parameter");
printf("\n \t\t telling the validation to NOT SHOW"); printf("\n \t\t telling the validation to NOT SHOW");
@ -298,7 +298,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
printf("\n \t\texample:"); printf("\n \t\texample:");
printf("\n %s %s=tech,egypt",extractFileFromDirectoryPath(argv0).c_str(),GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]); printf("\n %s %s=tech,egypt",extractFileFromDirectoryPath(argv0).c_str(),GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]);
printf("\n%s=x=purgeunused=svndelete",GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]); printf("\n%s=x=purgeunused=gitdelete",GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]);
printf("\n \t\tdisplay a report detailing any known problems"); printf("\n \t\tdisplay a report detailing any known problems");
printf("\n \t\trelated to your selected scenario game data."); printf("\n \t\trelated to your selected scenario game data.");
printf("\n \t\tWhere x is a single scenario to validate."); printf("\n \t\tWhere x is a single scenario to validate.");
@ -308,7 +308,7 @@ void printParameterHelp(const char *argv0, bool foundInvalidArgs) {
printf("\n \t\texample:"); printf("\n \t\texample:");
printf("\n %s %s=stranded",extractFileFromDirectoryPath(argv0).c_str(),GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]); printf("\n %s %s=stranded",extractFileFromDirectoryPath(argv0).c_str(),GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]);
printf("\n%s=x=purgeunused=svndelete",GAME_ARGS[GAME_ARG_VALIDATE_TILESET]); printf("\n%s=x=purgeunused=gitdelete",GAME_ARGS[GAME_ARG_VALIDATE_TILESET]);
printf("\n \t\tdisplay a report detailing any known problems"); printf("\n \t\tdisplay a report detailing any known problems");
printf("\n \t\trelated to your selected tileset game data."); printf("\n \t\trelated to your selected tileset game data.");
printf("\n \t\tWhere x is a single tileset to validate."); printf("\n \t\tWhere x is a single tileset to validate.");