summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/Client.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-11 23:07:10 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-11 23:07:10 +0000
commit4dbf81b1d2856caccb646e7610e8c5fa57128385 (patch)
tree7a4186e61f6856fdc799207c71b71afb25f20a69 /cpp/src/IcePatch/Client.cpp
parentObject adapter creation method changes, IceBox fixes. (diff)
downloadice-4dbf81b1d2856caccb646e7610e8c5fa57128385.tar.bz2
ice-4dbf81b1d2856caccb646e7610e8c5fa57128385.tar.xz
ice-4dbf81b1d2856caccb646e7610e8c5fa57128385.zip
fixes
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r--cpp/src/IcePatch/Client.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp
index da682b193e0..d991b6e5ff3 100644
--- a/cpp/src/IcePatch/Client.cpp
+++ b/cpp/src/IcePatch/Client.cpp
@@ -369,17 +369,14 @@ public:
void
IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) const
{
- StringSeq orphaned;
+ set<string> orphaned;
if(_remove)
{
StringSeq fullDirectoryListing = readDirectory(identityToPath(dirDesc->directory->ice_getIdentity()));
orphaned.reserve(fullDirectoryListing.size());
for(StringSeq::const_iterator p = fullDirectoryListing.begin(); p != fullDirectoryListing.end(); ++p)
{
- if(getSuffix(*p) != "md5")
- {
- orphaned.push_back(*p);
- }
+ orphaned.insert(*p)
}
}
@@ -403,7 +400,9 @@ IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) c
if(_remove)
{
- orphaned.erase(remove(orphaned.begin(), orphaned.end(), path), orphaned.end());
+ orphaned.erase(path);
+ orphaned.erase(path + ".md5");
+ orphaned.erase(path + ".bz2");
}
bool last = (i == fileDescSeq.size() - 1) && orphaned.empty();
@@ -522,21 +521,10 @@ IcePatch::Client::patch(const DirectoryDescPtr& dirDesc, const string& indent) c
}
}
- if(!orphaned.empty())
+ for(StringSeq::const_iterator p = orphaned.begin(); p != orphaned.end(); ++p)
{
- for(StringSeq::const_iterator p = orphaned.begin(); p != orphaned.end(); ++p)
- {
- cout << indent << "+-" << pathToName(*p) << ": removing orphaned file" << endl;
- removeRecursive(*p);
- try
- {
- removeRecursive(*p + ".md5");
- }
- catch(const FileAccessException&)
- {
- // Ignore, the MD5 file might not exist.
- }
- }
+ cout << indent << "+-" << pathToName(*p) << ": removing orphaned file" << endl;
+ removeRecursive(*p);
}
}