diff options
| author | ruki <[email protected]> | 2021-09-29 00:57:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-29 00:57:51 +0800 |
| commit | e582b4601a0821bf9a94ac1b568aff55c842131e (patch) | |
| tree | 604b747979da33afef73eda0a643849a2a8ca132 | |
| parent | b3a43699b3d8b8533910388eb9c489a00755d402 (diff) | |
improve package
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 876dabb9a..b048b7818 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -295,8 +295,8 @@ function _select_package_version(package, requireinfo, locked_requireinfo) return version, source end - -- exists urls? otherwise be phony package (only as package group) - if #package:urls() > 0 then + -- if not phony package (only as package group) + if not requireinfo.group then -- has git url? local has_giturl = false @@ -324,6 +324,11 @@ function _select_package_version(package, requireinfo, locked_requireinfo) if not version and has_giturl and not semver.is_valid(require_version) then -- select branch? version, source = require_version ~= "latest" and require_version or "master", "branch" end + -- local source package? we use a phony version + if not version and require_version == "latest" and #package:urls() == 0 then + version = "latest" + source = "version" + end if not version then raise("package(%s): version(%s) not found!", package:name(), require_version) end |
