From 15b75eed19d9ecca0f9fae2b928e50304c309936 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 16 Aug 2023 14:57:48 +0300 Subject: [PATCH] fix: Fix binary download on debian testing/unstable VERSION_ID was removed. See e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008735 --- .../src/util/MongoBinaryDownloadUrl.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts index e0721f98c..d06a445b7 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts @@ -289,7 +289,9 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts { throw new UnknownVersionError(this.version); } - if (release >= 11 || ['unstable', 'testing'].includes(os.release)) { + const isTesting = ['unstable', 'testing', ''].includes(os.release); + + if (isTesting || release >= 11) { // Debian 11 is compatible with the binaries for debian 10 // but does not have binaries for before 5.0.8 // and only set to use "debian10" if the requested version is not a latest version @@ -309,7 +311,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts { name += '71'; } - if (release >= 10) { + if (isTesting || release >= 10) { if (semver.lt(coercedVersion, '4.2.1') && !testVersionIsLatest(this.version)) { throw new KnownVersionIncompatibilityError( `Debian ${release}`,