summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-09 15:04:05 +0200
committerwm4 <wm4@nowhere>2015-05-09 15:04:05 +0200
commit40997b8ae5b4065b3e71d4369eaba14c991e5027 (patch)
tree365a13f36387573b812475f652c42aeae562108b
parent2263f37dfb9faabfae9cbaf0c438ef35d1b764e2 (diff)
downloadmpv-40997b8ae5b4065b3e71d4369eaba14c991e5027.tar.bz2
mpv-40997b8ae5b4065b3e71d4369eaba14c991e5027.tar.xz
lua: remove deprecated "lua" sub directories
The compatibility code and the deprecation warning were at least in releases 0.8 and 0.9 - time to get rid of them.
-rw-r--r--player/lua.c14
-rw-r--r--player/scripting.c24
2 files changed, 9 insertions, 29 deletions
diff --git a/player/lua.c b/player/lua.c
index 4ef772fd84..8cfcd059a4 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -277,16 +277,10 @@ static void set_path(lua_State *L)
const char *path = lua_tostring(L, -1);
char *newpath = talloc_strdup(tmp, path ? path : "");
- char *dirs[] = {"scripts", "lua", NULL};
- for (int s = 0; dirs[s]; s++) {
- char **luadir = mp_find_all_config_files(tmp, get_mpctx(L)->global,
- dirs[s]);
- for (int i = 0; luadir && luadir[i]; i++) {
- // No need to display a warning for lua files in the deprecated
- // 'lua' dirs since scripting.c already warned on them
- newpath = talloc_asprintf_append(newpath, ";%s",
- mp_path_join(tmp, bstr0(luadir[i]), bstr0("?.lua")));
- }
+ char **luadir = mp_find_all_config_files(tmp, get_mpctx(L)->global, "scripts");
+ for (int i = 0; luadir && luadir[i]; i++) {
+ newpath = talloc_asprintf_append(newpath, ";%s",
+ mp_path_join(tmp, bstr0(luadir[i]), bstr0("?.lua")));
}
lua_pushstring(L, newpath); // package path newpath
diff --git a/player/scripting.c b/player/scripting.c
index 3747f50884..eafe568c56 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -192,25 +192,11 @@ void mp_load_scripts(struct MPContext *mpctx)
// Load all scripts
void *tmp = talloc_new(NULL);
- const char *dirs[] = {"scripts", "lua", NULL}; // 'lua' is deprecated
- int warning_displayed = 0;
- for (int s = 0; dirs[s]; s++) {
- char **scriptsdir = mp_find_all_config_files(tmp, mpctx->global, dirs[s]);
- for (int i = 0; scriptsdir && scriptsdir[i]; i++) {
- files = list_script_files(tmp, scriptsdir[i]);
- for (int n = 0; files && files[n]; n++) {
- if (s && !warning_displayed) {
- warning_displayed = 1;
- char *cfg = mp_find_config_file(tmp, mpctx->global, "");
- if (cfg)
- cfg = mp_path_join(tmp, bstr0(cfg), bstr0("scripts"));
- MP_WARN(mpctx, "Warning: '%s' - lua subdir is deprecated.\n"
- "Please move scripts to '%s'.\n",
- files[n], cfg ? cfg : "/scripts");
- }
- mp_load_script(mpctx, files[n]);
- }
- }
+ char **scriptsdir = mp_find_all_config_files(tmp, mpctx->global, "scripts");
+ for (int i = 0; scriptsdir && scriptsdir[i]; i++) {
+ files = list_script_files(tmp, scriptsdir[i]);
+ for (int n = 0; files && files[n]; n++)
+ mp_load_script(mpctx, files[n]);
}
talloc_free(tmp);
}