From df758880e26ccdb084e2ad9dd33d8c1835ac4a3f Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 2 Oct 2023 13:14:52 +0200 Subject: path: don't override "cache" and "state" paths with configdir This reverts commit 576e86bfa18a0a79e591988ad93ed009edc40849 (functionally). Right now, the --config-dir option silently causes all watch_later and cache files to be written in the --config-dir as well. This is pretty uninitutive and also not desirable in most cases so get rid of this. libmpv users will have to set the corresponding options or env vars if they want to keep the old behaviour. --- DOCS/interface-changes.rst | 1 + DOCS/man/options.rst | 3 +++ options/path.c | 10 ---------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 304d610108..9c7d69487a 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -95,6 +95,7 @@ Interface changes - deprecate shared-script-properties (user-data is a replacement) - add `--backdrop-type` option - add `--window-affinity` option + - `--config-dir` no longer forces cache and state files to also reside in there --- mpv 0.36.0 --- - add `--target-contrast` - Target luminance value is now also applied when ICC profile is used. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index bc7425d9ea..a9c8687e4f 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -763,6 +763,9 @@ Program Behavior as well as per-user directories are ignored, and overrides through environment variables (``MPV_HOME``) are also ignored. + Note that the cache and state paths (``~~/cache``, ``~~/state``) are not + considered "configuration" and keep their auto-detection logic. + Note that the ``--no-config`` option takes precedence over this option. ``--dump-stats=`` diff --git a/options/path.c b/options/path.c index c4fdc863a0..581874b94b 100644 --- a/options/path.c +++ b/options/path.c @@ -64,12 +64,6 @@ static const char *const config_dirs[] = { "exe_dir", "global", }; -// types that configdir replaces (if set) -// These are not part of any fallback order so need to be overriden separately. -static const char *const config_dir_replaces[] = { - "state", - "cache", -}; // Return a platform specific path using a path type as defined in osdep/path.h. // Keep in mind that the only way to free the return value is freeing talloc_ctx @@ -86,10 +80,6 @@ static const char *mp_get_platform_path(void *talloc_ctx, if (strcmp(config_dirs[n], type) == 0) return (n == 0 && global->configdir[0]) ? global->configdir : NULL; } - for (int n = 0; n < MP_ARRAY_SIZE(config_dir_replaces); n++) { - if (strcmp(config_dir_replaces[n], type) == 0) - return global->configdir[0] ? global->configdir : NULL; - } } // Return the native config path if the platform doesn't support the -- cgit v1.2.3