From e724bb7018a482640c4f194f88b554af2c59d76e Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Wed, 20 Sep 2017 11:50:02 -0400 Subject: [PATCH] SERVER-30857 Support unknown Linux distributions --- src/mongo/rpc/metadata/client_metadata.cpp | 6 ------ src/mongo/util/processinfo_linux.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/mongo/rpc/metadata/client_metadata.cpp b/src/mongo/rpc/metadata/client_metadata.cpp index 845a315dd74..a959a4e31e9 100644 --- a/src/mongo/rpc/metadata/client_metadata.cpp +++ b/src/mongo/rpc/metadata/client_metadata.cpp @@ -302,9 +302,6 @@ void ClientMetadata::serializePrivate(StringData driverName, StringData osArchitecture, StringData osVersion, BSONObjBuilder* builder) { - invariant(!driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() && - !osArchitecture.empty() && !osVersion.empty()); - BSONObjBuilder metaObjBuilder(builder->subobjStart(kMetadataDocumentName)); { @@ -347,9 +344,6 @@ Status ClientMetadata::serializePrivate(StringData driverName, StringData osVersion, StringData appName, BSONObjBuilder* builder) { - invariant(!driverName.empty() && !driverVersion.empty() && !osType.empty() && !osName.empty() && - !osArchitecture.empty() && !osVersion.empty()); - if (appName.size() > kMaxApplicationNameByteLength) { return Status(ErrorCodes::ClientMetadataAppNameTooLarge, str::stream() << "The '" << kApplication << "." << kName diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp index c3debf377bd..c2813b026b0 100644 --- a/src/mongo/util/processinfo_linux.cpp +++ b/src/mongo/util/processinfo_linux.cpp @@ -376,10 +376,13 @@ class LinuxSysHelper { if ((nl = name.find('\n', nl)) != string::npos) // stop at first newline name.erase(nl); - // no standard format for name and version. use kernel version - version = "Kernel "; - version += LinuxSysHelper::readLineFromFile("/proc/sys/kernel/osrelease"); + } else { + name = "unknown"; } + + // There is no standard format for name and version so use the kernel version. + version = "Kernel "; + version += LinuxSysHelper::readLineFromFile("/proc/sys/kernel/osrelease"); } /** 200'>2020-05-22maint: Add "make check-channel-news"....* build-aux/check-channel-news.scm: New file. * Makefile.am (EXTRA_DIST): Add it. (check-channel-news): New phony rule. * doc/contributing.texi (Commit Access): Mention "make check-channel-news". Ludovic Courtès scm ("beautify-description: transform fragment into sentence"): Likewise. Change-Id: I0b12c4d94cb26cf62fab5b7cbf7885e66ff6c10f Signed-off-by: Ludovic Courtès <ludo@gnu.org> Herman Rimm 2023-05-31tests: Use quasiquoted 'match' patterns for package sexps....Turns out it's easier to read. * tests/cpan.scm ("cpan->guix-package"): Use a quasiquoted pattern. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/gem.scm ("gem->guix-package") ("gem->guix-package with a specific version") ("gem-recursive-import") ("gem-recursive-import with a specific version"): Likewise. * tests/hexpm.scm ("hexpm-recursive-import"): Likewise. * tests/opam.scm ("opam->guix-package"): Likewise. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. * tests/texlive.scm ("texlive->guix-package"): Likewise. Ludovic Courtès 2022-06-15import: Add hex.pm importer....hex.pm is a package repository for Erlang and Elixir. * guix/scripts/import.scm (importers): Add "hexpm". * guix/scripts/import/hexpm.scm, guix/import/hexpm.scm, guix/hexpm-download.scm: New files. * guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of fetch methods. * guix/upstream.scm (package-update/hexpm-fetch): New function. (%method-updates) Add it. * Makefile.am: Add them. Hartmut Goebel