From baf063548ce4fcbe5fdb7029fa7caac90a9db9b9 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Wed, 16 Nov 2022 18:29:57 +0100 Subject: Fix package:parens_add overwriting if another instance of the package exists --- xmake/core/package/package.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xmake/core/package/package.lua') 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 -- cgit v1.3.1