From c4460098f16dfa6a454a04ee809ae82809601022 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 27 Jul 2012 12:34:40 +0200 Subject: [PATCH] Changed: #1440 Return list of removed files as well --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/service/database_status.cpp | 9 ++++++--- code/nel/tools/pipeline/service/database_status.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/pipeline/service/database_status.cpp b/code/nel/tools/pipeline/service/database_status.cpp index 8c716f41b..9eb8bbfde 100644 --- a/code/nel/tools/pipeline/service/database_status.cpp +++ b/code/nel/tools/pipeline/service/database_status.cpp @@ -172,7 +172,7 @@ void CFileStatus::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) stream.serial(CRC32); } -void CFileRemoved::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) +void CFileRemove::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) { uint version = stream.serialVersion(1); stream.serial(Lost); @@ -219,11 +219,14 @@ bool CDatabaseStatus::getFileStatus(CFileStatus &fileStatus, const std::string & return seemsValid; } -bool CDatabaseStatus::getFileStatus(std::map &fileStatusMap, const std::vector &paths) +bool CDatabaseStatus::getFileStatus(std::map &fileStatusMap, std::map &fileRemoveMap, const std::vector &paths) { nlassert(false); // i don't think this is used? (yet?) (maybe for slave?) // probably just some ghost code spooking around. + // this code shall be used by the slave to get all the infos + // in the slave it will compare the returned data for example with the last successful build time and return added/changed/removed to the plugin + for (std::vector::const_iterator it = paths.begin(), end = paths.end(); it != end; ++it) { @@ -509,7 +512,7 @@ void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, // Create the removed tag. std::string removedTagFile = dirPathMeta + subPathFilename + PIPELINE_DATABASE_REMOVE_SUFFIX; uint32 time = CTime::getSecondsSince1970(); - CFileRemoved removed; + CFileRemove removed; removed.Lost = time; // Yes you're wasting time, you wouldn't have to delete anything if you did your work properly in the first place! :) COFile of(removedTagFile, false, false, true); removed.serial(of); diff --git a/code/nel/tools/pipeline/service/database_status.h b/code/nel/tools/pipeline/service/database_status.h index ddb105cc9..da868da6b 100644 --- a/code/nel/tools/pipeline/service/database_status.h +++ b/code/nel/tools/pipeline/service/database_status.h @@ -92,7 +92,7 @@ public: void serial(NLMISC::IStream &stream) throw (NLMISC::EStream); }; -struct CFileRemoved +struct CFileRemove { public: uint32 Lost; // The time when it was noticed the file was removed. @@ -127,7 +127,7 @@ public: /// Runs an update of the file status of given paths asynchronously. Warning: If g_IsExiting during callback then update is incomplete. Callback is always called when done (or failed). Do NOT use the wait parameter. Do NOT use recurse, please. Recurse directories beforehand. Paths may contain db and pl macros. void updateDatabaseStatus(const CCallback &callback, const std::vector &paths, bool wait = false, bool recurse = false); /// Gets the last file statuses of given paths in a map. Directories are scanned for files, non recursively. Returns false if one of the statuses is bad (not updated; file changed inbetween). Considered as build error. - bool getFileStatus(std::map &fileStatusMap, const std::vector &paths); + bool getFileStatus(std::map &fileStatusMap, std::map &fileRemoveMap, const std::vector &paths); void getFileErrors(CFileErrors &fileErrors, const std::string &filePath, uint32 newerThan = 0) const; void addFileError(const std::string &filePath, const CFileError &fileError);