diff --git a/SOURCES/32bit-support.patch b/SOURCES/32bit-support.patch index a636e11..1201d5c 100644 --- a/SOURCES/32bit-support.patch +++ b/SOURCES/32bit-support.patch @@ -1,8 +1,8 @@ diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h -index 6162495c1c..8c0bece154 100644 +index 38dae82..ee9b957 100644 --- a/src/mongo/bson/bsonobjbuilder.h +++ b/src/mongo/bson/bsonobjbuilder.h -@@ -350,7 +350,7 @@ public: +@@ -341,7 +341,7 @@ public: return append(fieldName, d); } @@ -11,7 +11,7 @@ index 6162495c1c..8c0bece154 100644 static const size_t maxInt = (1 << 30); if (n < maxInt) append(fieldName, static_cast(n)); -@@ -359,6 +359,18 @@ public: +@@ -350,6 +350,18 @@ public: return *this; } @@ -30,30 +30,16 @@ index 6162495c1c..8c0bece154 100644 BSONObjBuilder& appendNumber(StringData fieldName, Decimal128 decNumber) { return append(fieldName, decNumber); } -diff --git a/src/mongo/db/storage/storage_options.cpp b/src/mongo/db/storage/storage_options.cpp -index dfbb776656..02d9f18520 100644 ---- a/src/mongo/db/storage/storage_options.cpp -+++ b/src/mongo/db/storage/storage_options.cpp -@@ -41,7 +41,7 @@ StorageGlobalParams::StorageGlobalParams() { - } +diff --git a/src/mongo/platform/pause.h b/src/mongo/platform/pause.h +index 46df146..5003de5 100644 +--- a/src/mongo/platform/pause.h ++++ b/src/mongo/platform/pause.h +@@ -55,7 +55,7 @@ + /* ori 0,0,0 is the PPC64 noop instruction */ + #define MONGO_YIELD_CORE_FOR_SMT() __asm__ volatile("ori 0,0,0" ::: "memory") - void StorageGlobalParams::reset() { -- engine = "wiredTiger"; -+ engine = "mmapv1"; - engineSetByUser = false; - dbpath = kDefaultDbPath; - upgrade = false; -diff --git a/src/mongo/platform/overflow_arithmetic.h b/src/mongo/platform/overflow_arithmetic.h -index a213bf479f..0fcce4b138 100644 ---- a/src/mongo/platform/overflow_arithmetic.h -+++ b/src/mongo/platform/overflow_arithmetic.h -@@ -143,7 +143,8 @@ inline bool mongoSignedAddOverflow64(long long lhs, long long rhs, long long* su - return __builtin_add_overflow(lhs, rhs, sum); - } +-#elif defined(__aarch64__) ++#elif defined(__aarch64__) || defined(__arm__) --inline bool mongoUnsignedAddOverflow64(unsigned long lhs, unsigned long rhs, unsigned long* sum) { -+// 32b arch: invalid conversion from 'size_t*' {aka 'unsigned int*'} to 'long unsigned int*' -+inline bool mongoUnsignedAddOverflow64(std::size_t lhs, std::size_t rhs, std::size_t* sum) { - return __builtin_add_overflow(lhs, rhs, sum); - } + #define MONGO_YIELD_CORE_FOR_SMT() __asm__ volatile("yield" ::: "memory") diff --git a/SOURCES/ppc64.patch b/SOURCES/ppc64.patch index 6de8c35..663bcc4 100644 --- a/SOURCES/ppc64.patch +++ b/SOURCES/ppc64.patch @@ -1,8 +1,8 @@ diff --git a/SConstruct b/SConstruct -index 52095d8b70..29ffc3ada4 100644 +index fe7975b..88d6650 100644 --- a/SConstruct +++ b/SConstruct -@@ -1059,6 +1059,7 @@ processor_macros = { +@@ -980,6 +980,7 @@ processor_macros = { 'arm' : { 'endian': 'little', 'defines': ('__arm__',) }, 'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')}, 'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')}, @@ -10,17 +10,8 @@ index 52095d8b70..29ffc3ada4 100644 'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)}, 's390x' : { 'endian': 'big', 'defines': ('__s390x__',)}, 'sparc' : { 'endian': 'big', 'defines': ('__sparc',)}, -@@ -3358,7 +3359,7 @@ def doConfigure(myenv): - # ask each module to configure itself and the build environment. - moduleconfig.configure_modules(mongo_modules, conf) - -- if env['TARGET_ARCH'] == "ppc64le": -+ if env['TARGET_ARCH'] == "ppc64le" or env['TARGET_ARCH'] == "ppc64": - # This checks for an altivec optimization we use in full text search. - # Different versions of gcc appear to put output bytes in different - # parts of the output vector produced by vec_vbpermq. This configure diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h -index 355d70e813..afefe7b1f0 100755 +index 355d70e..afefe7b 100755 --- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h +++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h @@ -570,7 +570,7 @@ @@ -33,10 +24,10 @@ index 355d70e813..afefe7b1f0 100755 # undef vax # undef mips diff --git a/src/third_party/IntelRDFPMathLib20U1/SConscript b/src/third_party/IntelRDFPMathLib20U1/SConscript -index c8eb827c28..60d7506adc 100644 +index 20287a6..a495e9c 100644 --- a/src/third_party/IntelRDFPMathLib20U1/SConscript +++ b/src/third_party/IntelRDFPMathLib20U1/SConscript -@@ -316,6 +316,9 @@ elif processor == 'x86_64' or processor == 'ppc64le': +@@ -313,6 +313,9 @@ elif processor == 'x86_64' or processor == 'ppc64le': cpp_defines['efi2'] = '1' cpp_defines['EFI2'] = '1' # Using 64 bit big endian @@ -46,10 +37,10 @@ index c8eb827c28..60d7506adc 100644 elif processor == 's390x': cpp_defines['s390x'] = '1' cpp_defines['BID_BIG_ENDIAN'] = '1' -diff --git a/src/third_party/timelib-2018.01alpha1/parse_tz.c b/src/third_party/timelib-2018.01alpha1/parse_tz.c -index 5986cd6468..18d41254ce 100644 ---- a/src/third_party/timelib-2018.01alpha1/parse_tz.c -+++ b/src/third_party/timelib-2018.01alpha1/parse_tz.c +diff --git a/src/third_party/timelib-2017.05/parse_tz.c b/src/third_party/timelib-2017.05/parse_tz.c +index 3b68549..6460475 100644 +--- a/src/third_party/timelib-2017.05/parse_tz.c ++++ b/src/third_party/timelib-2017.05/parse_tz.c @@ -38,7 +38,7 @@ # endif #endif @@ -60,10 +51,10 @@ index 5986cd6468..18d41254ce 100644 # define WORDS_BIGENDIAN # else diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript -index 40b80a09b6..fac3466aed 100644 +index 1e07852..8a671b6 100644 --- a/src/third_party/wiredtiger/SConscript +++ b/src/third_party/wiredtiger/SConscript -@@ -152,7 +152,7 @@ condition_map = { +@@ -135,7 +135,7 @@ condition_map = { 'WINDOWS_HOST' : env.TargetOSIs('windows'), 'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64', @@ -72,9 +63,9 @@ index 40b80a09b6..fac3466aed 100644 'X86_HOST' : env['TARGET_ARCH'] == 'x86_64', 'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x', } -@@ -182,6 +182,10 @@ if useSnappy: - if (get_option("use-s390x-crc32") == "off"): - env.Append(CPPDEFINES=["HAVE_NO_CRC32_HARDWARE"]) +@@ -167,6 +167,10 @@ if useSnappy: + if not (env['TARGET_ARCH'] == 's390x' and get_option("use-s390x-crc32") == "off"): + env.Append(CPPDEFINES=["HAVE_CRC32_HARDWARE"]) +# It is not possible to pass ASFLAGS through variables to scons now +if env['TARGET_ARCH'] == 'ppc64': diff --git a/SOURCES/python3-buildscripts-tests.patch b/SOURCES/python3-buildscripts-tests.patch index 1954119..cafd611 100644 --- a/SOURCES/python3-buildscripts-tests.patch +++ b/SOURCES/python3-buildscripts-tests.patch @@ -1,8 +1,8 @@ diff --git a/SConstruct b/SConstruct -index 52095d8b70..e913ce238f 100644 +index 4d52f24b85..b2d85d6acf 100644 --- a/SConstruct +++ b/SConstruct -@@ -425,7 +425,7 @@ win_version_min_choices = { +@@ -388,7 +388,7 @@ win_version_min_choices = { } add_option('win-version-min', @@ -11,7 +11,7 @@ index 52095d8b70..e913ce238f 100644 default=None, help='minimum Windows version to support', type='choice', -@@ -551,7 +551,7 @@ except ValueError as e: +@@ -497,7 +497,7 @@ except ValueError as e: def variable_shlex_converter(val): # If the argument is something other than a string, propogate # it literally. @@ -20,7 +20,7 @@ index 52095d8b70..e913ce238f 100644 return val parse_mode = get_option('variable-parse-mode') if parse_mode == 'auto': -@@ -894,7 +894,7 @@ SConsignFile(str(sconsDataDir.File('sconsign'))) +@@ -826,7 +826,7 @@ SConsignFile(str(sconsDataDir.File('sconsign'))) def printLocalInfo(): import sys, SCons print( "scons version: " + SCons.__version__ ) @@ -29,7 +29,7 @@ index 52095d8b70..e913ce238f 100644 printLocalInfo() -@@ -2089,7 +2089,7 @@ def doConfigure(myenv): +@@ -1938,7 +1938,7 @@ def doConfigure(myenv): # to make them real errors. cloned.Append(CCFLAGS=['-Werror']) conf = Configure(cloned, help=False, custom_tests = { @@ -38,17 +38,17 @@ index 52095d8b70..e913ce238f 100644 }) available = conf.CheckFlag() conf.Finish() -@@ -2568,7 +2568,7 @@ def doConfigure(myenv): - # Select those unique black files that are associated with the - # currently enabled sanitizers, but filter out those that are - # zero length. -- blackfiles = {v for (k, v) in blackfiles_map.iteritems() if k in sanitizer_list} -+ blackfiles = {v for (k, v) in blackfiles_map.items() if k in sanitizer_list} - blackfiles = [f for f in blackfiles if os.stat(f.path).st_size != 0] - - # Filter out any blacklist options that the toolchain doesn't support. +@@ -2410,7 +2410,7 @@ def doConfigure(myenv): + "undefined" : myenv.File("#etc/ubsan.blacklist"), + } + +- blackfiles = set([v for (k, v) in blackfiles_map.iteritems() if k in sanitizer_list]) ++ blackfiles = set([v for (k, v) in blackfiles_map.items() if k in sanitizer_list]) + blacklist_options=["-fsanitize-blacklist=%s" % blackfile + for blackfile in blackfiles + if os.stat(blackfile.path).st_size != 0] diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py -index af3a53d29f..564f7a4171 100755 +index cf9884d8b1..c0f4140e59 100755 --- a/buildscripts/clang_format.py +++ b/buildscripts/clang_format.py @@ -20,7 +20,7 @@ import sys @@ -57,7 +57,7 @@ index af3a53d29f..564f7a4171 100755 import threading -import urllib2 +import urllib.request, urllib.error, urllib.parse - from distutils import spawn # pylint: disable=no-name-in-module + from distutils import spawn from optparse import OptionParser from multiprocessing import cpu_count @@ -96,11 +96,11 @@ def get_clang_format_from_cache_and_extract(url, tarball_ext): @@ -66,14 +66,23 @@ index af3a53d29f..564f7a4171 100755 try: - resp = urllib2.urlopen(url) + resp = urllib.request.urlopen(url) - with open(temp_tar_file, 'wb') as fh: - fh.write(resp.read()) + with open(temp_tar_file, 'wb') as f: + f.write(resp.read()) break - except urllib2.URLError: + except urllib.error.URLError: if attempt == num_tries - 1: raise continue +@@ -436,7 +436,7 @@ def reformat_branch(clang_format, commit_prior_to_reformat, commit_after_reforma + + # Check if anything needed reformatting, and if so amend the commit + if not repo.is_working_tree_dirty(): +- print ("Commit %s needed no reformatting" % commit_hash) ++ print("Commit %s needed no reformatting" % commit_hash) + else: + repo.commit(["--all", "--amend", "--no-edit"]) + diff --git a/buildscripts/cpplint.py b/buildscripts/cpplint.py index 6979cbcd4e..bc9ff038fd 100755 --- a/buildscripts/cpplint.py @@ -283,61 +292,125 @@ index 6979cbcd4e..bc9ff038fd 100755 include_state, function_state, nesting_state, error, extra_check_functions) diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py -index f9162917db..60cdb2b50f 100755 +index cc46789907..7351e6a12e 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py -@@ -7,12 +7,15 @@ Optionally replaces zero codes in source code with new distinct values. - - from __future__ import absolute_import - from __future__ import print_function +@@ -5,13 +5,16 @@ + Parses .cpp files for assertions and verifies assertion codes are distinct. + Optionally replaces zero codes in source code with new distinct values. + """ +from __future__ import unicode_literals - +import io + import bisect - import os.path + import os import sys +-import utils ++from . import utils from collections import defaultdict, namedtuple from optparse import OptionParser +from functools import reduce - # Get relative imports to work when the package is not installed on the PYTHONPATH. - if __name__ == "__main__" and __package__ is None: -@@ -56,7 +59,7 @@ def parse_source_files(callback): + try: + import regex as re +@@ -66,9 +69,9 @@ def parseSourceFiles( callback ): + + for sourceFile in utils.getAllSourceFiles(prefix='src/mongo/'): if list_files: - print('scanning file: ' + source_file) +- print 'scanning file: ' + sourceFile ++ print('scanning file: ' + sourceFile) -- with open(source_file) as fh: -+ with open(source_file, encoding="utf-8") as fh: - text = fh.read() +- with open(sourceFile) as f: ++ with io.open(sourceFile, encoding="utf-8") as f: + text = f.read() if not any([zz in text for zz in quick]): +@@ -159,7 +162,7 @@ def readErrorCodes(): + + parseSourceFiles( checkDups ) + +- if seen.has_key("0"): ++ if "0" in seen: + code = "0" + bad = seen[code] + errors.append( bad ) +@@ -167,7 +170,7 @@ def readErrorCodes(): + print( "ZERO_CODE:" ) + print( " %s:%d:%d:%s" % (bad.sourceFile, line, col, bad.lines) ) + +- for code, locations in dups.items(): ++ for code, locations in list(dups.items()): + print( "DUPLICATE IDS: %s" % code ) + for loc in locations: + line, col = getLineAndColumnForPosition(loc) +@@ -189,19 +192,19 @@ def replaceBadCodes( errors, nextCode ): + + for loc in skip_errors: + line, col = getLineAndColumnForPosition(loc) +- print ("SKIPPING NONZERO code=%s: %s:%d:%d" ++ print("SKIPPING NONZERO code=%s: %s:%d:%d" + % (loc.code, loc.sourceFile, line, col)) + + # Dedupe, sort, and reverse so we don't have to update offsets as we go. + for assertLoc in reversed(sorted(set(zero_errors))): + (sourceFile, byteOffset, lines, code) = assertLoc + lineNum, _ = getLineAndColumnForPosition(assertLoc) +- print "UPDATING_FILE: %s:%s" % (sourceFile, lineNum) ++ print("UPDATING_FILE: %s:%s" % (sourceFile, lineNum)) + + ln = lineNum - 1 + + with open(sourceFile, 'r+') as f: +- print "LINE_%d_BEFORE:%s" % (lineNum, f.readlines()[ln].rstrip()) ++ print("LINE_%d_BEFORE:%s" % (lineNum, f.readlines()[ln].rstrip())) + + f.seek(0) + text = f.read() +@@ -212,7 +215,7 @@ def replaceBadCodes( errors, nextCode ): + f.write(text[byteOffset+1:]) + f.seek(0) + +- print "LINE_%d_AFTER :%s" % (lineNum, f.readlines()[ln].rstrip()) ++ print("LINE_%d_AFTER :%s" % (lineNum, f.readlines()[ln].rstrip())) + nextCode += 1 + + +@@ -281,7 +284,7 @@ def main(): + elif options.replace: + replaceBadCodes(errors, next) + else: +- print ERROR_HELP ++ print(ERROR_HELP) + sys.exit(1) + + diff --git a/buildscripts/eslint.py b/buildscripts/eslint.py -index bb36531164..eb20dda9dd 100755 +index c1ab04fbab..d5c6aef4fc 100755 --- a/buildscripts/eslint.py +++ b/buildscripts/eslint.py -@@ -20,7 +20,7 @@ import sys +@@ -18,7 +18,7 @@ import sys import tarfile import tempfile import threading -import urllib +import urllib.request, urllib.parse, urllib.error - from distutils import spawn # pylint: disable=no-name-in-module + from distutils import spawn from optparse import OptionParser -@@ -84,7 +84,7 @@ def get_eslint_from_cache(dest_file, platform, arch): - +@@ -81,7 +81,7 @@ def get_eslint_from_cache(dest_file, platform, arch): # Download the file - print("Downloading ESLint %s from %s, saving to %s" % (ESLINT_VERSION, url, temp_tar_file)) + print("Downloading ESLint %s from %s, saving to %s" % (ESLINT_VERSION, + url, temp_tar_file)) - urllib.urlretrieve(url, temp_tar_file) + urllib.request.urlretrieve(url, temp_tar_file) eslint_distfile = ESLINT_SOURCE_TAR_BASE.substitute(platform=platform, arch=arch) extract_eslint(temp_tar_file, eslint_distfile) diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py -index bf8c188151..eb98466d90 100644 +index 354acca974..9612e39305 100644 --- a/buildscripts/idl/idl/binder.py +++ b/buildscripts/idl/idl/binder.py -@@ -727,7 +727,7 @@ def _validate_enum_int(ctxt, idl_enum): +@@ -608,7 +608,7 @@ def _validate_enum_int(ctxt, idl_enum): min_value = min(int_values_set) max_value = max(int_values_set) @@ -347,10 +420,10 @@ index bf8c188151..eb98466d90 100644 if valid_int != int_values_set: ctxt.add_enum_non_continuous_range_error(idl_enum, idl_enum.name) diff --git a/buildscripts/idl/idl/bson.py b/buildscripts/idl/idl/bson.py -index 21fb8961f5..10df6ed4c4 100644 +index 214b67a7bf..b84421d657 100644 --- a/buildscripts/idl/idl/bson.py +++ b/buildscripts/idl/idl/bson.py -@@ -87,7 +87,7 @@ def cpp_bson_type_name(name): +@@ -141,7 +141,7 @@ def cpp_bson_type_name(name): def list_valid_types(): # type: () -> List[unicode] """Return a list of supported bson types.""" @@ -360,7 +433,7 @@ index 21fb8961f5..10df6ed4c4 100644 def is_valid_bindata_subtype(name): diff --git a/buildscripts/idl/idl/cpp_types.py b/buildscripts/idl/idl/cpp_types.py -index d275872ca5..81033a251c 100644 +index aafcf87224..e989664eee 100644 --- a/buildscripts/idl/idl/cpp_types.py +++ b/buildscripts/idl/idl/cpp_types.py @@ -28,6 +28,7 @@ from . import writer @@ -384,7 +457,7 @@ index d275872ca5..81033a251c 100644 def __init__(self, field): # type: (ast.Field) -> None """Construct a CppTypeBase.""" -@@ -521,11 +520,9 @@ def get_cpp_type(field): +@@ -537,11 +536,9 @@ def get_cpp_type(field): return cpp_type_info @@ -398,7 +471,7 @@ index d275872ca5..81033a251c 100644 # type: (ast.Field) -> None """Construct a BsonCppTypeBase.""" diff --git a/buildscripts/idl/idl/enum_types.py b/buildscripts/idl/idl/enum_types.py -index 9435136451..727990bef6 100644 +index 3caed6f67d..f17c926748 100644 --- a/buildscripts/idl/idl/enum_types.py +++ b/buildscripts/idl/idl/enum_types.py @@ -29,11 +29,11 @@ from . import common @@ -416,26 +489,26 @@ index 9435136451..727990bef6 100644 def __init__(self, idl_enum): # type: (Union[syntax.Enum,ast.Enum]) -> None -@@ -115,8 +115,6 @@ class EnumTypeInfoBase(object): +@@ -108,8 +108,6 @@ class EnumTypeInfoBase(object): class _EnumTypeInt(EnumTypeInfoBase): """Type information for integer enumerations.""" - __metaclass__ = ABCMeta - - def get_cpp_type_name(self): - # type: () -> unicode - return common.title_case(self._enum.name) -@@ -190,8 +188,6 @@ def _get_constant_enum_name(idl_enum, enum_value): + def __init__(self, idl_enum): + # type: (Union[syntax.Enum,ast.Enum]) -> None + super(_EnumTypeInt, self).__init__(idl_enum) +@@ -189,8 +187,6 @@ def _get_constant_enum_name(idl_enum, enum_value): class _EnumTypeString(EnumTypeInfoBase): """Type information for string enumerations.""" - __metaclass__ = ABCMeta - - def get_cpp_type_name(self): - # type: () -> unicode - return common.template_args("${enum_name}Enum", enum_name=common.title_case( + def __init__(self, idl_enum): + # type: (Union[syntax.Enum,ast.Enum]) -> None + super(_EnumTypeString, self).__init__(idl_enum) diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py -index 82c22b45b8..4e099e9ffc 100644 +index 9f591eccc4..8f97abf28c 100644 --- a/buildscripts/idl/idl/generator.py +++ b/buildscripts/idl/idl/generator.py @@ -33,6 +33,7 @@ from . import enum_types @@ -446,8 +519,8 @@ index 82c22b45b8..4e099e9ffc 100644 def _get_field_member_name(field): # type: (ast.Field) -> unicode -@@ -122,11 +123,9 @@ def _get_all_fields(struct): - return sorted([field for field in all_fields], key=lambda f: f.cpp_name) +@@ -105,11 +106,9 @@ def _get_bson_type_check(bson_element, ctxt_name, field): + return '%s.checkAndAssertTypes(%s, %s)' % (ctxt_name, bson_element, type_list) -class _FieldUsageCheckerBase(object): @@ -459,33 +532,33 @@ index 82c22b45b8..4e099e9ffc 100644 def __init__(self, indented_writer): # type: (writer.IndentedTextWriter) -> None """Create a field usage checker.""" -@@ -1588,8 +1587,8 @@ def _generate_header(spec, file_name): - str_value = generate_header_str(spec) +@@ -1470,8 +1469,8 @@ def _generate_header(spec, file_name): + header.generate(spec) # Generate structs - with io.open(file_name, mode='wb') as file_handle: -- file_handle.write(str_value.encode()) +- file_handle.write(stream.getvalue().encode()) + with io.open(file_name, mode='w') as file_handle: -+ file_handle.write(str_value) ++ file_handle.write(stream.getvalue()) - def generate_source_str(spec, target_arch, header_file_name): -@@ -1611,8 +1610,8 @@ def _generate_source(spec, target_arch, file_name, header_file_name): - str_value = generate_source_str(spec, target_arch, header_file_name) + def _generate_source(spec, file_name, header_file_name): +@@ -1485,8 +1484,8 @@ def _generate_source(spec, file_name, header_file_name): + source.generate(spec, header_file_name) # Generate structs - with io.open(file_name, mode='wb') as file_handle: -- file_handle.write(str_value.encode()) +- file_handle.write(stream.getvalue().encode()) + with io.open(file_name, mode='w') as file_handle: -+ file_handle.write(str_value) ++ file_handle.write(stream.getvalue()) - def generate_code(spec, target_arch, output_base_dir, header_file_name, source_file_name): + def generate_code(spec, output_base_dir, header_file_name, source_file_name): diff --git a/buildscripts/idl/idl/parser.py b/buildscripts/idl/idl/parser.py -index 052f9a2178..4cf09295c4 100644 +index fd0af9b144..ac36a3a280 100644 --- a/buildscripts/idl/idl/parser.py +++ b/buildscripts/idl/idl/parser.py -@@ -31,6 +31,7 @@ from . import cpp_types +@@ -30,6 +30,7 @@ from . import common from . import errors from . import syntax @@ -493,8 +566,8 @@ index 052f9a2178..4cf09295c4 100644 class _RuleDesc(object): """ -@@ -548,11 +549,9 @@ def _parse(stream, error_file_name): - return syntax.IDLParsedSpec(spec, None) +@@ -486,11 +487,9 @@ def _parse(stream, error_file_name): + return syntax.IDLParsedSpec(spec, None) -class ImportResolverBase(object): @@ -507,19 +580,19 @@ index 052f9a2178..4cf09295c4 100644 # type: () -> None """Construct a ImportResolver.""" diff --git a/buildscripts/idl/idl/struct_types.py b/buildscripts/idl/idl/struct_types.py -index 8e055fe8c4..b57542bb44 100644 +index 9e2a9504ac..cd46e7c0ff 100644 --- a/buildscripts/idl/idl/struct_types.py +++ b/buildscripts/idl/idl/struct_types.py -@@ -24,6 +24,7 @@ from . import common - from . import cpp_types +@@ -23,6 +23,7 @@ from . import ast + from . import common from . import writer +ABC = ABCMeta(str('ABC'), (object,), {'__slots__': ()}) class ArgumentInfo(object): """Class that encapsulates information about an argument to a method.""" -@@ -114,11 +115,9 @@ class MethodInfo(object): - args=args) +@@ -125,11 +126,9 @@ class MethodInfo(object): + "${method_name}(${args});", method_name=self.method_name, args=args) -class StructTypeInfoBase(object): @@ -532,23 +605,23 @@ index 8e055fe8c4..b57542bb44 100644 def get_constructor_method(self): # type: () -> MethodInfo diff --git a/buildscripts/idl/idl/syntax.py b/buildscripts/idl/idl/syntax.py -index 049114b5d9..76643e68a1 100644 +index 056d2e9dc3..ff9a3953db 100644 --- a/buildscripts/idl/idl/syntax.py +++ b/buildscripts/idl/idl/syntax.py @@ -82,7 +82,7 @@ def _item_and_type(dic): # type: (Dict[Any, List[Any]]) -> Iterator[Tuple[Any, Any]] """Return an Iterator of (key, value) pairs from a dictionary.""" - return itertools.chain.from_iterable( -- (_zip_scalar(value, key) for (key, value) in dic.viewitems())) -+ (_zip_scalar(value, key) for (key, value) in dic.items())) + return itertools.chain.from_iterable((_zip_scalar(value, key) +- for (key, value) in dic.viewitems())) ++ for (key, value) in dic.items())) class SymbolTable(object): diff --git a/buildscripts/idl/tests/test_binder.py b/buildscripts/idl/tests/test_binder.py -index d8b6fc1630..1dd5afde4d 100644 +index 5502b69d36..b0f4ba4269 100644 --- a/buildscripts/idl/tests/test_binder.py +++ b/buildscripts/idl/tests/test_binder.py -@@ -74,7 +74,7 @@ class TestBinder(testcase.IDLTestcase): +@@ -72,7 +72,7 @@ class TestBinder(testcase.IDLTestcase): cpp_includes: - 'bar' - 'foo'""")) @@ -557,8 +630,23 @@ index d8b6fc1630..1dd5afde4d 100644 self.assertListEqual(spec.globals.cpp_includes, ['bar', 'foo']) def test_type_positive(self): +diff --git a/buildscripts/lint.py b/buildscripts/lint.py +index d4061a9b04..b1ca5b6169 100644 +--- a/buildscripts/lint.py ++++ b/buildscripts/lint.py +@@ -2,8 +2,8 @@ + import sys + import codecs + +-import cpplint +-import utils ++from . import cpplint ++from . import utils + + class CheckForConfigH: + def __init__(self): diff --git a/buildscripts/linter/base.py b/buildscripts/linter/base.py -index f22f59e4f0..09931a673b 100644 +index ae78d52066..7988876c98 100644 --- a/buildscripts/linter/base.py +++ b/buildscripts/linter/base.py @@ -5,12 +5,11 @@ from __future__ import print_function @@ -573,11 +661,11 @@ index f22f59e4f0..09931a673b 100644 - __metaclass__ = ABCMeta - - def __init__(self, cmd_name, required_version, cmd_location=None): - # type: (str, str, Optional[str]) -> None + def __init__(self, cmd_name, required_version): + # type: (str, str) -> None """ diff --git a/buildscripts/linter/git.py b/buildscripts/linter/git.py -index b4a6898604..d803e1b584 100644 +index edde6d0a49..4680e2f5fd 100644 --- a/buildscripts/linter/git.py +++ b/buildscripts/linter/git.py @@ -175,7 +175,7 @@ def get_files_to_check_from_patch(patches, filter_function): @@ -626,10 +714,10 @@ index 0648bfb16e..361da0c559 100644 pp_event.set() return diff --git a/buildscripts/resmokeconfig/loggers/__init__.py b/buildscripts/resmokeconfig/loggers/__init__.py -index 5342639c56..7444783cb6 100644 +index 6511d49636..454f675ca2 100644 --- a/buildscripts/resmokeconfig/loggers/__init__.py +++ b/buildscripts/resmokeconfig/loggers/__init__.py -@@ -16,7 +16,7 @@ def _get_named_loggers(): +@@ -21,7 +21,7 @@ def _get_named_loggers(): named_loggers = {} try: @@ -639,10 +727,10 @@ index 5342639c56..7444783cb6 100644 (short_name, ext) = os.path.splitext(filename) if ext in (".yml", ".yaml"): diff --git a/buildscripts/resmokeconfig/suites/__init__.py b/buildscripts/resmokeconfig/suites/__init__.py -index 87d378616b..4321f53658 100644 +index e075dd22e0..2ca2187e6e 100644 --- a/buildscripts/resmokeconfig/suites/__init__.py +++ b/buildscripts/resmokeconfig/suites/__init__.py -@@ -16,7 +16,7 @@ def _get_named_suites(): +@@ -21,7 +21,7 @@ def _get_named_suites(): named_suites = {} try: @@ -652,10 +740,10 @@ index 87d378616b..4321f53658 100644 (short_name, ext) = os.path.splitext(filename) if ext in (".yml", ".yaml"): diff --git a/buildscripts/resmokelib/config.py b/buildscripts/resmokelib/config.py -index b6429d5498..1a186281f1 100644 +index aa7ab64d4f..37f98d4138 100644 --- a/buildscripts/resmokelib/config.py +++ b/buildscripts/resmokelib/config.py -@@ -67,7 +67,7 @@ DEFAULTS = { +@@ -65,7 +65,7 @@ DEFAULTS = { "repeat": 1, "report_failure_status": "fail", "report_file": None, @@ -665,10 +753,10 @@ index b6429d5498..1a186281f1 100644 "shell_conn_string": None, "shell_port": None, diff --git a/buildscripts/resmokelib/core/process.py b/buildscripts/resmokelib/core/process.py -index 84c067d8e3..956c4f9e42 100644 +index 03fb849616..e70f90abb4 100644 --- a/buildscripts/resmokelib/core/process.py +++ b/buildscripts/resmokelib/core/process.py -@@ -182,8 +182,8 @@ class Process(object): +@@ -196,8 +196,8 @@ class Process(object): finally: win32api.CloseHandle(mongo_signal_handle) @@ -680,11 +768,11 @@ index 84c067d8e3..956c4f9e42 100644 # Adapted from implementation of Popen.terminate() in subprocess.py of Python 2.7 # because earlier versions do not catch exceptions. diff --git a/buildscripts/resmokelib/logging/buildlogger.py b/buildscripts/resmokelib/logging/buildlogger.py -index c4697574d4..aa03125148 100644 +index 01bba20202..044855cad0 100644 --- a/buildscripts/resmokelib/logging/buildlogger.py +++ b/buildscripts/resmokelib/logging/buildlogger.py -@@ -261,7 +261,7 @@ class BuildloggerServer(object): - """Initialize BuildloggerServer.""" +@@ -267,7 +267,7 @@ class BuildloggerServer(object): + def __init__(self): tmp_globals = {} self.config = {} - execfile(_BUILDLOGGER_CONFIG, tmp_globals, self.config) @@ -693,10 +781,10 @@ index c4697574d4..aa03125148 100644 # Rename "slavename" to "username" if present. if "slavename" in self.config and "username" not in self.config: diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py -index 197102b16b..bab553d11e 100644 +index 77ee0afb95..2d131c8efa 100644 --- a/buildscripts/resmokelib/selector.py +++ b/buildscripts/resmokelib/selector.py -@@ -71,7 +71,7 @@ class TestFileExplorer(object): +@@ -66,7 +66,7 @@ class TestFileExplorer(object): A list of paths as a list(str). """ tests = [] @@ -705,7 +793,7 @@ index 197102b16b..bab553d11e 100644 for test_path in filep: test_path = test_path.strip() tests.append(test_path) -@@ -310,7 +310,7 @@ def make_expression(conf): +@@ -294,7 +294,7 @@ def make_expression(conf): elif isinstance(conf, dict): if len(conf) != 1: raise ValueError("Tag matching expressions should only contain one key") @@ -715,19 +803,19 @@ index 197102b16b..bab553d11e 100644 if key == "$allOf": return _AllOfExpression(_make_expression_list(value)) diff --git a/buildscripts/resmokelib/testing/executor.py b/buildscripts/resmokelib/testing/executor.py -index 79ccb17786..fbd0a71919 100644 +index 9e733e4d89..43c1f517d5 100644 --- a/buildscripts/resmokelib/testing/executor.py +++ b/buildscripts/resmokelib/testing/executor.py -@@ -62,7 +62,7 @@ class TestSuiteExecutor(object): # pylint: disable=too-many-instance-attributes - jobs_to_start = self.num_tests +@@ -72,7 +72,7 @@ class TestSuiteExecutor(object): + jobs_to_start = num_tests # Must be done after getting buildlogger configuration. - self._jobs = [self._make_job(job_num) for job_num in xrange(jobs_to_start)] + self._jobs = [self._make_job(job_num) for job_num in range(jobs_to_start)] def run(self): - """Execute the test suite. -@@ -275,7 +275,7 @@ class TestSuiteExecutor(object): # pylint: disable=too-many-instance-attributes + """ +@@ -298,7 +298,7 @@ class TestSuiteExecutor(object): queue.put(test_case) # Add sentinel value for each job to indicate when there are no more items to process. @@ -737,10 +825,10 @@ index 79ccb17786..fbd0a71919 100644 return queue diff --git a/buildscripts/resmokelib/testing/fixtures/interface.py b/buildscripts/resmokelib/testing/fixtures/interface.py -index 9b4e69c112..3927ed85af 100644 +index af694ba3e0..198cae386f 100644 --- a/buildscripts/resmokelib/testing/fixtures/interface.py +++ b/buildscripts/resmokelib/testing/fixtures/interface.py -@@ -3,6 +3,7 @@ +@@ -5,6 +5,7 @@ Interface of the different fixtures for executing JSTests against. from __future__ import absolute_import import os.path @@ -748,26 +836,26 @@ index 9b4e69c112..3927ed85af 100644 import time import pymongo -@@ -25,10 +26,10 @@ def make_fixture(class_name, *args, **kwargs): +@@ -30,13 +31,11 @@ def make_fixture(class_name, *args, **kwargs): return _FIXTURES[class_name](*args, **kwargs) -class Fixture(object): -- """Base class for all fixtures.""" -- -- __metaclass__ = registry.make_registry_metaclass(_FIXTURES) # type: ignore +class Fixture(six.with_metaclass(registry.make_registry_metaclass(_FIXTURES), object)): -+ """ -+ Base class for all fixtures. -+ """ + """ + Base class for all fixtures. + """ +- __metaclass__ = registry.make_registry_metaclass(_FIXTURES) +- # We explicitly set the 'REGISTERED_NAME' attribute so that PyLint realizes that the attribute # is defined for all subclasses of Fixture. + REGISTERED_NAME = "Fixture" diff --git a/buildscripts/resmokelib/testing/fixtures/replicaset.py b/buildscripts/resmokelib/testing/fixtures/replicaset.py -index b1966e4ed5..c4338f08dd 100644 +index 37925aae88..afebb0ed0f 100644 --- a/buildscripts/resmokelib/testing/fixtures/replicaset.py +++ b/buildscripts/resmokelib/testing/fixtures/replicaset.py -@@ -77,11 +77,11 @@ class ReplicaSetFixture(interface.ReplFixture): # pylint: disable=too-many-inst +@@ -82,7 +82,7 @@ class ReplicaSetFixture(interface.ReplFixture): self.replset_name = self.mongod_options.get("replSet", "rs") if not self.nodes: @@ -776,17 +864,12 @@ index b1966e4ed5..c4338f08dd 100644 node = self._new_mongod(i, self.replset_name) self.nodes.append(node) -- for i in xrange(self.num_nodes): -+ for i in range(self.num_nodes): - if self.linear_chain and i > 0: - self.nodes[i].mongod_options["set_parameters"][ - "failpoint.forceSyncSourceCandidate"] = { diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py -index 394323630b..7ace4a1158 100644 +index e1a0c7bfe3..0daadda9e6 100644 --- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py +++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py -@@ -66,7 +66,7 @@ class ShardedClusterFixture(interface.Fixture): # pylint: disable=too-many-inst - self.configsvr.setup() +@@ -81,7 +81,7 @@ class ShardedClusterFixture(interface.Fixture): + self.configsvr.setup() if not self.shards: - for i in xrange(self.num_shards): @@ -795,36 +878,37 @@ index 394323630b..7ace4a1158 100644 shard = self._new_standalone_shard(i) elif isinstance(self.num_rs_nodes_per_shard, int): diff --git a/buildscripts/resmokelib/testing/hooks/interface.py b/buildscripts/resmokelib/testing/hooks/interface.py -index 5ea46907b8..693d3bbee9 100644 +index cd5200764f..958cc92192 100644 --- a/buildscripts/resmokelib/testing/hooks/interface.py +++ b/buildscripts/resmokelib/testing/hooks/interface.py -@@ -9,6 +9,8 @@ from ... import errors +@@ -7,6 +7,7 @@ from __future__ import absolute_import from ...logging import loggers from ...utils import registry +import six -+ - _HOOKS = {} # type: ignore + _HOOKS = {} -@@ -21,11 +23,8 @@ def make_hook(class_name, *args, **kwargs): +@@ -22,13 +23,11 @@ def make_custom_behavior(class_name, *args, **kwargs): return _HOOKS[class_name](*args, **kwargs) --class Hook(object): -+class Hook(six.with_metaclass(registry.make_registry_metaclass(_HOOKS), object)): - """Common interface all Hooks will inherit from.""" -- -- __metaclass__ = registry.make_registry_metaclass(_HOOKS) # type: ignore +-class CustomBehavior(object): ++class CustomBehavior(six.with_metaclass(registry.make_registry_metaclass(_HOOKS), object)): + """ + The common interface all CustomBehaviors will inherit from. + """ + +- __metaclass__ = registry.make_registry_metaclass(_HOOKS) - REGISTERED_NAME = registry.LEAVE_UNREGISTERED - def __init__(self, hook_logger, fixture, description): + @staticmethod diff --git a/buildscripts/resmokelib/testing/suite.py b/buildscripts/resmokelib/testing/suite.py -index 1a57b6c771..c216ef8118 100644 +index 132a2d70d9..07262d194a 100644 --- a/buildscripts/resmokelib/testing/suite.py +++ b/buildscripts/resmokelib/testing/suite.py -@@ -234,7 +234,7 @@ class Suite(object): # pylint: disable=too-many-instance-attributes +@@ -262,7 +262,7 @@ class Suite(object): sb.append("Executed %d times in %0.2f seconds:" % (num_iterations, total_time_taken)) combined_summary = _summary.Summary(0, 0.0, 0, 0, 0, 0) @@ -832,21 +916,21 @@ index 1a57b6c771..c216ef8118 100644 + for iteration in range(num_iterations): # Summarize each execution as a bulleted list of results. bulleter_sb = [] - summary = self._summarize_report(reports[iteration], start_times[iteration], + summary = self._summarize_report( diff --git a/buildscripts/resmokelib/testing/summary.py b/buildscripts/resmokelib/testing/summary.py -index dc92e0b5b3..5b49fbfd04 100644 +index bb44472caa..54da2181d5 100644 --- a/buildscripts/resmokelib/testing/summary.py +++ b/buildscripts/resmokelib/testing/summary.py -@@ -12,6 +12,6 @@ Summary = collections.namedtuple( - def combine(summary1, summary2): - """Return a summary representing the sum of 'summary1' and 'summary2'.""" +@@ -17,6 +17,6 @@ def combine(summary1, summary2): + Returns a summary representing the sum of 'summary1' and 'summary2'. + """ args = [] - for i in xrange(len(Summary._fields)): + for i in range(len(Summary._fields)): args.append(summary1[i] + summary2[i]) return Summary._make(args) diff --git a/buildscripts/resmokelib/testing/testcases/interface.py b/buildscripts/resmokelib/testing/testcases/interface.py -index 183e69f9d3..4642547c53 100644 +index be7f14afd5..f736bd5c36 100644 --- a/buildscripts/resmokelib/testing/testcases/interface.py +++ b/buildscripts/resmokelib/testing/testcases/interface.py @@ -7,6 +7,7 @@ from __future__ import absolute_import @@ -856,21 +940,23 @@ index 183e69f9d3..4642547c53 100644 +import six import unittest - from ... import logging -@@ -22,11 +23,8 @@ def make_test_case(test_kind, *args, **kwargs): + from ... import config +@@ -27,13 +28,11 @@ def make_test_case(test_kind, *args, **kwargs): return _TEST_CASES[test_kind](*args, **kwargs) -class TestCase(unittest.TestCase): +class TestCase(six.with_metaclass(registry.make_registry_metaclass(_TEST_CASES), unittest.TestCase)): - """A test case to execute.""" -- -- __metaclass__ = registry.make_registry_metaclass(_TEST_CASES) # type: ignore + """ + A test case to execute. + """ + +- __metaclass__ = registry.make_registry_metaclass(_TEST_CASES) - REGISTERED_NAME = registry.LEAVE_UNREGISTERED def __init__(self, logger, test_kind, test_name): -@@ -36,10 +34,10 @@ class TestCase(unittest.TestCase): +@@ -46,10 +45,10 @@ class TestCase(unittest.TestCase): if not isinstance(logger, logging.Logger): raise TypeError("logger must be a Logger instance") @@ -884,10 +970,10 @@ index 183e69f9d3..4642547c53 100644 # When the TestCase is created by the TestSuiteExecutor (through a call to make_test_case()) diff --git a/buildscripts/resmokelib/testing/testcases/jstest.py b/buildscripts/resmokelib/testing/testcases/jstest.py -index 3cb4ee0d50..15469ba50e 100644 +index 7327ead9fc..192761d8c9 100644 --- a/buildscripts/resmokelib/testing/testcases/jstest.py +++ b/buildscripts/resmokelib/testing/testcases/jstest.py -@@ -199,7 +199,7 @@ class JSTestCase(interface.ProcessTestCase): +@@ -240,7 +240,7 @@ class JSTestCase(interface.TestCase): test_cases = [] try: # If there are multiple clients, make a new thread for each client. @@ -897,10 +983,10 @@ index 3cb4ee0d50..15469ba50e 100644 test_case = self._create_test_case_for_thread(logger, thread_id) test_cases.append(test_case) diff --git a/buildscripts/resmokelib/utils/__init__.py b/buildscripts/resmokelib/utils/__init__.py -index 6b6a76d1f4..6bef14b5a0 100644 +index 7e528bc698..04da36aa5c 100644 --- a/buildscripts/resmokelib/utils/__init__.py +++ b/buildscripts/resmokelib/utils/__init__.py -@@ -48,10 +48,10 @@ def rmtree(path, **kwargs): +@@ -51,10 +51,10 @@ def rmtree(path, **kwargs): See https://github.com/pypa/setuptools/issues/706. """ if is_windows(): @@ -914,73 +1000,72 @@ index 6b6a76d1f4..6bef14b5a0 100644 path = path.encode("utf-8") shutil.rmtree(path, **kwargs) -@@ -72,12 +72,12 @@ def remove_if_exists(path): - - def is_string_list(lst): - """Return true if 'lst' is a list of strings, and false otherwise.""" +@@ -68,14 +68,14 @@ def is_string_list(lst): + """ + Returns true if 'lst' is a list of strings, and false otherwise. + """ - return isinstance(lst, list) and all(isinstance(x, basestring) for x in lst) + return isinstance(lst, list) and all(isinstance(x, str) for x in lst) def is_string_set(value): - """Return true if 'value' is a set of strings, and false otherwise.""" + """ + Returns true if 'value' is a set of strings, and false otherwise. + """ - return isinstance(value, set) and all(isinstance(x, basestring) for x in value) + return isinstance(value, set) and all(isinstance(x, str) for x in value) def is_js_file(filename): diff --git a/buildscripts/resmokelib/utils/archival.py b/buildscripts/resmokelib/utils/archival.py -index 8ccb3127f4..c8eecdcb70 100644 +index 1002f2ce90..7f52d22907 100644 --- a/buildscripts/resmokelib/utils/archival.py +++ b/buildscripts/resmokelib/utils/archival.py -@@ -1,8 +1,13 @@ - """Archival utility.""" +@@ -4,7 +4,11 @@ Archival utility. --from __future__ import absolute_import + from __future__ import absolute_import -import Queue -+ +try: + import queue +except ImportError: + #Python 2 + import Queue as queue -+ import collections import json import math -@@ -45,7 +50,7 @@ def file_list_size(files): +@@ -52,7 +56,7 @@ def file_list_size(files): def directory_size(directory): - """Return size (in bytes) of files in 'directory' tree.""" + """ Return size (in bytes) of files in 'directory' tree. """ dir_bytes = 0 - for root_dir, _, files in os.walk(unicode(directory)): + for root_dir, _, files in os.walk(str(directory)): for name in files: full_name = os.path.join(root_dir, name) try: -@@ -103,7 +108,7 @@ class Archival(object): # pylint: disable=too-many-instance-attributes +@@ -114,7 +118,7 @@ class Archival(object): self._lock = threading.Lock() # Start the worker thread to update the 'archival_json_file'. - self._archive_file_queue = Queue.Queue() + self._archive_file_queue = queue.Queue() - self._archive_file_worker = threading.Thread(target=self._update_archive_file_wkr, - args=(self._archive_file_queue, - logger), name="archive_file_worker") -@@ -115,7 +120,7 @@ class Archival(object): # pylint: disable=too-many-instance-attributes + self._archive_file_worker = threading.Thread( + target=self._update_archive_file_wkr, + args=(self._archive_file_queue, logger), +@@ -127,7 +131,7 @@ class Archival(object): self.s3_client = s3_client # Start the worker thread which uploads the archive. - self._upload_queue = Queue.Queue() + self._upload_queue = queue.Queue() - self._upload_worker = threading.Thread(target=self._upload_to_s3_wkr, - args=(self._upload_queue, self._archive_file_queue, - logger, self.s3_client), name="upload_worker") + self._upload_worker = threading.Thread( + target=self._upload_to_s3_wkr, + args=(self._upload_queue, self._archive_file_queue, logger, self.s3_client), diff --git a/buildscripts/resmokelib/utils/globstar.py b/buildscripts/resmokelib/utils/globstar.py -index 1e016875f9..d57cb41f41 100644 +index 644ebfe3e3..52100d7d9d 100644 --- a/buildscripts/resmokelib/utils/globstar.py +++ b/buildscripts/resmokelib/utils/globstar.py -@@ -134,7 +134,7 @@ def _list_dir(pathname): +@@ -145,7 +145,7 @@ def _list_dir(pathname): """ try: @@ -990,10 +1075,10 @@ index 1e016875f9..d57cb41f41 100644 except StopIteration: return None # 'pathname' directory does not exist diff --git a/buildscripts/resmokelib/utils/jscomment.py b/buildscripts/resmokelib/utils/jscomment.py -index 67758197c5..f4c4a4d6c5 100644 +index 18da788582..a393c43723 100644 --- a/buildscripts/resmokelib/utils/jscomment.py +++ b/buildscripts/resmokelib/utils/jscomment.py -@@ -36,7 +36,7 @@ def get_tags(pathname): +@@ -39,7 +39,7 @@ def get_tags(pathname): # TODO: it might be worth supporting the block (indented) style of YAML lists in # addition to the flow (bracketed) style tags = yaml.safe_load(_strip_jscomments(match.group(1))) @@ -1003,52 +1088,87 @@ index 67758197c5..f4c4a4d6c5 100644 return tags except yaml.YAMLError as err: diff --git a/buildscripts/resmokelib/utils/queue.py b/buildscripts/resmokelib/utils/queue.py -index c77692138b..57a635f45e 100644 +index 80da5e2cc6..41d23d54bf 100644 --- a/buildscripts/resmokelib/utils/queue.py +++ b/buildscripts/resmokelib/utils/queue.py -@@ -8,7 +8,12 @@ See https://bugs.python.org/issue1167930 for more details. +@@ -9,15 +9,20 @@ See https://bugs.python.org/issue1167930 for more details. from __future__ import absolute_import --import Queue as _Queue +-import Queue +try: -+ import queue as _Queue ++ import queue +except ImportError: + #Python 2 -+ import Queue as _Queue ++ import Queue as queue + import time + # Exception that is raised when get_nowait() is called on an empty Queue. +-Empty = Queue.Empty ++Empty = queue.Empty + + +-class Queue(Queue.Queue): ++class Queue(queue.Queue): + """ + A multi-producer, multi-consumer queue. + """ diff --git a/buildscripts/utils.py b/buildscripts/utils.py -index 5073b26ad8..0ac19aaba1 100644 +index 69a78921ca..93c697adca 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py -@@ -139,8 +139,8 @@ def find_python(min_version=(2, 5)): - # In case the version of Python is somehow missing sys.version_info or sys.executable. +@@ -122,7 +122,7 @@ def getprocesslist(): + raw = "" + try: + raw = execsys( "/bin/ps axww" )[0] +- except Exception,e: ++ except Exception as e: + print( "can't get processlist: " + str( e ) ) + + r = re.compile( "[\r\n]+" ) +@@ -145,7 +145,7 @@ def choosePathExist( choices , default=None): + return default + + def filterExists(paths): +- return filter(os.path.exists, paths) ++ return list(filter(os.path.exists, paths)) + + def ensureDir( name ): + d = os.path.dirname( name ) +@@ -176,7 +176,7 @@ def didMongodStart( port=27017 , timeout=20 ): + try: + checkMongoPort( port ) + return True +- except Exception,e: ++ except Exception as e: + print( e ) + timeout = timeout - 1 + return False +@@ -213,7 +213,7 @@ def find_python(min_version=(2, 5)): pass -- version = re.compile(r"[Pp]ython ([\d\.]+)", re.MULTILINE) -- binaries = ("python27", "python2.7", "python26", "python2.6", "python25", "python2.5", "python") -+ version = re.compile(r'[Pp]ython ([\d\.]+)', re.MULTILINE) + version = re.compile(r'[Pp]ython ([\d\.]+)', re.MULTILINE) +- binaries = ('python27', 'python2.7', 'python26', 'python2.6', 'python25', 'python2.5', 'python') + binaries = ('python3', 'python27', 'python2.7', 'python26', 'python2.6', 'python25', 'python2.5', 'python') for binary in binaries: try: - out, err = subprocess.Popen([binary, "-V"], stdout=subprocess.PIPE, -@@ -166,7 +166,7 @@ def replace_with_repr(unicode_error): - # repr() of the offending bytes into the decoded string - # at the position they occurred + out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() +@@ -251,7 +251,7 @@ def run_smoke_command(*args): + # at the position they occurred + def replace_with_repr(unicode_error): offender = unicode_error.object[unicode_error.start:unicode_error.end] - return (unicode(repr(offender).strip("'").strip('"')), unicode_error.end) + return (str(repr(offender).strip("'").strip('"')), unicode_error.end) + codecs.register_error('repr', replace_with_repr) - codecs.register_error("repr", replace_with_repr) diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py -index d2844a8d68..c6d66e3dd8 100644 +index 632ed29be5..1641c3ba90 100644 --- a/site_scons/libdeps.py +++ b/site_scons/libdeps.py -@@ -133,7 +133,7 @@ def __get_libdeps(node): +@@ -122,7 +122,7 @@ def __get_libdeps(node): marked.add(n.target_node) tsorted.append(n.target_node) @@ -1057,7 +1177,7 @@ index d2844a8d68..c6d66e3dd8 100644 if len(e.cycle_nodes) == 1 or e.cycle_nodes[0] != e.cycle_nodes[-1]: e.cycle_nodes.insert(0, n.target_node) raise -@@ -161,7 +161,7 @@ def __get_syslibdeps(node): +@@ -150,7 +150,7 @@ def __get_syslibdeps(node): for lib in __get_libdeps(node): for syslib in node.get_env().Flatten(lib.get_env().get(syslibdeps_env_var, [])): if syslib: @@ -1066,7 +1186,7 @@ index d2844a8d68..c6d66e3dd8 100644 print("Target '%s' depends on the availability of a " "system provided library for '%s', " "but no suitable library was found during configuration." % -@@ -220,7 +220,7 @@ def get_syslibdeps(source, target, env, for_signature): +@@ -209,7 +209,7 @@ def get_syslibdeps(source, target, env, for_signature): # they're believed to represent library short names, that should be prefixed with -l # or the compiler-specific equivalent. I.e., 'm' becomes '-lm', but 'File("m.a") is passed # through whole cloth. @@ -1120,7 +1240,7 @@ index f05228cfe4..f10b4027e1 100644 def generate(env, **kwargs): """The entry point for our tool. However, the builder for diff --git a/site_scons/site_tools/dagger/dagger.py b/site_scons/site_tools/dagger/dagger.py -index bace834783..8c55937ce8 100644 +index 1eeefe1ea3..03e7603d29 100644 --- a/site_scons/site_tools/dagger/dagger.py +++ b/site_scons/site_tools/dagger/dagger.py @@ -40,8 +40,8 @@ import sys @@ -1134,7 +1254,7 @@ index bace834783..8c55937ce8 100644 LIB_DB = [] # Stores every SCons library nodes -@@ -240,7 +240,7 @@ def write_obj_db(target, source, env): +@@ -269,7 +269,7 @@ def write_obj_db(target, source, env): for obj in OBJ_DB: __generate_file_rels(obj, g) @@ -1407,7 +1527,7 @@ index 9838b63349..fdf0c26030 100644 continue base = emitterdict[suffix] diff --git a/site_scons/site_tools/idl_tool.py b/site_scons/site_tools/idl_tool.py -index c0455c2110..519583b6ca 100755 +index 78bedfaa74..628f345361 100755 --- a/site_scons/site_tools/idl_tool.py +++ b/site_scons/site_tools/idl_tool.py @@ -47,7 +47,7 @@ def idl_scanner(node, env, path): @@ -1420,7 +1540,7 @@ index c0455c2110..519583b6ca 100755 nodes_deps_list.extend(env.Glob('#buildscripts/idl/idl/*.py')) diff --git a/site_scons/site_tools/jstoh.py b/site_scons/site_tools/jstoh.py -index 26eb6cbbf2..9c71e0c061 100644 +index dc90b324b2..567958a50f 100644 --- a/site_scons/site_tools/jstoh.py +++ b/site_scons/site_tools/jstoh.py @@ -1,3 +1,5 @@ @@ -1429,16 +1549,18 @@ index 26eb6cbbf2..9c71e0c061 100644 import os import sys -@@ -39,7 +41,7 @@ def jsToHeader(target, source): +@@ -39,8 +41,8 @@ def jsToHeader(target, source): text = '\n'.join(h) +- print "writing: %s" % outFile - with open(outFile, 'wb') as out: ++ print("writing: %s" % outFile) + with open(outFile, 'w') as out: try: out.write(text) finally: -@@ -48,7 +50,7 @@ def jsToHeader(target, source): +@@ -49,7 +51,7 @@ def jsToHeader(target, source): if __name__ == "__main__": if len(sys.argv) < 3: @@ -1448,7 +1570,7 @@ index 26eb6cbbf2..9c71e0c061 100644 jsToHeader(sys.argv[1], sys.argv[2:]) diff --git a/site_scons/site_tools/mongo_benchmark.py b/site_scons/site_tools/mongo_benchmark.py -index b2a1750e3d..47a190dfdd 100644 +index 7c12627bc4..16fc1045c1 100644 --- a/site_scons/site_tools/mongo_benchmark.py +++ b/site_scons/site_tools/mongo_benchmark.py @@ -14,7 +14,7 @@ def benchmark_list_builder_action(env, target, source): @@ -1461,7 +1583,7 @@ index b2a1750e3d..47a190dfdd 100644 finally: ofile.close() diff --git a/site_scons/site_tools/mongo_integrationtest.py b/site_scons/site_tools/mongo_integrationtest.py -index 0ced90c949..aeda674991 100644 +index ff9a5f451b..fccbbebb47 100644 --- a/site_scons/site_tools/mongo_integrationtest.py +++ b/site_scons/site_tools/mongo_integrationtest.py @@ -12,10 +12,10 @@ def register_integration_test(env, test): @@ -1478,7 +1600,7 @@ index 0ced90c949..aeda674991 100644 finally: ofile.close() diff --git a/site_scons/site_tools/mongo_unittest.py b/site_scons/site_tools/mongo_unittest.py -index 2ad0f51bfd..1ca644c611 100644 +index ec99ab2d45..a4185a6b41 100644 --- a/site_scons/site_tools/mongo_unittest.py +++ b/site_scons/site_tools/mongo_unittest.py @@ -11,10 +11,10 @@ def register_unit_test(env, test): @@ -1508,17 +1630,17 @@ index 95130c9e9a..c02d78619f 100644 continue base = emitterdict[suffix] diff --git a/site_scons/site_tools/thin_archive.py b/site_scons/site_tools/thin_archive.py -index 1535787443..015c24a910 100644 +index 511c0ef6e5..0d8a83b83a 100644 --- a/site_scons/site_tools/thin_archive.py +++ b/site_scons/site_tools/thin_archive.py @@ -41,7 +41,7 @@ def exists(env): for line in pipe.stdout: - if found: + if isgnu: continue # consume all data -- found = re.search(r'^GNU ar|^LLVM', line) -+ found = re.search(b'^GNU ar|^LLVM', line) +- isgnu = re.search(r'^GNU ar', line) ++ isgnu = re.search(b'^GNU ar', line) - return bool(found) + return bool(isgnu) diff --git a/site_scons/site_tools/xcode.py b/site_scons/site_tools/xcode.py index 9ec68c3547..5ddebb2e00 100644 @@ -1531,10 +1653,10 @@ index 9ec68c3547..5ddebb2e00 100644 - print "NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands" + print("NOTE: Xcode detected; propagating DEVELOPER_DIR from shell environment to subcommands") diff --git a/src/mongo/SConscript b/src/mongo/SConscript -index 0c2d4cb525..3b304a5796 100644 +index 9c340ac2f8..617415ea4a 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript -@@ -154,7 +154,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else +@@ -157,7 +157,7 @@ js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else # On windows, we need to escape the backslashes in the command-line # so that windows paths look okay. @@ -1543,16 +1665,16 @@ index 0c2d4cb525..3b304a5796 100644 if env.TargetOSIs('windows'): cmd_line = cmd_line.replace('\\', r'\\') -@@ -642,7 +642,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'), +@@ -604,7 +604,7 @@ env.Append(MODULE_BANNERS = [distsrc.File('README'), + distsrc.File('MPL-2')]) - # If no module has introduced a file named LICENSE-Enterprise.txt then this - # is a Community build, so inject the AGPL and the Community license --if sum(itertools.imap(lambda x: x.name == "LICENSE-Enterprise.txt", env['MODULE_BANNERS'])) == 0: -+if sum(map(lambda x: x.name == "LICENSE-Enterprise.txt", env['MODULE_BANNERS'])) == 0: - env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0'), - distsrc.File('LICENSE-Community.txt')]) + # If no module has introduced a file named LICENSE.txt, then inject the AGPL. +-if sum(itertools.imap(lambda x: x.name == "LICENSE.txt", env['MODULE_BANNERS'])) == 0: ++if sum(map(lambda x: x.name == "LICENSE.txt", env['MODULE_BANNERS'])) == 0: + env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0')]) -@@ -662,7 +662,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in + # All module banners get staged to the top level of the tarfile, so we +@@ -623,7 +623,7 @@ module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in # Allow modules to map original file name directories to subdirectories # within the archive (e.g. { "src/mongo/db/modules/enterprise/docs": "snmp"}) archive_addition_transforms = [] @@ -1562,7 +1684,7 @@ index 0c2d4cb525..3b304a5796 100644 (full_dir, archive_dir)) diff --git a/src/mongo/base/generate_error_codes.py b/src/mongo/base/generate_error_codes.py -index 577108c7ec..e9a1dfa552 100644 +index 420ee964ff..b704767a01 100644 --- a/src/mongo/base/generate_error_codes.py +++ b/src/mongo/base/generate_error_codes.py @@ -26,6 +26,8 @@ @@ -1574,7 +1696,7 @@ index 577108c7ec..e9a1dfa552 100644 """Generate error_codes.{h,cpp} from error_codes.err. Format of error_codes.err: -@@ -98,7 +100,7 @@ def main(argv): +@@ -93,7 +95,7 @@ def main(argv): categories=error_classes, ) @@ -1606,19 +1728,19 @@ index b712b29666..39252ed293 100755 actionTypes = parseActionTypesFromFile(sys.argv[1]) diff --git a/src/mongo/db/fts/generate_stop_words.py b/src/mongo/db/fts/generate_stop_words.py -index 31603eb92e..ae4ad6ccbd 100644 +index e0dc801ca9..e0aad760e8 100644 --- a/src/mongo/db/fts/generate_stop_words.py +++ b/src/mongo/db/fts/generate_stop_words.py -@@ -1,7 +1,7 @@ - import sys +@@ -7,7 +7,7 @@ def generate( header, source, language_files ): + for x in language_files: + print( "\t%s" % x ) - def generate( header, source, language_files ): - out = open( header, "wb" ) + out = open( header, "w" ) out.write( """ #pragma once #include -@@ -18,7 +18,7 @@ namespace fts { +@@ -24,7 +24,7 @@ namespace fts { @@ -1627,7 +1749,7 @@ index 31603eb92e..ae4ad6ccbd 100644 out.write( '#include "%s"' % header.rpartition( "/" )[2].rpartition( "\\" )[2] ) out.write( """ namespace mongo { -@@ -34,7 +34,7 @@ namespace fts { +@@ -40,7 +40,7 @@ namespace fts { out.write( ' // %s\n' % l_file ) out.write( ' {\n' ) out.write( ' const char* const words[] = {\n' ) @@ -1649,10 +1771,10 @@ index 08cfa95cda..7c623aff60 100644 for i in range(len(d)): if ord(d[i]) not in diacritics: -diff --git a/src/mongo/util/generate_icu_init_cpp.py b/src/mongo/util/generate_icu_init_cpp.py +diff --git a/src/mongo/db/query/collation/generate_icu_init_cpp.py b/src/mongo/db/query/collation/generate_icu_init_cpp.py index 8ae084aeec..7c576f6ffe 100755 ---- a/src/mongo/util/generate_icu_init_cpp.py -+++ b/src/mongo/util/generate_icu_init_cpp.py +--- a/src/mongo/db/query/collation/generate_icu_init_cpp.py ++++ b/src/mongo/db/query/collation/generate_icu_init_cpp.py @@ -26,6 +26,9 @@ # delete this exception statement from all source files in the program, # then also delete it in the license file. diff --git a/SPECS/mongodb.spec b/SPECS/mongodb.spec index 7e324eb..32e489c 100644 --- a/SPECS/mongodb.spec +++ b/SPECS/mongodb.spec @@ -37,8 +37,8 @@ %global MONGO_DISTNAME mongo-r%{version} Name: mongodb -Version: 4.0.3 -Release: 3%{?dist} +Version: 3.6.6 +Release: 2%{?dist} Summary: High-performance, schema-free document-oriented database Group: Applications/Databases License: AGPLv3 and zlib and ASL 2.0 @@ -60,26 +60,39 @@ Source9: %{daemonshard}.service Source10: %{daemonshard}.sysconf Source11: README.txt -# TabError: inconsistent use of tabs and spaces in indentation -# -Patch0: inconsistent-tabs.patch +# Fix build system to allow building with system version of libraries (mozjs, icu and asio) +# - needed for building additional architectures +# https://jira.mongodb.org/browse/SERVER-21353 -> now patching bundled mozjs45 - see patch23 +#Patch0: use-system-mozjs-icu-asio.patch # Convert build scripts and testsuite to support python3 # https://jira.mongodb.org/browse/SERVER-32295 Patch1: python3-buildscripts-tests.patch +# Fix building with boost 1.66 +# https://jira.mongodb.org/browse/SERVER-32516 +Patch2: boost-1.66.patch + +# Few tests fail because of error in altivec implementation of ByteVector +# https://jira.mongodb.org/browse/SERVER-33395 +Patch3: ppc64le-fix-altivec.patch + # Fedora specific - adding support for rest of Fedora architectures # Upstream doesn't support it and isn't considering merging # # https://jira.mongodb.org/browse/SERVER-27833 # Enable ppc64 big endian support Patch20: ppc64.patch +Patch22: ppc64-altivec.patch # Add support also for 32bit platforms -# + set default storage engine for non 64-bit arches - RHBZ#1303846 Patch21: 32bit-support.patch -# Generate mozjs code for ppc64, arm and i386 arches +# Generate code for ppc64, arm and i386 arches Patch23: ppc64-arm-i386-mozjs-code.patch +# PowerEL patches +Patch100: mongodb-gcc485.patch +Patch101: mongodb-c11.patch + BuildRequires: gcc-c++ >= 5.3.0 BuildRequires: boost-devel >= 1.56 # Provides tcmalloc @@ -93,7 +106,6 @@ BuildRequires: snappy-devel BuildRequires: yaml-cpp-devel BuildRequires: zlib-devel BuildRequires: valgrind-devel -BuildRequires: libcurl-devel %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 BuildRequires: systemd %endif @@ -159,7 +171,7 @@ Provides: bundled(icu) = 57.1 Provides: bundled(IntelRDFPMathLib) = 20U1 # https://github.com/derickr/timelib Provides: bundled(timelib) = 2017.05beta10 -# MongoDB provides mozjs customization to recover from OOM +# MongoDB does provides mozjs customization to recover from OOM Provides: bundled(mozjs45) = 45.8.0 %description server @@ -184,11 +196,13 @@ the MongoDB sources. %prep %setup -q -n %{MONGO_DISTNAME} -%patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 # Patch only Fedora specific architectures %ifnarch %{upstream_arches} %patch20 -p1 +%patch22 -p1 %patch21 -p1 %patch23 -p1 @@ -196,12 +210,17 @@ the MongoDB sources. sed -i -e "/extract\/js\/src\/jit\/ProcessExecutableMemory.cpp/d" src/third_party/mozjs-45/SConscript %endif -# Workaround for https://jira.mongodb.org/browse/SERVER-37135 to make mongodb buildable with new openssl -sed -i "s|\(#ifdef TLS1_3_VERSION\)|#undef TLS1_3_VERSION\n\1|" src/mongo/util/net/ssl_manager_openssl.cpp +# PowerEL +%patch100 -p1 +%patch101 -p1 # CRLF -> LF sed -i 's/\r//' README +# Disable optimization for s2 library +# https://jira.mongodb.org/browse/SERVER-17511 +sed -i -r "s|(env.Append\(CCFLAGS=\['-DDEBUG_MODE=false')(\]\))|\1,'-O0'\2|" src/third_party/s2/SConscript + #TODO - removed unused bundles # Use system versions of header files (bundled does not differ) sed -i -r "s|third_party/libstemmer_c/include/libstemmer.h|libstemmer.h|" src/mongo/db/fts/stemmer.h @@ -216,12 +235,17 @@ sed -i -r "s|/data/db|%{_datadir}/%{pkg_name}-test/var|" buildscripts/resmokel sed -i -r "s|env python|env python3|" buildscripts/resmoke.py +# set default storage engine for non 64-bit arches - RHBZ#1303846 +%ifnarch %{upstream_arches} ppc64 +sed -i 's|engine = "wiredTiger"|engine = "mmapv1"|' src/mongo/db/storage/storage_options.h +%endif + %build -export LANG=C.UTF-8 +export LANG="en_US.UTF-8" # Prepare variables for building cat > variables.list << EOF -CCFLAGS="$(echo %{?optflags} | sed -e "s/-O. //" -e "s/-g //")" +CCFLAGS="$(echo %{?optflags} | sed -e "s/-O. //" -e "s/-g //") -fvisibility=hidden" LINKFLAGS="%{?__global_ldflags} -Wl,-z,noexecstack -Wl,--reduce-memory-overheads,--no-keep-memory" VERBOSE=1 MONGO_VERSION="%{version}" @@ -289,6 +313,7 @@ scons-3 unittests $(cat build-options) install -p -D -m 755 mongod %{buildroot}%{_bindir}/mongod install -p -D -m 755 mongos %{buildroot}%{_bindir}/mongos install -p -D -m 755 mongo %{buildroot}%{_bindir}/mongo +install -p -D -m 755 mongoperf %{buildroot}%{_bindir}/mongoperf install -p -D -m 755 mongobridge %{buildroot}%{_bindir}/mongobridge mkdir -p %{buildroot}%{_sharedstatedir}/%{pkg_name} @@ -317,6 +342,7 @@ sed -i -r "s|(engine: )mmapv1|\1wiredTiger|" %{buildroot}%{_sysconfdir}/%{daemon #TODO - create man page for mongobridge install -d -m 755 %{buildroot}%{_mandir}/man1 install -p -m 644 debian/mongo.1 %{buildroot}%{_mandir}/man1/ +install -p -m 644 debian/mongoperf.1 %{buildroot}%{_mandir}/man1/ install -p -m 644 debian/mongod.1 %{buildroot}%{_mandir}/man1/ install -p -m 644 debian/mongos.1 %{buildroot}%{_mandir}/man1/ @@ -354,7 +380,7 @@ done < ./build/unittests.txt %check -export LANG=C.UTF-8 +export LANG="en_US.UTF-8" %if %runselftest # More info about testing: # http://www.mongodb.org/about/contributors/tutorial/test-the-mongodb-server/ @@ -374,7 +400,6 @@ sed -i "/mongo_uri_test/d" build/unittests.txt #TODO %ifarch %{ix86} %{arm} sed -i "/service_entry_point_mock_test/d" build/unittests.txt -sed -i "/rs_rollback_test/d" build/unittests.txt # Crashing on armv7hl due to optimizations sed -i "/chunk_diff_test/d" build/unittests.txt %endif @@ -404,6 +429,11 @@ done rm -Rf ./var %endif +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + %pre server getent group %{pkg_name} >/dev/null || groupadd -f -g 184 -r %{pkg_name} @@ -461,14 +491,47 @@ if [ "$1" -ge 1 ] ; then fi +# Make rename of config files transparent and effortless +%triggerpostun server -- %{name}-server < 2.6.7-3 +if [ -f %{_sysconfdir}/sysconfig/%{daemon}.rpmnew ]; then + if [ -f %{_sysconfdir}/%{pkg_name}.conf.rpmsave ]; then + mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{daemon}.conf.rpmnew + mv %{_sysconfdir}/%{pkg_name}.conf.rpmsave %{_sysconfdir}/%{pkg_name}.conf + else + mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{pkg_name}.conf + fi +else + if [ -f %{_sysconfdir}/%{pkg_name}.conf.rpmsave ]; then + mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{daemon}.conf.rpmnew + mv %{_sysconfdir}/%{pkg_name}.conf.rpmsave %{_sysconfdir}/%{daemon}.conf + fi +fi + +if [ -f %{_sysconfdir}/sysconfig/%{daemonshard}.rpmnew ]; then + if [ -f %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave ]; then + mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{daemonshard}.conf.rpmnew + mv %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave %{_sysconfdir}/%{pkg_name}-shard.conf + else + mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{pkg_name}-shard.conf + fi +else + if [ -f %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave ]; then + mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{daemonshard}.conf.rpmnew + mv %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave %{_sysconfdir}/%{daemonshard}.conf + fi +fi + + %files %{!?_licensedir:%global license %%doc} %license GNU-AGPL-3.0.txt APACHE-2.0.txt %doc README %{_bindir}/mongo +%{_bindir}/mongoperf %{_bindir}/mongobridge %{_mandir}/man1/mongo.1* +%{_mandir}/man1/mongoperf.1* %files server @@ -503,42 +566,11 @@ fi %changelog -* Thu Dec 06 2018 mskalick@redhat.com - 4.0.3-3 +* Wed Dec 05 2018 mskalick@redhat.com - 3.6.6-2 - Fix bytecompilation and missing files in -test subpackage -* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek - 4.0.3-2 -- Use C.UTF-8 locale - See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot - -* Wed Oct 03 2018 panovotn@redhat.com - 4.0.3-1 -- Rebase to upstream release 4.0.3 - -* Tue Oct 02 2018 mskalick@redhat.com - 4.0.1-2 -- Don't force third_party/s2 to be built without optimizations. It's working - with new gcc. Using -O0 failed anobin checks. - -* Thu Aug 09 2018 mskalick@redhat.com - 4.0.1-1 -- Rebase to upstream release 4.0.1 - -* Fri Jul 13 2018 Fedora Release Engineering - 4.0.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Wed Jul 11 2018 mskalick@redhat.com - 4.0.0-4 -- Follow upstream suggestion about unittest_test - SERVER-35935 jira ticket - (-fvisibility=hidden is not needed anymore, because bundled mozjs is used on - all arches) - -* Wed Jul 11 2018 mskalick@redhat.com - 4.0.0-3 -- Fix default storage engine for 32b arches - -* Mon Jul 09 2018 Miro Hrončok - 4.0.0-2 -- Rebuilt for Python 3.7 - -* Mon Jun 25 2018 mskalick@redhat.com - 4.0.0-1 -- Rebase to latest upstream version 4.0.0 - -* Tue Jun 19 2018 Miro Hrončok - 3.6.4-4 -- Rebuilt for Python 3.7 +* Mon Aug 13 2018 mskalick@redhat.com - 3.6.6-1 +- Rebase to upstream release 3.6.6 * Fri Jun 08 2018 mskalick@redhat.com - 3.6.4-3 - Use bundled mozjs-45 on all architecture