summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-04-11 00:03:09 +0800
committerGitHub <[email protected]>2026-04-11 00:03:09 +0800
commit4dde60c71adf3de9b1c49f6f28bb235673846ae9 (patch)
treec66eca9484522394e999a758514588240d2f4d39
parent29d24c3e58848c1b12022d4805f916c717285c2a (diff)
parent39f685415d4398e3896a3f131f09902055457ce0 (diff)
Merge pull request #7467 from OpportunityLiu/patch-1
use option.boolean parse XMAKE_ROOT / XMAKE_STATS
-rw-r--r--core/xpack.lua9
-rw-r--r--xmake/core/main.lua2
-rw-r--r--xmake/modules/private/utils/statistics.lua2
3 files changed, 6 insertions, 7 deletions
diff --git a/core/xpack.lua b/core/xpack.lua
index a0288004a..0be853bc9 100644
--- a/core/xpack.lua
+++ b/core/xpack.lua
@@ -40,15 +40,14 @@ xpack("xmake")
else
local arch = package:arch()
local url_7z = "https://github.com/xmake-mirror/7zip/releases/download/24.08/7z24.08-" .. arch .. ".zip"
- local curl_version = "8.19.0_6"
- local curl_version_win32 = "8.14.1_1"
+ local curl_baseurl = "https://github.com/xmake-mirror/curl/releases/download/curl-8_19_0/curl-8.19.0_6"
local url_curl
if package:is_arch("x64", "x86_64") then
- url_curl = "https://curl.se/windows/dl-" .. curl_version .. "/curl-" .. curl_version .. "-win64-mingw.zip"
+ url_curl = curl_baseurl .. "-win64-mingw.zip"
elseif package:is_arch("arm64") then
- url_curl = "https://curl.se/windows/dl-" .. curl_version .. "/curl-" .. curl_version .. "-win64a-mingw.zip"
+ url_curl = curl_baseurl .. "-win64a-mingw.zip"
else
- url_curl = "https://curl.se/windows/dl-" .. curl_version_win32 .. "/curl-" .. curl_version_win32 .. "-win32-mingw.zip"
+ url_curl = curl_baseurl .. "-win32.zip"
end
local archive_7z = path.join(package:builddir(), "7z.zip")
local archive_curl = path.join(package:builddir(), "curl.zip")
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index 1c51342b9..f3ad904f5 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -258,7 +258,7 @@ end
-- limit root? @see https://github.com/xmake-io/xmake/pull/4513
function main._limit_root()
- return not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' and os.host() ~= 'haiku'
+ return not option.get("root") and option.boolean(os.getenv("XMAKE_ROOT")) ~= true and os.host() ~= 'haiku'
end
-- run task
diff --git a/xmake/modules/private/utils/statistics.lua b/xmake/modules/private/utils/statistics.lua
index 4672f4d82..990d9f7b7 100644
--- a/xmake/modules/private/utils/statistics.lua
+++ b/xmake/modules/private/utils/statistics.lua
@@ -32,7 +32,7 @@ function _is_enabled()
-- disable statistics? need not post it
local stats = (os.getenv("XMAKE_STATS") or ""):lower()
- if stats == "false" then
+ if option.boolean(stats) == false then
return false
end