Skip to content

Commit

Permalink
download correct package for arch
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Apr 3, 2023
1 parent ebee094 commit 8498027
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
// Match "arch", "archlinux", "manjaro", "manjarolinux", "arco", "arcolinux"
} else if (regexHelper(/(arch|manjaro|arco)(?:linux)?$/i, os)) {
console.warn(
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 20.04 release.`
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 22.04 release.`
);

return this.getUbuntuVersionString({
os: 'linux',
dist: 'Ubuntu Linux',
release: '20.04',
release: '22.04',
});
} else if (regexHelper(/gentoo/i, os)) {
// it seems like debian binaries work for gentoo too (at least most), see https://github.com/nodkz/mongodb-memory-server/issues/639
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ describe('MongoBinaryDownloadUrl', () => {
});

describe('getLinuxOSVersionString()', () => {
it('should give an warning about "alpine"', () => {
it('should give a warning about "alpine"', () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand All @@ -1704,7 +1704,7 @@ describe('MongoBinaryDownloadUrl', () => {
expect(ret).toBe('');
});

it('should give an warning about "unknown"', () => {
it('should give a warning about "unknown"', () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand All @@ -1723,6 +1723,24 @@ describe('MongoBinaryDownloadUrl', () => {
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
expect(ret).toBe('');
});

it('should give a warning about "arch"', () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '3.6.3',
os: {
os: 'linux',
dist: 'archlinux',
release: '0',
codename: 'archlinux',
},
});
const ret = du.getLinuxOSVersionString(du.os as LinuxOS);
expect(console.warn).toHaveBeenCalledTimes(1);
expect(ret).toBe('ubuntu1604');
});
});

describe('translateArch()', () => {
Expand Down

0 comments on commit 8498027

Please sign in to comment.