Package: mongodb
Version: 1:2.4.8-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu trusty ubuntu-patch
Dear Maintainer,
In Ubuntu, the attached patch was applied to achieve the following:
* Merge from Debian unstable, remaining changes:
- d/control: Enable armhf across all binary packages.
- d/control,tests: Add DEP-8 tests.
- d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
build failure on ARM due to missing signed'ness of char cast.
This is the last delta against the Ubuntu packages; it would be great to get
things
back in sync!
Thanks for considering the patch.
James
-- System Information:
Debian Release: wheezy/sid
APT prefers trusty-updates
APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500,
'trusty'), (100, 'trusty-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.11.0-12-generic (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru mongodb-2.4.8/debian/changelog mongodb-2.4.8/debian/changelog
diff -Nru mongodb-2.4.8/debian/control mongodb-2.4.8/debian/control
--- mongodb-2.4.8/debian/control 2013-11-13 11:28:12.000000000 +0000
+++ mongodb-2.4.8/debian/control 2013-11-22 15:42:33.000000000 +0000
@@ -25,9 +25,10 @@
Vcs-Git: git://anonscm.debian.org/collab-maint/mongodb.git
Vcs-Browser: http://anonscm.debian.org/git/collab-maint/mongodb.git
Homepage: http://www.mongodb.org
+XS-Testsuite: autopkgtest
Package: mongodb
-Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386
+Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386 armhf
Depends:
mongodb-dev,
mongodb-server (>= 1:2.4.1-2),
@@ -53,7 +54,7 @@
the server, the clients and the development files (headers and library).
Package: mongodb-server
-Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386
+Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386 armhf
Depends:
adduser,
mongodb-clients,
diff -Nru mongodb-2.4.8/debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch mongodb-2.4.8/debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch
--- mongodb-2.4.8/debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch 1970-01-01 01:00:00.000000000 +0100
+++ mongodb-2.4.8/debian/patches/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch 2013-11-22 14:45:00.000000000 +0000
@@ -0,0 +1,35 @@
+From a1689790db10139d09c4fb29f500470564faabde Mon Sep 17 00:00:00 2001
+From: Robie Basak <[email protected]>
+Date: Mon, 6 May 2013 23:01:56 +0100
+Subject: [PATCH] SERVER-9680 Use a signed char to store BSONType enumerations
+
+MinKey is defined as -1, so a signed char must be used to store BSONType
+enumerations. Using a char to store a negative value results in
+undefined behaviour. On i386 and amd64 architectures it happens to work
+because on these platforms a char is generally signed, but this is not
+guaranteed.
+
+This fixes a build failure on ARM, where chars are unsigned by default,
+and using MinKey (defined as -1) results in a compiler error.
+---
+ src/mongo/bson/bson_validate.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/mongo/bson/bson_validate.cpp b/src/mongo/bson/bson_validate.cpp
+index 9ac0bcb..88e6d48 100644
+--- a/src/mongo/bson/bson_validate.cpp
++++ b/src/mongo/bson/bson_validate.cpp
+@@ -130,8 +130,8 @@
+ Status validateElementInfo(Buffer* buffer, ValidationState::State* nextState) {
+ Status status = Status::OK();
+
+- char type;
+- if ( !buffer->readNumber<char>(&type) )
++ signed char type;
++ if ( !buffer->readNumber<signed char>(&type) )
+ return Status( ErrorCodes::InvalidBSON, "invalid bson" );
+
+ if ( type == EOO ) {
+--
+1.8.1.6
+
diff -Nru mongodb-2.4.8/debian/patches/series mongodb-2.4.8/debian/patches/series
--- mongodb-2.4.8/debian/patches/series 2013-10-18 09:36:32.000000000 +0100
+++ mongodb-2.4.8/debian/patches/series 2013-11-22 14:48:54.000000000 +0000
@@ -8,3 +8,4 @@
0008-Use-system-libstemmer.patch
0009-ignore-unused-local-typedefs.patch
0010-fix-integer-signs.patch
+0011-Use-a-signed-char-to-store-BSONType-enumerations.patch
diff -Nru mongodb-2.4.8/debian/tests/control mongodb-2.4.8/debian/tests/control
--- mongodb-2.4.8/debian/tests/control 1970-01-01 01:00:00.000000000 +0100
+++ mongodb-2.4.8/debian/tests/control 2013-11-22 14:45:00.000000000 +0000
@@ -0,0 +1,2 @@
+Tests: mongod mongo-client
+Depends: mongodb-server, mongodb-clients, nmap
diff -Nru mongodb-2.4.8/debian/tests/mongo-client mongodb-2.4.8/debian/tests/mongo-client
--- mongodb-2.4.8/debian/tests/mongo-client 1970-01-01 01:00:00.000000000 +0100
+++ mongodb-2.4.8/debian/tests/mongo-client 2013-11-22 14:45:00.000000000 +0000
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+TIMEOUT=120
+
+echo -n "Waiting for mongod to start: "
+count=0
+while (! nc -z 127.0.0.1 27017); do
+ echo -n "."
+ count=$((count+1))
+ if test $count -gt $TIMEOUT; then
+ echo "mongod failed to start?"
+ pgrep mongod
+ exit 1
+ fi
+ sleep 1
+done
+echo "mongod listening"
+
+echo "Performing basic test using mongo client: "
+mongo --verbose jstests/basic1.js 2>&1
+echo "OK"
diff -Nru mongodb-2.4.8/debian/tests/mongod mongodb-2.4.8/debian/tests/mongod
--- mongodb-2.4.8/debian/tests/mongod 1970-01-01 01:00:00.000000000 +0100
+++ mongodb-2.4.8/debian/tests/mongod 2013-11-22 14:45:00.000000000 +0000
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+
+echo -n "Checking for running mongod process: "
+pgrep mongod 2>/dev/null
+echo "OK"