diff options
| -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 |
