diff options
Diffstat (limited to 'blacklist-system-git2')
-rw-r--r-- | blacklist-system-git2 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/blacklist-system-git2 b/blacklist-system-git2 new file mode 100644 index 0000000..92d266c --- /dev/null +++ b/blacklist-system-git2 @@ -0,0 +1,21 @@ +-- -*- Lua -*- + +-- Our purpose is to blacklist the git2 module(s) found on the package +-- search path. We do that by loading an environment variable and then +-- wrappering the third searcher as necessary. + +function __gall_ll_git2_blacklister(f, ignoreme) + local type = type + local function replacement(modname) + local fret, fname = f(modname) + if type(fret) == "function" and fname == ignoreme then + return nil, "Blacklisted " .. fname .. "\n" + end + return fret, fname + end + return replacement +end + +for fname in (os.getenv("__GALL_LL_GIT2_BLACKLIST") or ""):gmatch("([^:]+)") do + package.searchers[3] = __gall_ll_git2_blacklister(package.searchers[3], fname) +end |