diff options
| author | ruki <[email protected]> | 2021-01-01 22:53:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-01-01 22:53:21 +0800 |
| commit | c8c6c07c028c3ae4e047154194f42af2e2253595 (patch) | |
| tree | 5fe9fa658353b4c684e0f8c4258779785c83f0df /xmake/actions/require/impl/package.lua | |
| parent | 2bbcfe0d7ef3c1f081c05a899a0837d3e75ab77c (diff) | |
set display name for package
Diffstat (limited to 'xmake/actions/require/impl/package.lua')
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 15f3b7c59..8d7ffcfff 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -270,7 +270,7 @@ function _select_package_version(package, requireinfo) elseif has_giturl then -- select branch? version, source = require_version ~= "latest" and require_version or "master", "branches" else - raise("package(%s %s): not found!", package:requirepath(), require_version) + raise("package(%s %s): not found!", package:displayname(), require_version) end return version, source end @@ -293,7 +293,7 @@ function _check_package_configurations(package) if conf then local config_type = conf.type if config_type ~= nil and type(value) ~= config_type then - raise("package(%s %s): invalid type(%s) for config(%s), need type(%s)!", package:requirepath(), package:version_str(), type(value), name, config_type) + raise("package(%s %s): invalid type(%s) for config(%s), need type(%s)!", package:displayname(), package:version_str(), type(value), name, config_type) end if conf.values then local found = false @@ -304,16 +304,16 @@ function _check_package_configurations(package) end end if not found then - raise("package(%s %s): invalid value(%s) for config(%s), please run `xmake require --info %s` to get all valid values!", package:requirepath(), package:version_str(), value, name, package:name()) + raise("package(%s %s): invalid value(%s) for config(%s), please run `xmake require --info %s` to get all valid values!", package:displayname(), package:version_str(), value, name, package:name()) end end if conf.restrict then if not conf.restrict(value) then - raise("package(%s %s): invalid value(%s) for config(%s)!", package:requirepath(), package:version_str(), value, name) + raise("package(%s %s): invalid value(%s) for config(%s)!", package:displayname(), package:version_str(), value, name) end end else - raise("package(%s %s): invalid config(%s), please run `xmake require --info %s` to get all configurations!", package:requirepath(), package:version_str(), name, package:name()) + raise("package(%s %s): invalid config(%s), please run `xmake require --info %s` to get all configurations!", package:displayname(), package:version_str(), name, package:name()) end end end @@ -459,8 +459,8 @@ function _load_package(packagename, requireinfo, opt) -- save require info package:requireinfo_set(requireinfo) - -- save require path - package:requirepath_set(opt.requirepath) + -- save display name + package:displayname_set(opt.requirepath) -- add some builtin configurations to package _add_package_configurations(package) @@ -632,7 +632,7 @@ function _get_confirm(packages) end packages_group[group] = nil else - cprint(" ${yellow}->${clear} %s %s %s", package:requirepath(), package:version_str() or "", _get_package_status_str(package)) + cprint(" ${yellow}->${clear} %s %s %s", package:displayname(), package:version_str() or "", _get_package_status_str(package)) packages_showed[tostring(package)] = true end end @@ -757,11 +757,11 @@ function _install_packages(packages_install, packages_download) for _, index in ipairs(running_jobs_indices) do local package = packages_installing[index] if package then - table.insert(installing, package:requirepath()) + table.insert(installing, package:displayname()) end local package = packages_downloading[index] if package then - table.insert(downloading, package:requirepath()) + table.insert(downloading, package:displayname()) end end @@ -881,7 +881,7 @@ function install_packages(requires, opt) -- show tips cprint("${bright color.warning}note: ${clear}the following packages are unsupported for $(plat)/$(arch)!") for _, package in ipairs(packages_unsupported) do - print(" -> %s %s", package:requirepath(), package:version_str() or "") + print(" -> %s %s", package:displayname(), package:version_str() or "") end raise() end @@ -891,7 +891,7 @@ function install_packages(requires, opt) local packages_must = {} for _, package in ipairs(packages_install) do if not package:optional() then - table.insert(packages_must, package:requirepath()) + table.insert(packages_must, package:displayname()) end end if #packages_must > 0 then |
