diff options
| author | ruki <[email protected]> | 2021-08-21 15:50:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-21 15:50:39 +0800 |
| commit | 03edbeb91a3b4e5d6d113949d433424497431613 (patch) | |
| tree | c28135ebfa884a45c2c1118aaf114d904a5a915f /xmake/modules/private/action/require/impl/lock_packages.lua | |
| parent | e8facd596d72db42a0a20233cde0d543d9384e9c (diff) | |
improve requireslock format
Diffstat (limited to 'xmake/modules/private/action/require/impl/lock_packages.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/lock_packages.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xmake/modules/private/action/require/impl/lock_packages.lua b/xmake/modules/private/action/require/impl/lock_packages.lua index c891d73cc..3eba5d00f 100644 --- a/xmake/modules/private/action/require/impl/lock_packages.lua +++ b/xmake/modules/private/action/require/impl/lock_packages.lua @@ -35,9 +35,6 @@ end function _lock_package(instance) local result = {} local repo = instance:repo() - result.name = instance:name() - result.plat = instance:plat() - result.arch = instance:arch() result.version = instance:version_str() result.buildhash = instance:buildhash() result.branch = instance:branch() @@ -56,12 +53,16 @@ end -- lock all required packages function main(packages) if project.policy("package.requires_lock") then + local plat = config.plat() or os.subhost() + local arch = config.arch() or so.subarch() + local key = plat .. "|" .. arch local results = os.isfile(project.requireslock()) and io.load(project.requireslock()) or {} results.__meta__ = results.__meta__ or {} results.__meta__.version = project.requireslock_version() + results[key] = {} for _, instance in ipairs(packages) do local packagelock_key = _get_packagelock_key(instance) - results[packagelock_key] = _lock_package(instance) + results[key][packagelock_key] = _lock_package(instance) end io.writefile(project.requireslock(), string.serialize(results, {orderkeys = true})) end |
