diff options
| author | ruki <[email protected]> | 2026-02-19 22:39:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-19 22:39:41 +0800 |
| commit | 562cd7187775c7b7184cc7da5fffd0dcc77550d3 (patch) | |
| tree | 220676c0f290f4649cb99c0c3ce4a03e59db56bd /xmake/core/base/os.lua | |
| parent | a7e81f8efefb7d1a621d4a47bfa5208a761d7af4 (diff) | |
fix tmpdir for haiku
Diffstat (limited to 'xmake/core/base/os.lua')
| -rw-r--r-- | xmake/core/base/os.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index d20cd671a..d50ce19f2 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -768,15 +768,24 @@ function os.tmpdir(opt) -- get root tmpdir local tmpdir_root = nil if opt and opt.ramdisk == false then + tmpdir_root = os._ROOT_TMPDIR if os._ROOT_TMPDIR == nil then - os._ROOT_TMPDIR = (os.getenv("XMAKE_TMPDIR") or os.getenv("TMPDIR") or os._tmpdir()):trim() + tmpdir_root = (os.getenv("XMAKE_TMPDIR") or os.getenv("TMPDIR") or os._tmpdir()):trim() + -- TODO + if os.islink(tmpdir_root) then + tmpdir_root = os.readlink(tmpdir_root) or tmpdir_root + end + os._ROOT_TMPDIR = tmpdir_root end - tmpdir_root = os._ROOT_TMPDIR else + tmpdir_root = os._ROOT_TMPDIR_RAM if os._ROOT_TMPDIR_RAM == nil then - os._ROOT_TMPDIR_RAM = (os.getenv("XMAKE_TMPDIR") or os._ramdir() or os.getenv("TMPDIR") or os._tmpdir()):trim() + tmpdir_root = (os.getenv("XMAKE_TMPDIR") or os._ramdir() or os.getenv("TMPDIR") or os._tmpdir()):trim() + if os.islink(tmpdir_root) then + tmpdir_root = os.readlink(tmpdir_root) or tmpdir_root + end + os._ROOT_TMPDIR_RAM = tmpdir_root end - tmpdir_root = os._ROOT_TMPDIR_RAM end -- make sub-directory name |
