diff options
| author | ruki <[email protected]> | 2021-02-15 23:26:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-15 23:26:55 +0800 |
| commit | 42d99536a773f453720698cb791c95361fba8b9e (patch) | |
| tree | d017066dec8d8edd497385c540f06a5c123d3d69 | |
| parent | 7ee049f4dd018b0a0fc5288d7c95f95679cabea8 (diff) | |
fix register packages
| -rw-r--r-- | xmake/modules/private/action/require/impl/install_packages.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/register_packages.lua | 11 |
2 files changed, 7 insertions, 12 deletions
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index 946d3f8cb..7b472aeed 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -366,7 +366,7 @@ function main(requires, opt) -- load packages local packages = package.load_packages(requires, opt) - -- fetch packages (with system) from local first + -- fetch and register packages (with system) from local first runjobs("fetch_packages", function (index) local instance = packages[index] if instance and (not option.get("force") or (option.get("shallow") and instance:parents())) then @@ -376,6 +376,9 @@ function main(requires, opt) end end, {total = #packages}) + -- register all required root packages to local cache + register_packages(packages) + -- filter packages local packages_install = {} local packages_download = {} @@ -425,9 +428,6 @@ function main(requires, opt) -- install all required packages from repositories _install_packages(packages_install, packages_download) - -- register all required root packages to local cache - register_packages(packages) - -- disable other packages in same group _disable_other_packages_in_group(packages) return packages diff --git a/xmake/modules/private/action/require/impl/register_packages.lua b/xmake/modules/private/action/require/impl/register_packages.lua index 6d28eba07..9f3726868 100644 --- a/xmake/modules/private/action/require/impl/register_packages.lua +++ b/xmake/modules/private/action/require/impl/register_packages.lua @@ -113,19 +113,14 @@ end -- register all required root packages to local cache function main(packages) - local registered_packages = _g.registered_packages or {} for _, instance in ipairs(packages) do if not instance:parents() then local required_packagename = instance:alias() or instance:name() - if not registered_packages[required_packagename] then - local required_package = project.required_package(required_packagename) - if required_package then - _register_required_package(instance, required_package) - end - registered_packages[required_packagename] = instance + local required_package = project.required_package(required_packagename) + if required_package then + _register_required_package(instance, required_package) end end end - _g.registered_packages = registered_packages end |
