diff options
| author | ruki <[email protected]> | 2020-11-04 22:45:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-04 22:45:20 +0800 |
| commit | 121b0e118edf589e3b0a6ef4947ef5339f340557 (patch) | |
| tree | cc48390e4b76e3f268280669ce9b0dc9d31577db | |
| parent | 82431e3210c48c08861d4e4c73dad4bda2ae4d7b (diff) | |
use subhost for script pattern
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/rule.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 2 | ||||
| -rw-r--r-- | xmake/repository/packages/7/7z/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/repository/packages/g/git/xmake.lua | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index e6f9738a2..684055038 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -791,7 +791,7 @@ function _instance:script(name, generic) end return "" end) - if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host() .. '|' .. os.arch()] or hosts[os.host()]) + if not _pattern:startswith("__") and (not hosts_spec or hosts[os.subhost() .. '|' .. os.subarch()] or hosts[os.subhost()]) and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then result = _script break diff --git a/xmake/core/project/rule.lua b/xmake/core/project/rule.lua index afd32f535..061cb046e 100644 --- a/xmake/core/project/rule.lua +++ b/xmake/core/project/rule.lua @@ -273,7 +273,7 @@ function rule:script(name, generic) end return "" end) - if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host() .. '|' .. os.arch()] or hosts[os.host()]) + if not _pattern:startswith("__") and (not hosts_spec or hosts[os.subhost() .. '|' .. os.subarch()] or hosts[os.subhost()]) and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then result = _script break diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 8ab8894a6..69e6e4068 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1565,7 +1565,7 @@ function _instance:script(name, generic) end return "" end) - if not _pattern:startswith("__") and (not hosts_spec or hosts[os.host() .. '|' .. os.arch()] or hosts[os.host()]) + if not _pattern:startswith("__") and (not hosts_spec or hosts[os.subhost() .. '|' .. os.subarch()] or hosts[os.subhost()]) and (_pattern:trim() == "" or (plat .. '|' .. arch):find('^' .. _pattern .. '$') or plat:find('^' .. _pattern .. '$')) then result = _script break diff --git a/xmake/repository/packages/7/7z/xmake.lua b/xmake/repository/packages/7/7z/xmake.lua index ff67544ad..b3edea725 100644 --- a/xmake/repository/packages/7/7z/xmake.lua +++ b/xmake/repository/packages/7/7z/xmake.lua @@ -31,7 +31,7 @@ package("7z") os.cp("bin", package:installdir()) end) - on_install("@windows", function (package) + on_install("@windows", "@msys", "@cygwin", function (package) os.cp("*", package:installdir("bin")) end) diff --git a/xmake/repository/packages/g/git/xmake.lua b/xmake/repository/packages/g/git/xmake.lua index d3c6c08b4..8833ce20c 100644 --- a/xmake/repository/packages/g/git/xmake.lua +++ b/xmake/repository/packages/g/git/xmake.lua @@ -24,7 +24,7 @@ package("git") end end - on_load("@windows", function (package) + on_load("@windows", "@msys", "@cygwin", function (package) package:addenv("PATH", path.join("share", "MinGit", "mingw32", "bin")) package:addenv("PATH", path.join("share", "MinGit", "cmd")) end) @@ -33,7 +33,7 @@ package("git") import("package.manager.install_package")("git") end) - on_install("@windows", function (package) + on_install("@windows", "@msys", "@cygwin", function (package) os.cp("*", package:installdir("share/MinGit")) end) |
