1 |
commit: 4fb6b5123a834fbb1d1726aaeebee2ec3ad79fa4 |
2 |
Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Sep 5 16:09:31 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 21 19:50:01 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fb6b512 |
7 |
|
8 |
dev-db/mongodb: fix building with newer libpcre/glibc. |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/580768 |
11 |
Gentoo-Bug: https://bugs.gentoo.org/625148 |
12 |
Gentoo-Bug: https://bugs.gentoo.org/626342 |
13 |
|
14 |
Package-Manager: Portage-2.3.8, Repoman-2.3.2 |
15 |
|
16 |
...6-Replace-string-with-explicit-std-string.patch | 283 +++++++++++++++++++++ |
17 |
dev-db/mongodb/mongodb-3.2.16.ebuild | 23 +- |
18 |
2 files changed, 294 insertions(+), 12 deletions(-) |
19 |
|
20 |
diff --git a/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch b/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..6067850ad0b |
23 |
--- /dev/null |
24 |
+++ b/dev-db/mongodb/files/mongodb-3.2.16-Replace-string-with-explicit-std-string.patch |
25 |
@@ -0,0 +1,283 @@ |
26 |
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/dbwebserver.cpp mongodb-src-r3.2.16/src/mongo/db/dbwebserver.cpp |
27 |
+--- mongodb-src-r3.2.16_orig/src/mongo/db/dbwebserver.cpp 2017-07-14 22:36:01.000000000 +0200 |
28 |
++++ mongodb-src-r3.2.16/src/mongo/db/dbwebserver.cpp 2017-08-01 15:43:55.860712772 +0200 |
29 |
+@@ -69,6 +69,7 @@ |
30 |
+ using std::map; |
31 |
+ using std::stringstream; |
32 |
+ using std::vector; |
33 |
++using std::string; |
34 |
+ |
35 |
+ using namespace html; |
36 |
+ |
37 |
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/matcher/expression_leaf.cpp mongodb-src-r3.2.16/src/mongo/db/matcher/expression_leaf.cpp |
38 |
+--- mongodb-src-r3.2.16_orig/src/mongo/db/matcher/expression_leaf.cpp 2017-07-14 22:36:01.000000000 +0200 |
39 |
++++ mongodb-src-r3.2.16/src/mongo/db/matcher/expression_leaf.cpp 2017-08-01 15:46:17.070708001 +0200 |
40 |
+@@ -200,7 +200,7 @@ |
41 |
+ } |
42 |
+ |
43 |
+ void ComparisonMatchExpression::toBSON(BSONObjBuilder* out) const { |
44 |
+- string opString = ""; |
45 |
++ std::string opString = ""; |
46 |
+ switch (matchType()) { |
47 |
+ case LT: |
48 |
+ opString = "$lt"; |
49 |
+@@ -880,7 +880,7 @@ |
50 |
+ } |
51 |
+ |
52 |
+ void BitTestMatchExpression::toBSON(BSONObjBuilder* out) const { |
53 |
+- string opString = ""; |
54 |
++ std::string opString = ""; |
55 |
+ |
56 |
+ switch (matchType()) { |
57 |
+ case BITS_ALL_SET: |
58 |
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/db/repl/master_slave.cpp mongodb-src-r3.2.16/src/mongo/db/repl/master_slave.cpp |
59 |
+--- mongodb-src-r3.2.16_orig/src/mongo/db/repl/master_slave.cpp 2017-07-14 22:36:01.000000000 +0200 |
60 |
++++ mongodb-src-r3.2.16/src/mongo/db/repl/master_slave.cpp 2017-08-01 15:54:45.140690837 +0200 |
61 |
+@@ -161,7 +161,7 @@ |
62 |
+ |
63 |
+ BSONObjBuilder dbsNextPassBuilder; |
64 |
+ int n = 0; |
65 |
+- for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) { |
66 |
++ for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) { |
67 |
+ n++; |
68 |
+ dbsNextPassBuilder.appendBool(*i, 1); |
69 |
+ } |
70 |
+@@ -170,7 +170,7 @@ |
71 |
+ |
72 |
+ BSONObjBuilder incompleteCloneDbsBuilder; |
73 |
+ n = 0; |
74 |
+- for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) { |
75 |
++ for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) { |
76 |
+ n++; |
77 |
+ incompleteCloneDbsBuilder.appendBool(*i, 1); |
78 |
+ } |
79 |
+@@ -181,7 +181,7 @@ |
80 |
+ } |
81 |
+ |
82 |
+ void ReplSource::ensureMe(OperationContext* txn) { |
83 |
+- string myname = getHostName(); |
84 |
++ std::string myname = getHostName(); |
85 |
+ |
86 |
+ // local.me is an identifier for a server for getLastError w:2+ |
87 |
+ bool exists = Helpers::getSingleton(txn, "local.me", _me); |
88 |
+@@ -373,10 +373,10 @@ |
89 |
+ } |
90 |
+ |
91 |
+ virtual bool run(OperationContext* txn, |
92 |
+- const string& ns, |
93 |
++ const std::string& ns, |
94 |
+ BSONObj& cmdObj, |
95 |
+ int options, |
96 |
+- string& errmsg, |
97 |
++ std::string& errmsg, |
98 |
+ BSONObjBuilder& result) { |
99 |
+ HandshakeArgs handshake; |
100 |
+ Status status = handshake.initialize(cmdObj); |
101 |
+@@ -393,7 +393,7 @@ |
102 |
+ } handshakeCmd; |
103 |
+ |
104 |
+ bool replHandshake(DBClientConnection* conn, const OID& myRID) { |
105 |
+- string myname = getHostName(); |
106 |
++ std::string myname = getHostName(); |
107 |
+ |
108 |
+ BSONObjBuilder cmd; |
109 |
+ cmd.append("handshake", myRID); |
110 |
+@@ -445,7 +445,7 @@ |
111 |
+ BSONElement e = i.next(); |
112 |
+ if (e.eoo()) |
113 |
+ break; |
114 |
+- string name = e.embeddedObject().getField("name").valuestr(); |
115 |
++ std::string name = e.embeddedObject().getField("name").valuestr(); |
116 |
+ if (!e.embeddedObject().getBoolField("empty")) { |
117 |
+ if (name != "local") { |
118 |
+ if (only.empty() || only == name) { |
119 |
+@@ -459,7 +459,7 @@ |
120 |
+ save(txn); |
121 |
+ } |
122 |
+ |
123 |
+-void ReplSource::resyncDrop(OperationContext* txn, const string& db) { |
124 |
++void ReplSource::resyncDrop(OperationContext* txn, const std::string& db) { |
125 |
+ log() << "resync: dropping database " << db; |
126 |
+ OldClientContext ctx(txn, db); |
127 |
+ dropDatabase(txn, ctx.db()); |
128 |
+@@ -502,13 +502,13 @@ |
129 |
+ |
130 |
+ static DatabaseIgnorer ___databaseIgnorer; |
131 |
+ |
132 |
+-void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) { |
133 |
++void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) { |
134 |
+ if (futureOplogTime > _ignores[db]) { |
135 |
+ _ignores[db] = futureOplogTime; |
136 |
+ } |
137 |
+ } |
138 |
+ |
139 |
+-bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) { |
140 |
++bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) { |
141 |
+ if (_ignores[db].isNull()) { |
142 |
+ return false; |
143 |
+ } |
144 |
+@@ -598,7 +598,7 @@ |
145 |
+ |
146 |
+ // The database is present on the master and no conflicting databases |
147 |
+ // are present on the master. Drop any local conflicts. |
148 |
+- for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) { |
149 |
++ for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) { |
150 |
+ ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime); |
151 |
+ incompleteCloneDbs.erase(*i); |
152 |
+ addDbNextPass.erase(*i); |
153 |
+@@ -793,10 +793,10 @@ |
154 |
+ } |
155 |
+ |
156 |
+ void ReplSource::syncToTailOfRemoteLog() { |
157 |
+- string _ns = ns(); |
158 |
++ std::string _ns = ns(); |
159 |
+ BSONObjBuilder b; |
160 |
+ if (!only.empty()) { |
161 |
+- b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only)); |
162 |
++ b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only)); |
163 |
+ } |
164 |
+ BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1))); |
165 |
+ if (!last.isEmpty()) { |
166 |
+@@ -844,7 +844,7 @@ |
167 |
+ */ |
168 |
+ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) { |
169 |
+ int okResultCode = 1; |
170 |
+- string ns = string("local.oplog.$") + sourceName(); |
171 |
++ std::string ns = std::string("local.oplog.$") + sourceName(); |
172 |
+ LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n'; |
173 |
+ |
174 |
+ bool tailing = true; |
175 |
+@@ -864,7 +864,7 @@ |
176 |
+ BSONElement e = i.next(); |
177 |
+ if (e.eoo()) |
178 |
+ break; |
179 |
+- string name = e.embeddedObject().getField("name").valuestr(); |
180 |
++ std::string name = e.embeddedObject().getField("name").valuestr(); |
181 |
+ if (!e.embeddedObject().getBoolField("empty")) { |
182 |
+ if (name != "local") { |
183 |
+ if (only.empty() || only == name) { |
184 |
+@@ -888,7 +888,7 @@ |
185 |
+ if (!only.empty()) { |
186 |
+ // note we may here skip a LOT of data table scanning, a lot of work for the master. |
187 |
+ // maybe append "\\." here? |
188 |
+- query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only)); |
189 |
++ query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only)); |
190 |
+ } |
191 |
+ BSONObj queryObj = query.done(); |
192 |
+ // e.g. queryObj = { ts: { $gte: syncedTo } } |
193 |
+@@ -907,7 +907,7 @@ |
194 |
+ |
195 |
+ // show any deferred database creates from a previous pass |
196 |
+ { |
197 |
+- set<string>::iterator i = addDbNextPass.begin(); |
198 |
++ set<std::string>::iterator i = addDbNextPass.begin(); |
199 |
+ if (i != addDbNextPass.end()) { |
200 |
+ BSONObjBuilder b; |
201 |
+ b.append("ns", *i + '.'); |
202 |
+@@ -938,7 +938,7 @@ |
203 |
+ BSONObj op = oplogReader.next(); |
204 |
+ BSONElement ts = op.getField("ts"); |
205 |
+ if (ts.type() != Date && ts.type() != bsonTimestamp) { |
206 |
+- string err = op.getStringField("$err"); |
207 |
++ std::string err = op.getStringField("$err"); |
208 |
+ if (!err.empty()) { |
209 |
+ // 13051 is "tailable cursor requested on non capped collection" |
210 |
+ if (op.getIntField("code") == 13051) { |
211 |
+@@ -1106,7 +1106,7 @@ |
212 |
+ |
213 |
+ // FIXME Handle cases where this db isn't on default port, or default port is spec'd in |
214 |
+ // hostName. |
215 |
+- if ((string("localhost") == hostName || string("127.0.0.1") == hostName) && |
216 |
++ if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) && |
217 |
+ serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) { |
218 |
+ log() << "can't sync from self (localhost). sources configuration may be wrong." << endl; |
219 |
+ sleepsecs(5); |
220 |
+@@ -1251,7 +1251,7 @@ |
221 |
+ if (s) { |
222 |
+ stringstream ss; |
223 |
+ ss << "sleep " << s << " sec before next pass"; |
224 |
+- string msg = ss.str(); |
225 |
++ std::string msg = ss.str(); |
226 |
+ if (!serverGlobalParams.quiet) |
227 |
+ log() << msg << endl; |
228 |
+ ReplInfo r(msg.c_str()); |
229 |
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/shell/bench.cpp mongodb-src-r3.2.16/src/mongo/shell/bench.cpp |
230 |
+--- mongodb-src-r3.2.16_orig/src/mongo/shell/bench.cpp 2017-07-14 22:36:01.000000000 +0200 |
231 |
++++ mongodb-src-r3.2.16/src/mongo/shell/bench.cpp 2017-08-01 16:20:20.864638957 +0200 |
232 |
+@@ -674,7 +674,7 @@ |
233 |
+ invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess); |
234 |
+ |
235 |
+ if (_config->username != "") { |
236 |
+- string errmsg; |
237 |
++ std::string errmsg; |
238 |
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) { |
239 |
+ uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg); |
240 |
+ } |
241 |
+@@ -920,7 +920,7 @@ |
242 |
+ |
243 |
+ if (!result["err"].eoo() && result["err"].type() == String && |
244 |
+ (_config->throwGLE || op.throwGLE)) |
245 |
+- throw DBException((string) "From benchRun GLE" + |
246 |
++ throw DBException((std::string) "From benchRun GLE" + |
247 |
+ causedBy(result["err"].String()), |
248 |
+ result["code"].eoo() ? 0 : result["code"].Int()); |
249 |
+ } |
250 |
+@@ -987,7 +987,7 @@ |
251 |
+ |
252 |
+ if (!result["err"].eoo() && result["err"].type() == String && |
253 |
+ (_config->throwGLE || op.throwGLE)) |
254 |
+- throw DBException((string) "From benchRun GLE" + |
255 |
++ throw DBException((std::string) "From benchRun GLE" + |
256 |
+ causedBy(result["err"].String()), |
257 |
+ result["code"].eoo() ? 0 : result["code"].Int()); |
258 |
+ } |
259 |
+@@ -1035,7 +1035,7 @@ |
260 |
+ |
261 |
+ if (!result["err"].eoo() && result["err"].type() == String && |
262 |
+ (_config->throwGLE || op.throwGLE)) |
263 |
+- throw DBException((string) "From benchRun GLE " + |
264 |
++ throw DBException((std::string) "From benchRun GLE " + |
265 |
+ causedBy(result["err"].String()), |
266 |
+ result["code"].eoo() ? 0 : result["code"].Int()); |
267 |
+ } |
268 |
+@@ -1136,7 +1136,7 @@ |
269 |
+ try { |
270 |
+ std::unique_ptr<DBClientBase> conn(_config->createConnection()); |
271 |
+ if (!_config->username.empty()) { |
272 |
+- string errmsg; |
273 |
++ std::string errmsg; |
274 |
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) { |
275 |
+ uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg); |
276 |
+ } |
277 |
+@@ -1168,7 +1168,7 @@ |
278 |
+ std::unique_ptr<DBClientBase> conn(_config->createConnection()); |
279 |
+ // Must authenticate to admin db in order to run serverStatus command |
280 |
+ if (_config->username != "") { |
281 |
+- string errmsg; |
282 |
++ std::string errmsg; |
283 |
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) { |
284 |
+ uasserted(16704, |
285 |
+ str::stream() |
286 |
+@@ -1204,7 +1204,7 @@ |
287 |
+ { |
288 |
+ std::unique_ptr<DBClientBase> conn(_config->createConnection()); |
289 |
+ if (_config->username != "") { |
290 |
+- string errmsg; |
291 |
++ std::string errmsg; |
292 |
+ // this can only fail if admin access was revoked since start of run |
293 |
+ if (!conn->auth("admin", _config->username, _config->password, errmsg)) { |
294 |
+ uasserted(16705, |
295 |
+diff -Nru mongodb-src-r3.2.16_orig/src/mongo/util/net/miniwebserver.cpp mongodb-src-r3.2.16/src/mongo/util/net/miniwebserver.cpp |
296 |
+--- mongodb-src-r3.2.16_orig/src/mongo/util/net/miniwebserver.cpp 2017-07-14 22:36:01.000000000 +0200 |
297 |
++++ mongodb-src-r3.2.16/src/mongo/util/net/miniwebserver.cpp 2017-08-01 16:01:01.832678112 +0200 |
298 |
+@@ -45,8 +45,9 @@ |
299 |
+ using std::endl; |
300 |
+ using std::stringstream; |
301 |
+ using std::vector; |
302 |
++using std::string; |
303 |
+ |
304 |
+-MiniWebServer::MiniWebServer(const string& name, const string& ip, int port) |
305 |
++MiniWebServer::MiniWebServer(const std::string& name, const std::string& ip, int port) |
306 |
+ : Listener(name, ip, port, false) {} |
307 |
+ |
308 |
+ string MiniWebServer::parseURL(const char* buf) { |
309 |
|
310 |
diff --git a/dev-db/mongodb/mongodb-3.2.16.ebuild b/dev-db/mongodb/mongodb-3.2.16.ebuild |
311 |
index c7a04e63cca..f18602bddd9 100644 |
312 |
--- a/dev-db/mongodb/mongodb-3.2.16.ebuild |
313 |
+++ b/dev-db/mongodb/mongodb-3.2.16.ebuild |
314 |
@@ -1,7 +1,7 @@ |
315 |
# Copyright 1999-2017 Gentoo Foundation |
316 |
# Distributed under the terms of the GNU General Public License v2 |
317 |
|
318 |
-EAPI=5 |
319 |
+EAPI=6 |
320 |
SCONS_MIN_VERSION="2.3.0" |
321 |
CHECKREQS_DISK_BUILD="2400M" |
322 |
CHECKREQS_DISK_USR="512M" |
323 |
@@ -44,6 +44,14 @@ DEPEND="${RDEPEND} |
324 |
)" |
325 |
PDEPEND="tools? ( >=app-admin/mongo-tools-${PV} )" |
326 |
|
327 |
+PATCHES=( |
328 |
+ "${FILESDIR}/${PN}-3.2.0-fix-scons.patch" |
329 |
+ "${FILESDIR}/${PN}-3.2.4-boost-1.60.patch" |
330 |
+ "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch" |
331 |
+ "${FILESDIR}/${PN}-3.2.16-Replace-string-with-explicit-std-string.patch" |
332 |
+ "${FILESDIR}/${PN}-3.4.6-sysmacros-include.patch" |
333 |
+) |
334 |
+ |
335 |
S=${WORKDIR}/${MY_P} |
336 |
|
337 |
pkg_pretend() { |
338 |
@@ -99,16 +107,6 @@ pkg_setup() { |
339 |
fi |
340 |
} |
341 |
|
342 |
-src_prepare() { |
343 |
- epatch \ |
344 |
- "${FILESDIR}/${PN}-3.2.0-fix-scons.patch" \ |
345 |
- "${FILESDIR}/${PN}-3.2.4-boost-1.60.patch" |
346 |
- if has_version ">=dev-libs/boost-1.62"; then |
347 |
- epatch "${FILESDIR}/${PN}-3.2.10-boost-1.62.patch" |
348 |
- fi |
349 |
- epatch_user |
350 |
-} |
351 |
- |
352 |
src_compile() { |
353 |
# respect mongoDB upstream's basic recommendations |
354 |
# see bug #536688 and #526114 |
355 |
@@ -122,6 +120,7 @@ src_compile() { |
356 |
src_install() { |
357 |
escons "${scons_opts[@]}" --nostrip install --prefix="${ED}"/usr |
358 |
|
359 |
+ local x |
360 |
for x in /var/{lib,log}/${PN}; do |
361 |
keepdir "${x}" |
362 |
fowners mongodb:mongodb "${x}" |
363 |
@@ -157,7 +156,7 @@ pkg_preinst() { |
364 |
|
365 |
src_test() { |
366 |
# this one test fails |
367 |
- rm jstests/core/repl_write_threads_start_param.js |
368 |
+ rm jstests/core/repl_write_threads_start_param.js || die |
369 |
|
370 |
./buildscripts/resmoke.py --dbpathPrefix=test --suites core || die "Tests failed" |
371 |
} |