diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-06 20:42:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-06 20:42:36 +0000 |
commit | 8a14e1223d399f9e1abe2e095459ef285585b447 (patch) | |
tree | 34afa7f445b803620046f4845b627b29d684d91d | |
parent | a41015121dd1f01e9391a8a2b4d850a1b7f6820b (diff) |
Auto update modules from src/modules/extra by recopying them in configure if they exist also in src/modules
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10420 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | win/configure.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/win/configure.cpp b/win/configure.cpp index 1bc6aba13..875915c10 100644 --- a/win/configure.cpp +++ b/win/configure.cpp @@ -28,6 +28,7 @@ void Banner(); void WriteCompileModules(); void WriteCompileCommands(); void Rebase(); +void CopyExtras(); /* detects if we are running windows xp or higher (5.1) */ bool iswinxp() @@ -300,6 +301,8 @@ void Run() printf_c("\n\033[1;32mPre-build configuration is complete!\n\n"); sc(TNORMAL); + CopyExtras(); + // dump all the options back out printf_c("\033[0mBase install path:\033[1;32m %s\n", base_path); printf_c("\033[0mConfig path:\033[1;32m %s\n", config_file); @@ -375,6 +378,43 @@ void Run() printf("\nconfigure is done.. exiting!\n"); } +/* Keeps files from modules/extra up to date if theyre copied into modules/ */ +void CopyExtras() +{ + char dest[65535]; + char src[65535]; + + printf("\nUpdating extra modules in src/modules...\n"); + + WIN32_FIND_DATA fd; + HANDLE fh = FindFirstFile("..\\src\\modules\\extra\\*.*", &fd); + + if(fh == INVALID_HANDLE_VALUE) + return; + + do + { + strcpy(dest, "..\\src\\modules\\"); + strcat(dest, fd.cFileName); + strcpy(src, "..\\src\\modules\\extra\\"); + strcat(src, fd.cFileName); + FILE* x = fopen(dest, "r"); + if (x) + { + fclose(x); + CopyFile(src, dest, false); + sc(TGREEN); printf(" %s", fd.cFileName); sc(TNORMAL); + printf("...\n"); + } + } + while (FindNextFile(fh, &fd)); + + FindClose(fh); + + printf("\n\n"); +} + + void Rebase() { char dest[65535]; |