Skip to content

Commit 94c132a

Browse files
committed
getMissingDeployments(): fix msys-runtime assumptions
We no longer deploy `msys2-runtime` for i686 (because it is no longer supported by Cygwin). Instead, we deploy `msys2-runtime-3.3` for i686 (but not for x86_64). Let's teach GitForWindowsHelper about these subtleties. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 886fa32 commit 94c132a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

GitForWindowsHelper/component-updates.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ const getMissingDeployments = async (package_name, version) => {
121121
// MinTTY is at epoch 1, which is part of Pacman's versioning scheme
122122
if (package_name === 'mintty') version = `1~${version}`
123123
const architectures = ['i686', 'x86_64']
124+
if (package_name === 'msys2-runtime') architectures.shift()
125+
else if (package_name === 'msys2-runtime-3.3') architectures.pop()
124126

125127
const urls = []
126128
const msysName = package_name.replace(/^mingw-w64-/, '')

__tests__/component-updates.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,17 @@ http://www.gnutls.org/news.html#2023-02-10`
132132
test('getMissingDeployments()', async () => {
133133
const missingURL = 'https://wingit.blob.core.windows.net/x86-64/curl-8.1.2-1-x86_64.pkg.tar.xz'
134134
const missingMinTTYURL = 'https://wingit.blob.core.windows.net/i686/mintty-1~3.6.5-1-i686.pkg.tar.xz'
135-
const mockDoesURLReturn404 = jest.fn(url => url === missingURL || url === missingMinTTYURL)
135+
const bogus32BitMSYS2RuntimeURL = 'https://wingit.blob.core.windows.net/i686/msys2-runtime-3.4.9-1-i686.pkg.tar.xz'
136+
const bogus64BitMSYS2RuntimeURL = 'https://wingit.blob.core.windows.net/x86-64/msys2-runtime-3.3-3.3.7-1-x86_64.pkg.tar.xz'
137+
const mockDoesURLReturn404 = jest.fn(url => [
138+
missingURL, missingMinTTYURL, bogus32BitMSYS2RuntimeURL, bogus64BitMSYS2RuntimeURL
139+
].includes(url))
136140
jest.mock('../GitForWindowsHelper/https-request', () => {
137141
return { doesURLReturn404: mockDoesURLReturn404 }
138142
})
139143

140144
expect(await getMissingDeployments('curl', '8.1.2')).toEqual([missingURL])
141145
expect(await getMissingDeployments('mintty', '3.6.5')).toEqual([missingMinTTYURL])
146+
expect(await getMissingDeployments('msys2-runtime', '3.4.9')).toEqual([])
147+
expect(await getMissingDeployments('msys2-runtime-3.3', '3.3.7')).toEqual([])
142148
})

0 commit comments

Comments
 (0)