File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,20 @@ local foojay = {}
66local URL =
77" https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&lib_c_type=%s&release_status=ga&directly_downloadable=true"
88
9+ --- Detects the libc type on Linux systems (glibc or musl)
10+ --- @return string " glibc" or " musl"
11+ local function detect_lib_c_type ()
12+ local handle = io.popen (" ldd --version 2>&1" )
13+ if handle then
14+ local result = handle :read (" *a" )
15+ handle :close ()
16+ if result and result :lower ():find (" musl" ) then
17+ return " musl"
18+ end
19+ end
20+ return " glibc"
21+ end
22+
923foojay .fetchtJdkList = function (distribution , version )
1024
1125 local os = RUNTIME .osType
@@ -24,7 +38,7 @@ foojay.fetchtJdkList= function (distribution, version)
2438
2539 local lib_c_type = " "
2640 if os == " linux" then
27- lib_c_type = " glibc "
41+ lib_c_type = detect_lib_c_type ()
2842 end
2943
3044 -- Convert arm64 to aarch64 for foojay API compatibility
You can’t perform that action at this time.
0 commit comments