diff --git a/code/nel/tools/pipeline/service/database_status.cpp b/code/nel/tools/pipeline/service/database_status.cpp index 611e99531..dda84a3cb 100644 --- a/code/nel/tools/pipeline/service/database_status.cpp +++ b/code/nel/tools/pipeline/service/database_status.cpp @@ -194,7 +194,7 @@ bool CDatabaseStatus::getFileStatus(std::map &fileStat return true; } -void CDatabaseStatus::getRemoved(std::map &fileRemoveMap, const std::vector &paths) +bool CDatabaseStatus::getRemoved(std::map &fileRemoveMap, const std::vector &paths) { for (std::vector::const_iterator it = paths.begin(), end = paths.end(); it != end; ++it) { @@ -249,9 +249,15 @@ void CDatabaseStatus::getRemoved(std::map &fileRemoveM nldebug("Found remove meta for file '%s'!", subPathOrig.c_str()); // Read the removed tag. - std::string removedTagFile = dirPathMeta + subPathFilename + PIPELINE_DATABASE_REMOVE_SUFFIX; + std::string removeTagFile = dirPathMeta + subPathFilename + PIPELINE_DATABASE_REMOVE_SUFFIX; + std::string statusTagFile = dirPathMeta + subPathFilename + PIPELINE_DATABASE_STATUS_SUFFIX; + if (CFile::isExists(statusTagFile)) + { + nlwarning("Removed file has status"); + return false; + } CFileRemove fr; - CIFile ifr(removedTagFile, false); + CIFile ifr(removeTagFile, false); fr.serial(ifr); ifr.close(); @@ -260,7 +266,7 @@ void CDatabaseStatus::getRemoved(std::map &fileRemoveM // TODO_PROCESS_ERROR_EXIT if (g_IsExiting) - return; + return false; } } } @@ -269,11 +275,17 @@ void CDatabaseStatus::getRemoved(std::map &fileRemoveM // TODO_PROCESS_WARNING nlwarning("Requesting information on file or directory '%s' that does not exist!", path.c_str()); CFileRemove fr; - std::string removedTagFile = CWorkspaceStorage::getMetaFilePath(path, PIPELINE_DATABASE_REMOVE_SUFFIX); - if (CFile::isExists(removedTagFile)) + std::string removeTagFile = CWorkspaceStorage::getMetaFilePath(path, PIPELINE_DATABASE_REMOVE_SUFFIX); + std::string statusTagFile = CWorkspaceStorage::getMetaFilePath(path, PIPELINE_DATABASE_RESULT_SUFFIX); + if (CFile::isExists(statusTagFile)) + { + nlwarning("Not existing file has status"); + return false; + } + if (CFile::isExists(removeTagFile)) { // file existed before - CIFile ifr(removedTagFile, false); + CIFile ifr(removeTagFile, false); fr.serial(ifr); ifr.close(); } @@ -287,8 +299,10 @@ void CDatabaseStatus::getRemoved(std::map &fileRemoveM // TODO_PROCESS_ERROR_EXIT if (g_IsExiting) - return; + return false; } + + return true; } namespace { diff --git a/code/nel/tools/pipeline/service/database_status.h b/code/nel/tools/pipeline/service/database_status.h index 5a675e185..d762cfaf3 100644 --- a/code/nel/tools/pipeline/service/database_status.h +++ b/code/nel/tools/pipeline/service/database_status.h @@ -78,7 +78,7 @@ public: /// 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, std::map &fileRemoveMap, const std::vector &paths); /// Gets all removed files - void getRemoved(std::map &fileRemoveMap, const std::vector &paths); + bool getRemoved(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);