diff options
| author | SirLynix <[email protected]> | 2022-11-16 18:29:57 +0100 |
|---|---|---|
| committer | SirLynix <[email protected]> | 2022-11-16 18:29:57 +0100 |
| commit | baf063548ce4fcbe5fdb7029fa7caac90a9db9b9 (patch) | |
| tree | 9c2bad7bf5a7d11d3ef55352096206bb867765c9 /xmake/core/package/package.lua | |
| parent | 6db72d791606f3093d8c593a28464052eae7019c (diff) | |
Fix package:parens_add overwriting if another instance of the package exists
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 4bb80ebd5..57f7c1b78 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -390,9 +390,14 @@ end -- add parents function _instance:parents_add(...) + self._PARENTS = self._PARENTS or {} for _, parent in ipairs({...}) do - self._PARENTS = self._PARENTS or {} - self._PARENTS[parent:name()] = parent + local parentpkgs = self._PARENTS[parent:name()] + if not parentpkgs then + parentpkgs = {} + self._PARENTS[parent:name()] = parentpkgs + end + table.insert(parentpkgs, parent) end end |
