diff --git a/.monadid b/.monadid index 605d7b63ac17960dcf5bb39328700851377ce56b..8cb4b488fd43411b8dcbf91552ff84f86a68ad50 100644 --- a/.monadid +++ b/.monadid @@ -1,4 +1,4 @@ pure-monad identification file This file is used for pure-monad directory identification Built by toole1 on linux1.ews.illinois.edu -Build Date: Thu Jan 26 17:09:06 CST 2012 +Build Date: Tue Jan 31 16:22:13 CST 2012 diff --git a/monad b/monad index 36eb538451987e40d3e1ce9a989a6c1477cf9276..d87b9524c1cacfcf07d0c2fce791847eb37ca94b 100755 --- a/monad +++ b/monad @@ -14,7 +14,7 @@ MONAD_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE_DIR="$MONAD_DIR/source" CALLING_DIR=`pwd` -svn up "$MONAD_DIR" -q +svn up "$MONAD_DIR" -q --accept theirs-full make -C "$SOURCE_DIR" -q if [ "$?" -ne 0 ]; then make -C "$SOURCE_DIR" --quiet diff --git a/source/Makefile b/source/Makefile index 86d2ecae9efba58944a87cbb4acc728f66283b92..4aa17a77c3be3af76f95d64997b5bcd93ce2a669 100644 --- a/source/Makefile +++ b/source/Makefile @@ -4,7 +4,7 @@ EXENAME = pure-monad CCMONAD = cc-monad OBJS = monad.o help.o util.o monad_shared.o CCOBJS = ccmonad.o util.o monad_shared.o -IDFILE = .monadid +IDFILE = ../.monadid OPTIMIZE = off ifeq ($(strip $(OPTIMIZE)),on) diff --git a/source/Makefile.proxy b/source/Makefile.proxy index 455219624a46f3301676a2685abc0df0763dadc3..0ba37c07ce76a41ff3d3f01c83ad0db884806a01 100644 --- a/source/Makefile.proxy +++ b/source/Makefile.proxy @@ -36,7 +36,7 @@ $(TESTEXE): $(TESTOBJS) $(CC) $(TESTOBJS) $(LIBS) -o $@ unit_tests.o : unit_tests.cpp $(wildcard *.h) - ../cc-monad $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@ + ../source/cc-monad $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@ %.o : %.cpp $(wildcard *.h) $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@ diff --git a/source/monad.cpp b/source/monad.cpp index c5ad9096327366d9583e1e8fd87d25318ceaaa98..5fa40b8445bd3409f661e049227fbc711e9756d0 100644 --- a/source/monad.cpp +++ b/source/monad.cpp @@ -27,6 +27,7 @@ const int8_t no_mp_part = -1; int callingDirFD; int monadDirFD; +string monadSourceFolder; string testsFolder; string sourceFolder; string gradeFolder; @@ -72,7 +73,7 @@ int main(int argc, const char * const * argv) // Read in local config settings. // Necessary to do this early for [SVN Root] url - readConfig("./", config); + readConfig(monadSourceFolder, config); processArgs(argc, argv); cout << versioninfo::official_name << endl; @@ -100,7 +101,7 @@ int main(int argc, const char * const * argv) // sleep(1); output::header("Compiling"); - chdir(gradeFolder.c_str()); + chdir(gradeFolder); // #define MP_PART_NUMBER in proxy create_mp_part_file(); @@ -322,6 +323,14 @@ void monad::find_base_dir(const char * argv0) } delete [] dir; + if (exists("../.monadid")) + { + chdir("../"); + monadSourceFolder = "./source/"; + } + else + monadSourceFolder = "./"; + monadDirFD = open(".", 0); // Ensure the dir is correct @@ -349,10 +358,10 @@ void monad::copyRequiredFiles() exec("/bin/mkdir", gradeFolder); // Copy and link appropriate files - parsed from config.ini - importFiles(tempFolder, "./", gradeFolder, config["Monad Files"]); - importFiles(tempFolder, testsFolder, gradeFolder, config["Testing Files"]); - importFiles("", sourceFolder, gradeFolder, config["Required Files"]); - importFiles(tempFolder, "", gradeFolder, config["Preserved Files"]); + importFiles(tempFolder, monadSourceFolder, gradeFolder, config["Monad Files"]); + importFiles(tempFolder, testsFolder, gradeFolder, config["Testing Files"]); + importFiles("", sourceFolder, gradeFolder, config["Required Files"]); + importFiles(tempFolder, "", gradeFolder, config["Preserved Files"]); forceRemoveDir(tempFolder); @@ -368,7 +377,7 @@ void monad::importFiles(const string & preservedFolder, const string & theSource assertExists(destFolder); if (preservedFolder != "") assertExists(preservedFolder); - if (theSourceFolder != "") assertExists(theSourceFolder, student_error_code); + if (theSourceFolder != "") assertExists(theSourceFolder, student_error_code); for (size_t i = 0; i < files.size(); i++) { @@ -379,7 +388,6 @@ void monad::importFiles(const string & preservedFolder, const string & theSource if (preservedFolder != "" && exists(preservedFile) && (theSourceFolder == "" || (permissions(preservedFile) & S_IWUSR) == 0)) { -//!! cout << "mv " << preservedFile << ' ' << destFile << endl; EXIT_IF_ERROR(rename(preservedFile.c_str(), destFile.c_str())); } else if (theSourceFolder != "") diff --git a/source/monad_shared.cpp b/source/monad_shared.cpp index 28664931b4a3a5314f7805341f1844ce23ef70ae..8ad848066ccc3b8004917342041850d734373176 100644 --- a/source/monad_shared.cpp +++ b/source/monad_shared.cpp @@ -15,8 +15,8 @@ namespace versioninfo { const char * official_name = "Monad Autograder"; const char * version_name = "mazecity"; -const Version version_num = Version(3, 0, 0, 1); -const char * date = "18 Jan 2012"; +const Version version_num = Version(3, 0, 2); +const char * date = "31 Jan 2012"; } const char * unit_test_result::pass_string = "~~PASSED~~"; diff --git a/source/monad_shared.h b/source/monad_shared.h index be64ec40f0c1ad0bb108757a33040dc37af6d0b5..16465e9f62454aaad0ab5c0bc829fd8c67ec5383 100644 --- a/source/monad_shared.h +++ b/source/monad_shared.h @@ -11,10 +11,9 @@ namespace monad_shared int32_t major_; int32_t minor_; int32_t patch_; - int32_t build_; - Version(int32_t maj, int32_t min, int32_t pat, int32_t bld) - : major_(maj), minor_(min), patch_(pat), build_(bld) + Version(int32_t maj, int32_t min, int32_t pat) + : major_(maj), minor_(min), patch_(pat) { } #if 0 @@ -27,7 +26,7 @@ namespace monad_shared void print(std::ostream & out) const { - out << major_ << '.' << minor_ << '.' << patch_ << '.' << build_; + out << major_ << '.' << minor_ << '.' << patch_; } };