Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 May 2018 06:52:25 +0000 (UTC)
From:      Kirill Ponomarev <krion@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r470356 - in head/databases/mongodb32: . files
Message-ID:  <201805190652.w4J6qPGg009343@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: krion
Date: Sat May 19 06:52:25 2018
New Revision: 470356
URL: https://svnweb.freebsd.org/changeset/ports/470356

Log:
  Fix build with pcre 8.42
  
  PR:		220613
  Submitted by:	adamw

Added:
  head/databases/mongodb32/files/patch-pcre   (contents, props changed)
Modified:
  head/databases/mongodb32/Makefile

Modified: head/databases/mongodb32/Makefile
==============================================================================
--- head/databases/mongodb32/Makefile	Sat May 19 06:51:05 2018	(r470355)
+++ head/databases/mongodb32/Makefile	Sat May 19 06:52:25 2018	(r470356)
@@ -3,6 +3,7 @@
 
 PORTNAME=	mongodb32
 PORTVERSION=	3.2.11
+PORTREVISION=	1
 DISTVERSIONPREFIX=	r
 CATEGORIES=	databases net
 MASTER_SITES=	https://fastdl.mongodb.org/src/ \

Added: head/databases/mongodb32/files/patch-pcre
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/mongodb32/files/patch-pcre	Sat May 19 06:52:25 2018	(r470356)
@@ -0,0 +1,311 @@
+From 18f4c63869a32426bd33235a8cf51f06809a1b6b Mon Sep 17 00:00:00 2001
+From: Steven Green <steven@greenius.co.uk>
+Date: Tue, 22 Aug 2017 13:08:48 -0400
+Subject: [PATCH] SERVER-30166 Replace string with explicit std::string.
+ Enables compulation when using --use-system-pcre which presusably used to do
+ 'using std::string' in an earlier version of pcre
+
+Closes #1167
+
+Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
+(cherry picked from commit b7cebf82bc5e5572308cc3a3fb958a825db91498)
+---
+ src/mongo/db/dbwebserver.cpp                       |   1 +
+ src/mongo/db/matcher/expression_leaf.cpp           |   4 +-
+ src/mongo/db/repl/master_slave.cpp                 |  41 ++--
+ .../sharding_catalog_create_database_test.cpp      | 216 +++++++++++++++++++++
+ src/mongo/shell/bench.cpp                          |  14 +-
+ src/mongo/util/net/miniwebserver.cpp               |   1 +
+ 6 files changed, 248 insertions(+), 29 deletions(-)
+ create mode 100644 src/mongo/s/catalog/sharding_catalog_create_database_test.cpp
+
+diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp
+index bee10b95a5b..055ce27aacf 100644
+--- src/mongo/db/dbwebserver.cpp
++++ src/mongo/db/dbwebserver.cpp
+@@ -67,6 +67,7 @@
+ namespace mongo {
+ 
+ using std::map;
++using std::string;
+ using std::stringstream;
+ using std::vector;
+ 
+diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp
+index cfcd3d03591..5b658640578 100644
+--- src/mongo/db/matcher/expression_leaf.cpp
++++ src/mongo/db/matcher/expression_leaf.cpp
+@@ -200,7 +200,7 @@ void ComparisonMatchExpression::debugString(StringBuilder& debug, int level) con
+ }
+ 
+ void ComparisonMatchExpression::toBSON(BSONObjBuilder* out) const {
+-    string opString = "";
++    std::string opString = "";
+     switch (matchType()) {
+         case LT:
+             opString = "$lt";
+@@ -880,7 +880,7 @@ void BitTestMatchExpression::debugString(StringBuilder& debug, int level) const
+ }
+ 
+ void BitTestMatchExpression::toBSON(BSONObjBuilder* out) const {
+-    string opString = "";
++    std::string opString = "";
+ 
+     switch (matchType()) {
+         case BITS_ALL_SET:
+diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
+index d7503c4d689..3a60f351758 100644
+--- src/mongo/shell/bench.cpp
++++ src/mongo/shell/bench.cpp
+@@ -674,7 +674,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+     invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess);
+ 
+     if (_config->username != "") {
+-        string errmsg;
++        std::string errmsg;
+         if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+             uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg);
+         }
+@@ -920,7 +920,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+ 
+                             if (!result["err"].eoo() && result["err"].type() == String &&
+                                 (_config->throwGLE || op.throwGLE))
+-                                throw DBException((string) "From benchRun GLE" +
++                                throw DBException((std::string) "From benchRun GLE" +
+                                                       causedBy(result["err"].String()),
+                                                   result["code"].eoo() ? 0 : result["code"].Int());
+                         }
+@@ -987,7 +987,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+ 
+                             if (!result["err"].eoo() && result["err"].type() == String &&
+                                 (_config->throwGLE || op.throwGLE))
+-                                throw DBException((string) "From benchRun GLE" +
++                                throw DBException((std::string) "From benchRun GLE" +
+                                                       causedBy(result["err"].String()),
+                                                   result["code"].eoo() ? 0 : result["code"].Int());
+                         }
+@@ -1035,7 +1035,7 @@ void BenchRunWorker::generateLoadOnConnection(DBClientBase* conn) {
+ 
+                             if (!result["err"].eoo() && result["err"].type() == String &&
+                                 (_config->throwGLE || op.throwGLE))
+-                                throw DBException((string) "From benchRun GLE " +
++                                throw DBException((std::string) "From benchRun GLE " +
+                                                       causedBy(result["err"].String()),
+                                                   result["code"].eoo() ? 0 : result["code"].Int());
+                         }
+@@ -1136,7 +1136,7 @@ void BenchRunWorker::run() {
+     try {
+         std::unique_ptr<DBClientBase> conn(_config->createConnection());
+         if (!_config->username.empty()) {
+-            string errmsg;
++            std::string errmsg;
+             if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+                 uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
+             }
+@@ -1168,7 +1168,7 @@ void BenchRunner::start() {
+         std::unique_ptr<DBClientBase> conn(_config->createConnection());
+         // Must authenticate to admin db in order to run serverStatus command
+         if (_config->username != "") {
+-            string errmsg;
++            std::string errmsg;
+             if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+                 uasserted(16704,
+                           str::stream()
+@@ -1204,7 +1204,7 @@ void BenchRunner::stop() {
+     {
+         std::unique_ptr<DBClientBase> conn(_config->createConnection());
+         if (_config->username != "") {
+-            string errmsg;
++            std::string errmsg;
+             // this can only fail if admin access was revoked since start of run
+             if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
+                 uasserted(16705,
+diff --git a/src/mongo/util/net/miniwebserver.cpp b/src/mongo/util/net/miniwebserver.cpp
+index fc86f95b24f..369f23f136a 100644
+--- src/mongo/util/net/miniwebserver.cpp
++++ src/mongo/util/net/miniwebserver.cpp
+@@ -43,6 +43,7 @@ namespace mongo {
+ 
+ using std::shared_ptr;
+ using std::endl;
++using std::string;
+ using std::stringstream;
+ using std::vector;
+ 
+--- src/mongo/db/repl/master_slave.cpp.orig
++++ src/mongo/db/repl/master_slave.cpp
+@@ -161,7 +161,7 @@
+ 
+     BSONObjBuilder dbsNextPassBuilder;
+     int n = 0;
+-    for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
++    for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
+         n++;
+         dbsNextPassBuilder.appendBool(*i, 1);
+     }
+@@ -170,7 +170,8 @@
+ 
+     BSONObjBuilder incompleteCloneDbsBuilder;
+     n = 0;
+-    for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
++    for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end();
++         i++) {
+         n++;
+         incompleteCloneDbsBuilder.appendBool(*i, 1);
+     }
+@@ -181,7 +182,7 @@
+ }
+ 
+ void ReplSource::ensureMe(OperationContext* txn) {
+-    string myname = getHostName();
++    std::string myname = getHostName();
+ 
+     // local.me is an identifier for a server for getLastError w:2+
+     bool exists = Helpers::getSingleton(txn, "local.me", _me);
+@@ -373,10 +374,10 @@
+     }
+ 
+     virtual bool run(OperationContext* txn,
+-                     const string& ns,
++                     const std::string& ns,
+                      BSONObj& cmdObj,
+                      int options,
+-                     string& errmsg,
++                     std::string& errmsg,
+                      BSONObjBuilder& result) {
+         HandshakeArgs handshake;
+         Status status = handshake.initialize(cmdObj);
+@@ -393,7 +394,7 @@
+ } handshakeCmd;
+ 
+ bool replHandshake(DBClientConnection* conn, const OID& myRID) {
+-    string myname = getHostName();
++    std::string myname = getHostName();
+ 
+     BSONObjBuilder cmd;
+     cmd.append("handshake", myRID);
+@@ -445,7 +446,7 @@
+         BSONElement e = i.next();
+         if (e.eoo())
+             break;
+-        string name = e.embeddedObject().getField("name").valuestr();
++        std::string name = e.embeddedObject().getField("name").valuestr();
+         if (!e.embeddedObject().getBoolField("empty")) {
+             if (name != "local") {
+                 if (only.empty() || only == name) {
+@@ -459,7 +460,7 @@
+     save(txn);
+ }
+ 
+-void ReplSource::resyncDrop(OperationContext* txn, const string& db) {
++void ReplSource::resyncDrop(OperationContext* txn, const std::string& db) {
+     log() << "resync: dropping database " << db;
+     OldClientContext ctx(txn, db);
+     dropDatabase(txn, ctx.db());
+@@ -502,13 +503,13 @@
+ 
+ static DatabaseIgnorer ___databaseIgnorer;
+ 
+-void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) {
++void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) {
+     if (futureOplogTime > _ignores[db]) {
+         _ignores[db] = futureOplogTime;
+     }
+ }
+ 
+-bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) {
++bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) {
+     if (_ignores[db].isNull()) {
+         return false;
+     }
+@@ -594,12 +595,12 @@
+     }
+ 
+     // Check for duplicates again, since we released the lock above.
+-    set<string> duplicates;
++    set<std::string> duplicates;
+     Database::duplicateUncasedName(db, &duplicates);
+ 
+     // The database is present on the master and no conflicting databases
+     // are present on the master.  Drop any local conflicts.
+-    for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
++    for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
+         ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
+         incompleteCloneDbs.erase(*i);
+         addDbNextPass.erase(*i);
+@@ -794,10 +795,10 @@
+ }
+ 
+ void ReplSource::syncToTailOfRemoteLog() {
+-    string _ns = ns();
++    std::string _ns = ns();
+     BSONObjBuilder b;
+     if (!only.empty()) {
+-        b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++        b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+     }
+     BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
+     if (!last.isEmpty()) {
+@@ -845,7 +846,7 @@
+ */
+ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
+     int okResultCode = 1;
+-    string ns = string("local.oplog.$") + sourceName();
++    std::string ns = std::string("local.oplog.$") + sourceName();
+     LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
+ 
+     bool tailing = true;
+@@ -865,7 +866,7 @@
+                 BSONElement e = i.next();
+                 if (e.eoo())
+                     break;
+-                string name = e.embeddedObject().getField("name").valuestr();
++                std::string name = e.embeddedObject().getField("name").valuestr();
+                 if (!e.embeddedObject().getBoolField("empty")) {
+                     if (name != "local") {
+                         if (only.empty() || only == name) {
+@@ -889,7 +890,7 @@
+         if (!only.empty()) {
+             // note we may here skip a LOT of data table scanning, a lot of work for the master.
+             // maybe append "\\." here?
+-            query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
++            query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
+         }
+         BSONObj queryObj = query.done();
+         // e.g. queryObj = { ts: { $gte: syncedTo } }
+@@ -908,7 +909,7 @@
+ 
+     // show any deferred database creates from a previous pass
+     {
+-        set<string>::iterator i = addDbNextPass.begin();
++        set<std::string>::iterator i = addDbNextPass.begin();
+         if (i != addDbNextPass.end()) {
+             BSONObjBuilder b;
+             b.append("ns", *i + '.');
+@@ -939,7 +940,7 @@
+         BSONObj op = oplogReader.next();
+         BSONElement ts = op.getField("ts");
+         if (ts.type() != Date && ts.type() != bsonTimestamp) {
+-            string err = op.getStringField("$err");
++            std::string err = op.getStringField("$err");
+             if (!err.empty()) {
+                 // 13051 is "tailable cursor requested on non capped collection"
+                 if (op.getIntField("code") == 13051) {
+@@ -1107,7 +1108,7 @@
+ 
+     // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
+     // hostName.
+-    if ((string("localhost") == hostName || string("127.0.0.1") == hostName) &&
++    if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) &&
+         serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
+         log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
+         sleepsecs(5);
+@@ -1252,7 +1253,7 @@
+         if (s) {
+             stringstream ss;
+             ss << "sleep " << s << " sec before next pass";
+-            string msg = ss.str();
++            std::string msg = ss.str();
+             if (!serverGlobalParams.quiet)
+                 log() << msg << endl;
+             ReplInfo r(msg.c_str());



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805190652.w4J6qPGg009343>