Skip to content

Commit a216bb5

Browse files
committed
update-download-data: accommodate for recent changes in Git for Windows
As of v2.49.0, Git for Windows no longer ships 32-bit (also known as "i686" or "Intel 32-bit") installers. However, Git for Windows started shipping ARM64 versions since v2.47.1. Let's accommodate for that by recording these artifacts, using the CPU architecture rather than merely the bitness (which would now be meaningless because both x64 and arm64 are 64-bit). Subsequent commits will consume these new data items. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 20f6eb1 commit a216bb5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

script/update-download-data.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DownloadData
1515
# name, version, url & date with Feedzirra
1616
SOURCEFORGE_URL = "https://sourceforge.net/projects/git-osx-installer/rss?limit=20"
1717

18-
GIT_FOR_WINDOWS_REGEX = /^(Portable|)Git-(\d+\.\d+\.\d+(?:\.\d+)?)-(?:.+-)*(32|64)-bit(?:\..*)?\.exe/
18+
GIT_FOR_WINDOWS_REGEX = /^(Portable|)Git-(\d+\.\d+\.\d+(?:\.\d+)?)-(?:.+-)*(64-bit|arm64)(?:\..*)?\.exe/
1919
GIT_FOR_WINDOWS_NAME_WITH_OWNER = "git-for-windows/git"
2020

2121
class << self
@@ -26,13 +26,14 @@ def sourceforge_project_download_url(project, filename)
2626
def update_download_windows_versions(config)
2727
files_from_github(GIT_FOR_WINDOWS_NAME_WITH_OWNER).each do |name, date, url|
2828
# Git for Windows uses the following naming system
29-
# [Portable]Git-#.#.#.#[-dev-preview]-32/64-bit[.7z].exe
29+
# [Portable]Git-#.#.#.#[-dev-preview]-64-bit/arm64[.7z].exe
3030
match = GIT_FOR_WINDOWS_REGEX.match(name)
3131

3232
next unless match
3333

3434
portable = match[1]
35-
bitness = match[3]
35+
architecture = match[3]
36+
architecture = "x64" if architecture == "64-bit"
3637

3738
# Git for windows sometimes creates extra releases all based off of the same upstream Git version
3839
# so we first want to crop versions like 2.16.1.4 to just 2.16.1
@@ -44,9 +45,9 @@ def update_download_windows_versions(config)
4445
config["windows_installer"] = {} if config["windows_installer"].nil?
4546
win_config = config["windows_installer"]
4647
if portable.empty?
47-
key = "installer#{bitness}"
48+
key = "installer_#{architecture}"
4849
else
49-
key = "portable#{bitness}"
50+
key = "portable_#{architecture}"
5051
end
5152
win_config[key] = {} if win_config[key].nil?
5253
return if version_compare(version, win_config[key]["version"]) < 0

0 commit comments

Comments
 (0)