From f9bddebfd8aa92eb421f4c1aeb880a3b3f34c0ee Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 4 Aug 2012 13:43:27 +0200 Subject: [PATCH] Reverted: #1440 Previous commit. Re-added files after failed builds also are in the added cache --HG-- branch : build_pipeline_v3 --- .../pipeline_process_impl_buildinfo.cpp | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp index f4b640f0e..db1959690 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp @@ -141,20 +141,18 @@ bool CPipelineProcessImpl::hasInputFileBeenModified(const std::string &inputFile bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string &inputDirectory, const std::set &excludeFiles, uint32 since) { - // for (std::set::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr) - for (std::map::const_iterator it = m_FileStatusInputCache.begin(), end = m_FileStatusInputCache.end(); it != end; ++it) + for (std::set::const_iterator itr = m_ListInputAdded.begin(), endr = m_ListInputAdded.end(); itr != endr; ++itr) { - const std::string &pathr = it->first; + const std::string &pathr = *itr; if (excludeFiles.find(pathr) == excludeFiles.end()) { if ((pathr.size() > inputDirectory.size()) && (pathr.substr(0, inputDirectory.size()) == inputDirectory) // inside the path && (pathr.substr(inputDirectory.size(), pathr.size() - inputDirectory.size())).find('/') == std::string::npos) // not in a further subdirectory { - //CFileStatus status; - //if (!getDependencyFileStatusCached(status, pathr)) - // nlerror("Cannot get cached status of known file"); - const CFileStatus &status = it->second; + CFileStatus status; + if (!getDependencyFileStatusCached(status, pathr)) + nlerror("Cannot get cached status of known file"); if (status.FirstSeen >= since) // or > ? { nldebug("Found newly added '%s' in dependency directory '%s'", pathr.c_str(), inputDirectory.c_str()); @@ -168,17 +166,17 @@ bool CPipelineProcessImpl::haveFilesBeenAddedInDirectorySince(const std::string bool CPipelineProcessImpl::hasFileBeenAddedSince(const std::string &inputFile, uint32 since) { - /*if (m_ListInputAdded.find(inputFile) != m_ListInputAdded.end()) - {*/ - CFileStatus status; - if (!getDependencyFileStatusCached(status, inputFile)) - nlerror("Cannot get cached status of known file"); - if (status.FirstSeen >= since) // or > ? + if (m_ListInputAdded.find(inputFile) != m_ListInputAdded.end()) { - nldebug("Found newly added '%s' in dependency files", inputFile.c_str()); - return true; + CFileStatus status; + if (!getDependencyFileStatusCached(status, inputFile)) + nlerror("Cannot get cached status of known file"); + if (status.FirstSeen >= since) // or > ? + { + nldebug("Found newly added '%s' in dependency files", inputFile.c_str()); + return true; + } } - /*}*/ return false; } @@ -472,7 +470,6 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i std::set inputsChecked; uint32 earliestBuildStart = 0xFFFFFFFF; - uint32 lastBuildStart = 0; // Check the .depend files of all the output files // also check that they exist :) for (std::vector::const_iterator it = outputPaths.begin(), end = outputPaths.end(); it != end; ++it) @@ -490,8 +487,6 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i { if (metaDepend.BuildStart < earliestBuildStart) earliestBuildStart = metaDepend.BuildStart; - if (metaDepend.BuildStart > lastBuildStart) - lastBuildStart = metaDepend.BuildStart; if (outputChanged) { // Compare the output checksum with the status output checksum @@ -543,10 +538,8 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i } // Find out if any files were added in dependency directories since last build start - if (lastBuildStart != m_ResultPreviousSuccess.BuildStart || earliestBuildStart != m_ResultPreviousSuccess.BuildStart) + if (inputModified) { - nldebug("Found files that were built at a different time than the last successful build, find out if any input files have been added for them"); - for (std::vector::const_iterator it = inputPaths.begin(), end = inputPaths.end(); it != end; ++it) { const std::string &path = *it;