From aae321f9e7a33bd6450e9ab7e0c050cf98784bf6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 30 Jul 2012 17:23:26 +0200 Subject: [PATCH] Changed: #1440 Moved some more filepath functions --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/service/database_status.cpp | 4 ++-- code/nel/tools/pipeline/service/metadata_storage.h | 1 + code/nel/tools/pipeline/service/workspace_storage.cpp | 6 ++++++ code/nel/tools/pipeline/service/workspace_storage.h | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/pipeline/service/database_status.cpp b/code/nel/tools/pipeline/service/database_status.cpp index 573a393fe..046504f12 100644 --- a/code/nel/tools/pipeline/service/database_status.cpp +++ b/code/nel/tools/pipeline/service/database_status.cpp @@ -119,7 +119,7 @@ bool CDatabaseStatus::getFileStatus(std::map &fileStat return false; } - std::string dirPathMeta = CWorkspaceStorage::getMetaFilePath(dirPath, ""); + std::string dirPathMeta = CWorkspaceStorage::getMetaDirectoryPath(dirPath); std::vector dirContentsMeta; CPath::getPathContent(dirPathMeta, false, false, true, dirContentsMeta); @@ -446,7 +446,7 @@ void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, // Note that we won't notice when a directory is deleted, this is also not necessary because we never work recursively in the service. // Any recursive lookups are done in specific unsafe build tools that are tagged as unsafe and not monitored by the pipeline. - std::string dirPathMeta = CWorkspaceStorage::getMetaFilePath(dirPath, ""); + std::string dirPathMeta = CWorkspaceStorage::getMetaDirectoryPath(dirPath); // nldebug("META DIR: %s", dirPathMeta.c_str()); std::vector dirContentsMeta; diff --git a/code/nel/tools/pipeline/service/metadata_storage.h b/code/nel/tools/pipeline/service/metadata_storage.h index 7826c4338..6328f4c69 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.h +++ b/code/nel/tools/pipeline/service/metadata_storage.h @@ -135,6 +135,7 @@ public: static void writeStatus(const CFileStatus &status, const std::string &path); static void eraseStatus(const std::string &path); + static std::string getRemovePath(const std::string &file); static bool readRemove(CFileRemove &remove, const std::string & path); static void createRemove(const CFileRemove &remove, const std::string &path); // Remove cannot be modified after creation, only erased. static void eraseRemove(const std::string &path); diff --git a/code/nel/tools/pipeline/service/workspace_storage.cpp b/code/nel/tools/pipeline/service/workspace_storage.cpp index d8ca370da..04cc8188b 100644 --- a/code/nel/tools/pipeline/service/workspace_storage.cpp +++ b/code/nel/tools/pipeline/service/workspace_storage.cpp @@ -139,6 +139,12 @@ std::string CWorkspaceStorage::getMetaFilePath(const std::string &path, const st } } +std::string CWorkspaceStorage::getMetaDirectoryPath(const std::string &path) +{ + // Not very sane, but works. + return standardizePath(CWorkspaceStorage::getMetaFilePath(path, ""), true); +} + } /* namespace PIPELINE */ /* end of file */ diff --git a/code/nel/tools/pipeline/service/workspace_storage.h b/code/nel/tools/pipeline/service/workspace_storage.h index be78e2f5e..aa53d53f8 100644 --- a/code/nel/tools/pipeline/service/workspace_storage.h +++ b/code/nel/tools/pipeline/service/workspace_storage.h @@ -52,6 +52,9 @@ public: /// Get the path for a metadata file, based on a filepath it represents, and the suffix of it's contents static std::string getMetaFilePath(const std::string &path, const std::string &dotSuffix); + /// Get the directory where metadata files are stored, based on the filepath containing the files which the containing metadata represents + static std::string getMetaDirectoryPath(const std::string &path); + }; /* class CWorkspaceStorage */ } /* namespace PIPELINE */