From a32fb2908d0fe1e9c269a769e69efaa73f52fcfb Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 10 May 2017 11:52:53 +0100 Subject: [PATCH 1/5] Update the blacklist for unrequire When testing the unrequire tool on OpenOS 1.6.1, I found that it could unload things that broke OpenOS, so I used a process of elimination to find out what not to unload. It seems to work. --- unrequire.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unrequire.lua b/unrequire.lua index 1887cd0..6d780a0 100644 --- a/unrequire.lua +++ b/unrequire.lua @@ -9,6 +9,12 @@ local blacklist = { ["shell"] = true, ["package"] = true, ["process"] = true, + ["unicode"] = true, + ["computer"] = true, + ["component"] = true, + ["_G"] = true, + ["term"] = true, + ["keyboard"] = true } local function errprint(msg) From 679550a4ca6715477e49867d59494ed1ccc34d91 Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 10 May 2017 12:38:04 +0100 Subject: [PATCH 2/5] Add table to the unrequire blacklist I ran into this breaking things, kinda surprising considering that you don't need to require it. Anyway, since there's no way for OpenOS to find it again (even though it still exists), it's on the blacklist. --- unrequire.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unrequire.lua b/unrequire.lua index 6d780a0..762086d 100644 --- a/unrequire.lua +++ b/unrequire.lua @@ -14,7 +14,8 @@ local blacklist = { ["component"] = true, ["_G"] = true, ["term"] = true, - ["keyboard"] = true + ["keyboard"] = true, + ["table"] = true, } local function errprint(msg) From 73e0d3abfee118db93276ab0fc366bae87f763fe Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 10 May 2017 12:48:19 +0100 Subject: [PATCH 3/5] Added more things to the unrequire blacklist There won't be much benefit in requiring these anyway, they are built into Lua and so won't be re loadable from file and won't save any memory. --- unrequire.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unrequire.lua b/unrequire.lua index 762086d..efbc11d 100644 --- a/unrequire.lua +++ b/unrequire.lua @@ -16,8 +16,9 @@ local blacklist = { ["term"] = true, ["keyboard"] = true, ["table"] = true, + ["string"] = true, + ["math"] = true, } - local function errprint(msg) io.stderr:write(msg .. "\n") end From 908df30f6566740565c86927d3e0005a09dce770 Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 10 May 2017 20:09:46 +0100 Subject: [PATCH 4/5] Added more built-ins to the unrequire blacklist. Also removed term following @payonel's suggestion. (also this commit is a amended commit because I messed up last time) --- unrequire.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unrequire.lua b/unrequire.lua index efbc11d..f174f91 100644 --- a/unrequire.lua +++ b/unrequire.lua @@ -14,11 +14,16 @@ local blacklist = { ["component"] = true, ["_G"] = true, ["term"] = true, - ["keyboard"] = true, ["table"] = true, ["string"] = true, ["math"] = true, + ["debug"] = true, + ["os"] = true, + ["coroutine"] = true, + ["utf8"] = true, + ["bit32"] = true, } + local function errprint(msg) io.stderr:write(msg .. "\n") end From 3802fd4e99c7f090ceba5896265394bef37e4b49 Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 10 May 2017 21:01:57 +0100 Subject: [PATCH 5/5] Blacklist unloading keyboard rather than term Should fix the problem with key combinations not working. >_< --- unrequire.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unrequire.lua b/unrequire.lua index f174f91..a7001a4 100644 --- a/unrequire.lua +++ b/unrequire.lua @@ -13,7 +13,7 @@ local blacklist = { ["computer"] = true, ["component"] = true, ["_G"] = true, - ["term"] = true, + ["keyboard"] = true, ["table"] = true, ["string"] = true, ["math"] = true,