diff options
author | Marc Laukien <marc@zeroc.com> | 2002-09-02 11:34:16 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-09-02 11:34:16 +0000 |
commit | 474ec67beabdb612c633d35fd9562b349aa74b7a (patch) | |
tree | 2a3f2036f3269538b73dcec6492be6cb097ef3df /cpp/src/IcePatch/Util.cpp | |
parent | minor (diff) | |
download | ice-474ec67beabdb612c633d35fd9562b349aa74b7a.tar.bz2 ice-474ec67beabdb612c633d35fd9562b349aa74b7a.tar.xz ice-474ec67beabdb612c633d35fd9562b349aa74b7a.zip |
more IcePatch work
Diffstat (limited to 'cpp/src/IcePatch/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch/Util.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/cpp/src/IcePatch/Util.cpp b/cpp/src/IcePatch/Util.cpp index 82d33275f09..d8ebeef999b 100644 --- a/cpp/src/IcePatch/Util.cpp +++ b/cpp/src/IcePatch/Util.cpp @@ -375,19 +375,34 @@ IcePatch::createMD5(const string& path) throw ex; } + string pathMD5; + string pathMD5Temp; ByteSeq bytes; if(info.type == FileTypeDirectory) { + pathMD5 = path + "/.md5"; + pathMD5Temp = path + "/.md5temp"; + // // Read all MD5 files in the directory. // StringSeq paths = readDirectory(path); for(StringSeq::const_iterator p = paths.begin(); p != paths.end(); ++p) { - if(getSuffix(*p) == "md5") + if(!ignoreSuffix(*p)) { - ByteSeq md5 = getMD5(removeSuffix(*p)); - copy(md5.begin(), md5.end(), back_inserter(bytes)); + FileInfo subInfo = getFileInfo(*p, true); + + if(subInfo.type == FileTypeDirectory) + { + ByteSeq subBytesMD5 = getMD5(*p + "/.md5"); + copy(subBytesMD5.begin(), subBytesMD5.end(), back_inserter(bytes)); + } + else if(subInfo.type == FileTypeRegular) + { + ByteSeq subBytesMD5 = getMD5(removeSuffix(*p)); + copy(subBytesMD5.begin(), subBytesMD5.end(), back_inserter(bytes)); + } } } } @@ -395,6 +410,9 @@ IcePatch::createMD5(const string& path) { assert(info.type == FileTypeRegular); + pathMD5 = path + ".md5"; + pathMD5Temp = path + ".md5temp"; + // // Read the original file. // @@ -432,8 +450,6 @@ IcePatch::createMD5(const string& path) // // Save the MD5 hash value to a temporary MD5 file. // - string pathMD5 = path + ".md5"; - string pathMD5Temp = path + ".md5temp"; ofstream fileMD5(pathMD5Temp.c_str(), ios::binary); if(!fileMD5) { |