From 6e9d31d4fbce1d0e6d02ef5aa5740d6128e93ade Mon Sep 17 00:00:00 2001
From: rubenwardy <rw@rubenwardy.com>
Date: Sun, 8 May 2022 14:01:32 +0100
Subject: [PATCH] Fix mods not being recursively enabled

Fixes #12290
---
 builtin/mainmenu/pkgmgr.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua
index 6de671529..44f39ca60 100644
--- a/builtin/mainmenu/pkgmgr.lua
+++ b/builtin/mainmenu/pkgmgr.lua
@@ -487,7 +487,7 @@ function pkgmgr.enable_mod(this, toset)
 				-- Push the dependencies of the dependency onto the stack
 				local depends = pkgmgr.get_dependencies(mod_to_enable.path)
 				for i = 1, #depends do
-					if not enabled_mods[name] then
+					if not enabled_mods[depends[i]] then
 						sp = sp+1
 						to_enable[sp] = depends[i]
 					end