diff options
| author | ruki <[email protected]> | 2021-08-21 16:38:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-21 16:38:06 +0800 |
| commit | 5e73fb8a86de1a6e10739d3c348d40607942c165 (patch) | |
| tree | 1f3b9ebd4be2e2109462f2d108a6eed2e6bc9e8a /xmake/modules/private/action/require/impl | |
| parent | 8b3f30b4200b371e118bd31857d1d48c17b2969d (diff) | |
improve requirekey
Diffstat (limited to 'xmake/modules/private/action/require/impl')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/utils/requirekey.lua | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index d5d893658..55085d4f1 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -530,10 +530,8 @@ end -- get locked package key function _get_packagelock_key(requireinfo) - local plat = config.plat() or os.subhost() - local arch = config.arch() or os.subarch() local requirestr = requireinfo.originstr - local key = _get_requirekey(requireinfo, {hash = true, plat = plat, arch = arch}) + local key = _get_requirekey(requireinfo, {hash = true}) return string.format("%s#%s", requirestr, key) end @@ -648,7 +646,7 @@ function _load_package(packagename, requireinfo, opt) requireinfo.label = splitinfo[2] end - -- sve requirekey + -- save requirekey local requirekey = _get_packagelock_key(requireinfo) requireinfo.requirekey = requirekey diff --git a/xmake/modules/private/action/require/impl/utils/requirekey.lua b/xmake/modules/private/action/require/impl/utils/requirekey.lua index b07e4d50d..230a53acb 100644 --- a/xmake/modules/private/action/require/impl/utils/requirekey.lua +++ b/xmake/modules/private/action/require/impl/utils/requirekey.lua @@ -50,6 +50,9 @@ function main(requireinfo, opt) key = key .. ":" .. string.serialize(configs_order, true) end if opt.hash then + if key == "" then + key = "_" + end return hash.uuid(key):gsub("%-", ""):lower() else return key |
