1
This patch adds a --preserve flag to icepatch2client to avoid removal of
2
compressed files. It could be used to setup hierarchical IcePatch2
5
diff --git a/cpp/src/IcePatch2/Client.cpp b/cpp/src/IcePatch2/Client.cpp
6
index 29cd151..262e5b2 100644
7
diff -Nur -x '*.orig' -x '*~' zeroc-ice/cpp/include/IcePatch2/ClientUtil.h zeroc-ice.new/cpp/include/IcePatch2/ClientUtil.h
8
--- zeroc-ice/cpp/include/IcePatch2/ClientUtil.h 2009-03-27 09:14:00.734546020 +0100
9
+++ zeroc-ice.new/cpp/include/IcePatch2/ClientUtil.h 2009-10-27 16:36:25.822302484 +0100
12
const Ice::Int _chunkSize;
13
const Ice::Int _remove;
14
+ const bool _removeCompressed;
15
const FileServerPrx _serverCompress;
16
const FileServerPrx _serverNoCompress;
18
diff -Nur -x '*.orig' -x '*~' zeroc-ice/cpp/src/IcePatch2/Client.cpp zeroc-ice.new/cpp/src/IcePatch2/Client.cpp
19
--- zeroc-ice/cpp/src/IcePatch2/Client.cpp 2009-03-27 09:14:00.842709242 +0100
20
+++ zeroc-ice.new/cpp/src/IcePatch2/Client.cpp 2009-10-27 16:36:25.822302484 +0100
22
opts.addOpt("h", "help");
23
opts.addOpt("v", "version");
24
opts.addOpt("t", "thorough");
25
+ opts.addOpt("p", "preserve");
31
properties->setProperty("IcePatch2.Thorough", "1");
33
+ if(opts.isSet("preserve"))
35
+ properties->setProperty("IcePatch2.RemoveCompressed", "0");
40
diff -Nur -x '*.orig' -x '*~' zeroc-ice/cpp/src/IcePatch2/ClientUtil.cpp zeroc-ice.new/cpp/src/IcePatch2/ClientUtil.cpp
41
--- zeroc-ice/cpp/src/IcePatch2/ClientUtil.cpp 2009-03-27 09:14:00.846558063 +0100
42
+++ zeroc-ice.new/cpp/src/IcePatch2/ClientUtil.cpp 2009-10-27 16:38:31.258250308 +0100
47
- Decompressor(const string& dataDir) :
48
+ Decompressor(const string& dataDir, bool removeCompressed = true) :
52
+ _removeCompressed(removeCompressed)
58
decompressFile(_dataDir + '/' + info.path);
59
setFileFlags(_dataDir + '/' + info.path, info);
60
- remove(_dataDir + '/' + info.path + ".bz2");
61
+ if (_removeCompressed)
62
+ remove(_dataDir + '/' + info.path + ".bz2");
64
catch(const string& ex)
67
FileInfoSeq _filesDone;
70
+ bool _removeCompressed;
75
_thorough(communicator->getProperties()->getPropertyAsInt("IcePatch2.Thorough") > 0),
76
_chunkSize(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.ChunkSize", 100)),
77
_remove(communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.Remove", 1)),
78
+ _removeCompressed (communicator->getProperties()->getPropertyAsIntWithDefault("IcePatch2.RemoveCompressed", 1) > 0),
81
PropertiesPtr properties = communicator->getProperties();
83
_dataDir(simplify(dataDir)),
85
_chunkSize(chunkSize),
88
+ _removeCompressed(true)
94
IcePatch2::Patcher::updateFiles(const FileInfoSeq& files)
96
- DecompressorPtr decompressor = new Decompressor(_dataDir);
97
+ DecompressorPtr decompressor = new Decompressor(_dataDir, _removeCompressed);
100
// The thread stack size is only 64KB only HP-UX and that's not