diff options
| author | ruki <[email protected]> | 2021-01-14 22:42:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-14 22:42:34 +0800 |
| commit | 6f2c3e2543890c4b4e0d910eb93cbd26d5b4020f (patch) | |
| tree | a000297878310cd66ae90ce8da9203b0f9445687 | |
| parent | 3e71f67b9c4be2e3bd0531338d8177ce4734eaa3 (diff) | |
improve to checkout package git/version
| -rw-r--r-- | xmake/actions/require/impl/actions/download.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/require/info.lua | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/xmake/actions/require/impl/actions/download.lua b/xmake/actions/require/impl/actions/download.lua index 25243eaa9..fa7669b46 100644 --- a/xmake/actions/require/impl/actions/download.lua +++ b/xmake/actions/require/impl/actions/download.lua @@ -72,7 +72,7 @@ function _checkout(package, url, sourcedir, url_alias) git.clone(url, {outputdir = packagedir, recursive = true}) -- attempt to checkout the given version - git.checkout(package:revision(url_alias) or package:tag(), {repodir = packagedir}) + git.checkout(package:revision(url_alias) or package:tag() or package:version_str(), {repodir = packagedir}) end -- move to source directory diff --git a/xmake/actions/require/info.lua b/xmake/actions/require/info.lua index c5190a5fd..080436fe2 100644 --- a/xmake/actions/require/info.lua +++ b/xmake/actions/require/info.lua @@ -114,9 +114,14 @@ function main(requires_raw) cprint(" -> ${magenta}urls${clear}:") for _, url in ipairs(urls) do print(" -> %s", filter.handle(url, instance)) - local sourcehash = instance:sourcehash(instance:url_alias(url)) - if sourcehash then - cprint(" -> ${yellow}%s", sourcehash) + if git.asgiturl(url) then + local url_alias = instance:url_alias(url) + cprint(" -> ${yellow}%s", instance:revision(url_alias) or instance:tag() or instance:version_str()) + else + local sourcehash = instance:sourcehash(instance:url_alias(url)) + if sourcehash then + cprint(" -> ${yellow}%s", sourcehash) + end end end end |
