diff options
| author | ruki <[email protected]> | 2019-04-28 22:09:35 +0900 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-04-28 22:09:35 +0900 |
| commit | 43749aaefcce37ac729cfc995786612d124d2a3b (patch) | |
| tree | 3a0f09d61b2a129c3e5f0eb2d363f7ef7bb81944 /xmake/core/package/package.lua | |
| parent | c32d4b012063bb7dec09c2cd429be294e6e60c4a (diff) | |
fix on_install for package
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 314fbf9d6..9ee9cea58 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -667,14 +667,16 @@ function _instance:script(name, generic) local pattern = plat .. '|' .. arch for _pattern, _script in pairs(script) do local hosts = {} + local hosts_spec = false _pattern = _pattern:gsub("@(.+)", function (v) -- get and remove hosts for `android|armv7-a@macosx,linux` for _, host in ipairs(v:split(',')) do hosts[host] = true + hosts_spec = true end return "" end) - if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') and (#hosts == 0 or hosts[os.host()]) then + if not _pattern:startswith("__") and pattern:find('^' .. _pattern .. '$') and (not hosts_spec or hosts[os.host()]) then result = _script break end @@ -684,14 +686,16 @@ function _instance:script(name, generic) if result == nil then for _pattern, _script in pairs(script) do local hosts = {} + local hosts_spec = false _pattern = _pattern:gsub("@(.+)", function (v) -- get and remove hosts for `android@macosx,linux` for _, host in ipairs(v:split(',')) do hosts[host] = true + hosts_spec = true end return "" end) - if not _pattern:startswith("__") and plat:find('^' .. _pattern .. '$') and (#hosts == 0 or hosts[os.host()]) then + if not _pattern:startswith("__") and plat:find('^' .. _pattern .. '$') and (not hosts_spec or hosts[os.host()]) then result = _script break end |
