diff options
| author | ruki <[email protected]> | 2021-08-18 00:54:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-18 00:54:38 +0800 |
| commit | cfcd21ce456c3597573dd2f2324b236d4a84fcdd (patch) | |
| tree | 3980fab6583b2f718fd232030c03a2a9ebe98055 | |
| parent | 723dca1ac294cccd66f5b3dd0661299fd197f476 (diff) | |
lock version
3 files changed, 20 insertions, 6 deletions
diff --git a/tests/projects/package/toolchain_muslcc/xmake-requires.lock b/tests/projects/package/toolchain_muslcc/xmake-requires.lock index 5ae48eeb9..5aa0c0e2e 100644 --- a/tests/projects/package/toolchain_muslcc/xmake-requires.lock +++ b/tests/projects/package/toolchain_muslcc/xmake-requires.lock @@ -12,8 +12,8 @@ repo = "https://gitee.com/tboox/xmake-repo.git#e87effa464611cecf28dfced70cbe491a08fe99d", urls = { "https://mirrors.ustc.edu.cn/gnu/autoconf/autoconf-2.69.tar.gz#954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969", - "git://git.sv.gnu.org/autoconf#2.69", - "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz#954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969" + "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz#954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969", + "git://git.sv.gnu.org/autoconf#2.69" }, version = "2.69" }, @@ -127,8 +127,8 @@ repo = "https://gitee.com/tboox/xmake-repo.git#e87effa464611cecf28dfced70cbe491a08fe99d", urls = { "https://mirrors.ustc.edu.cn/gnu/libtool/libtool-2.4.6.tar.gz#e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3", - "http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz#e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3", - "git://git.savannah.gnu.org/libtool.git#2.4.6" + "git://git.savannah.gnu.org/libtool.git#2.4.6", + "http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz#e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" }, version = "2.4.6" }, diff --git a/xmake/modules/private/action/require/impl/lock_packages.lua b/xmake/modules/private/action/require/impl/lock_packages.lua index 7640e7562..e11916db6 100644 --- a/xmake/modules/private/action/require/impl/lock_packages.lua +++ b/xmake/modules/private/action/require/impl/lock_packages.lua @@ -46,6 +46,8 @@ function _lock_package(instance) result.version = instance:version_str() result.buildhash = instance:buildhash() result.is_built = instance:is_built() + result.branch = instance:branch() + result.tag = instance:tag() if repo then local lastcommit = git.lastcommit({repodir = repo:directory()}) result.repo = repo:url() .. "#" .. lastcommit diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index fb84dea5f..627d5e70e 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -269,7 +269,19 @@ function _add_package_configurations(package) end -- select package version -function _select_package_version(package, requireinfo) +function _select_package_version(package, requireinfo, locked_requireinfo) + + -- get it from the locked requireinfo + if locked_requireinfo then + local version = locked_requireinfo.version + local source = "version" + if locked_requireinfo.branch then + source = "branch" + elseif locked_requireinfo.tag then + source = "tag" + end + return version, source + end -- exists urls? otherwise be phony package (only as package group) if #package:urls() > 0 then @@ -675,7 +687,7 @@ function _load_package(packagename, requireinfo, opt) end -- select package version - local version, source = _select_package_version(package, requireinfo) + local version, source = _select_package_version(package, requireinfo, locked_requireinfo) if version then package:version_set(version, source) end |
