build: use codeload for GitHub archive fallback
Switch archive tarball URL to codeload.github.com, which is typically more reliable than github.com/archive on flaky networks.
This commit is contained in:
parent
2a0e5c9f07
commit
0f4917bd56
|
|
@ -362,7 +362,12 @@ fetch_from_github_archive()
|
|||
[[ -n $ref_name ]] || return 1
|
||||
|
||||
local base=${upstream_url%.git}
|
||||
local tar_url="${base}/archive/refs/heads/${ref_name}.tar.gz"
|
||||
local gh_path=${base#https://github.com/}
|
||||
local gh_owner=${gh_path%%/*}
|
||||
local gh_repo=${gh_path#*/}
|
||||
gh_repo=${gh_repo%%/*}
|
||||
# Prefer codeload endpoint; it is often more reliable than github.com/archive.
|
||||
local tar_url="https://codeload.github.com/${gh_owner}/${gh_repo}/tar.gz/refs/heads/${ref_name}"
|
||||
local archive_dir="${EXTER}/cache/sources/.github-archives"
|
||||
local tar_path="${archive_dir}/$(basename "${base}")-${ref_name}.tar.gz"
|
||||
local tar_part="${tar_path}.part"
|
||||
|
|
|
|||
Loading…
Reference in New Issue