diff options
author | Marc Laukien <marc@zeroc.com> | 2002-09-05 17:29:22 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-09-05 17:29:22 +0000 |
commit | 8ec10d7a1d8815b866c6f9d159b771d9c337e442 (patch) | |
tree | aec0dbdb7136228790a9a22868a6fb961ff7f21d /cpp/src/IcePatch/Client.cpp | |
parent | Revert back to XML dictionnary (diff) | |
download | ice-8ec10d7a1d8815b866c6f9d159b771d9c337e442.tar.bz2 ice-8ec10d7a1d8815b866c6f9d159b771d9c337e442.tar.xz ice-8ec10d7a1d8815b866c6f9d159b771d9c337e442.zip |
more IcePatch work
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r-- | cpp/src/IcePatch/Client.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp index 77bd242e154..13836eea263 100644 --- a/cpp/src/IcePatch/Client.cpp +++ b/cpp/src/IcePatch/Client.cpp @@ -39,6 +39,7 @@ private: void patch(const DirectoryDescPtr&, const string&) const; bool _remove; + bool _thorough; }; }; @@ -219,6 +220,11 @@ IcePatch::Client::run(int argc, char* argv[]) } } + // + // Check whether we want to do a through check. + // + _thorough = properties->getPropertyAsInt("IcePatch.Thorough") > 0; + // // Create and install the node description factory. // @@ -359,8 +365,6 @@ public: void IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) const { - FileDescSeq fileDescSeq = dirDesc->directory->getContents(); - StringSeq orphaned; if(_remove) { @@ -375,6 +379,8 @@ IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) c } } + FileDescSeq fileDescSeq = dirDesc->directory->getContents(); + for(unsigned int i = 0; i < fileDescSeq.size(); ++i) { string path; @@ -415,6 +421,24 @@ IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) c case FileTypeDirectory: { cout << " ok" << endl; + + if(!_thorough && !subDirDesc->md5.empty()) + { + ByteSeq md5; + + string pathMD5 = path + ".md5"; + FileInfo infoMD5 = getFileInfo(pathMD5, false); + if(infoMD5.type == FileTypeRegular && infoMD5.time >= info.time) + { + md5 = getMD5(path); + } + + if(md5 == subDirDesc->md5) + { + continue; + } + } + break; } @@ -438,6 +462,11 @@ IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) c } patch(subDirDesc, newIndent); + + if(!subDirDesc->md5.empty()) + { + putMD5(path, subDirDesc->md5); + } } else { |