Changeset View
Changeset View
Standalone View
Standalone View
files/0001-Support-a-stateless-configuration-on-nix-systems.patch
| From 79d74229599a2ea9e28c4130da92c58cdb478b41 Mon Sep 17 00:00:00 2001 | From f4905dde040fecf1ee3e30faee14205fc9603b03 Mon Sep 17 00:00:00 2001 | ||||
| From: Alexander Vorobyev <avorobyev@protonmail.com> | From: Alexander Vorobyev <avorobyev@protonmail.com> | ||||
| Date: Mon, 12 Dec 2022 15:44:33 +0300 | Date: Mon, 12 Dec 2022 15:44:33 +0300 | ||||
| Subject: [PATCH] Support a stateless configuration on *nix systems | Subject: [PATCH] Support a stateless configuration on *nix systems | ||||
| Using a stateless configuration, the often-untouched files in /etc/, which | Using a stateless configuration, the often-untouched files in /etc/, which | ||||
| should be considered for local system administrator overrides, are no longer | should be considered for local system administrator overrides, are no longer | ||||
| shipped on *nix systems. | shipped on *nix systems. | ||||
| Instead, we ship them in a global read-only location on the filesystem, i.e. | Instead, we ship them in a global read-only location on the filesystem, i.e. | ||||
| /usr/share/mpv/. This not only allows vendors to provide pre-defined configs | /usr/share/mpv/. This not only allows vendors to provide pre-defined configs | ||||
| for mpv, it allows the user to override the given defaults using the old | for mpv, it allows the user to override the given defaults using the old | ||||
| /etc/mpv tree, whilst freeing them from upgrade conflicts. | /etc/mpv tree, whilst freeing them from upgrade conflicts. | ||||
| With this change, a "factory reset" of the mpv configuration is as simple as | With this change, a "factory reset" of the mpv configuration is as simple as | ||||
| doing an "rm -rf /etc/mpv", and ensures there are no "three-way merges" on | doing an "rm -rf /etc/mpv", and ensures there are no "three-way merges" on | ||||
| configuration files during system updates, which can often lead to undesirable | configuration files during system updates, which can often lead to undesirable | ||||
| side-effects. | side-effects. | ||||
| --- | --- | ||||
| meson.build | 3 ++- | meson.build | 3 ++- | ||||
| osdep/path-unix.c | 12 ++++++++++-- | osdep/path-unix.c | 12 ++++++++++-- | ||||
| 2 files changed, 12 insertions(+), 3 deletions(-) | 2 files changed, 12 insertions(+), 3 deletions(-) | ||||
| diff --git a/meson.build b/meson.build | diff --git a/meson.build b/meson.build | ||||
| index af4a6bcd97..a756745d08 100644 | index acaa39f764..90e4286610 100644 | ||||
| --- a/meson.build | --- a/meson.build | ||||
| +++ b/meson.build | +++ b/meson.build | ||||
| @@ -1625,6 +1625,7 @@ sys.stdout.write(features) | @@ -1626,6 +1626,7 @@ sys.stdout.write(features) | ||||
| feature_str = run_command(python, '-c', feature_sort, feature_keys, check: true).stdout() | feature_str = run_command(python, '-c', feature_sort, feature_keys, check: true).stdout() | ||||
| conf_data.set_quoted('FULLCONFIG', feature_str) | conf_data.set_quoted('FULLCONFIG', feature_str) | ||||
| conf_data.set_quoted('MPV_CONFDIR', join_paths(get_option('sysconfdir'), 'mpv')) | conf_data.set_quoted('MPV_CONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpv')) | ||||
| +conf_data.set_quoted('MPV_SYSTEMCONFDIR', join_paths(get_option('datadir'), 'mpv')) | +conf_data.set_quoted('MPV_SYSTEMCONFDIR', join_paths(get_option('prefix'), get_option('datadir'), 'mpv')) | ||||
| configure_file(output : 'config.h', configuration : conf_data) | configure_file(output : 'config.h', configuration : conf_data) | ||||
| message('List of enabled features: ' + feature_str) | message('List of enabled features: ' + feature_str) | ||||
| @@ -1684,7 +1685,7 @@ if get_option('cplayer') | @@ -1685,7 +1686,7 @@ if get_option('cplayer') | ||||
| install_data('etc/mpv.desktop', install_dir: join_paths(datadir, 'applications')) | install_data('etc/mpv.desktop', install_dir: join_paths(datadir, 'applications')) | ||||
| install_data('etc/mpv.metainfo.xml', install_dir: join_paths(datadir, 'metainfo')) | install_data('etc/mpv.metainfo.xml', install_dir: join_paths(datadir, 'metainfo')) | ||||
| - install_data('etc/encoding-profiles.conf', install_dir: join_paths(confdir, 'mpv')) | - install_data('etc/encoding-profiles.conf', install_dir: join_paths(confdir, 'mpv')) | ||||
| + install_data('etc/encoding-profiles.conf', install_dir: join_paths(datadir, 'mpv')) | + install_data('etc/encoding-profiles.conf', install_dir: join_paths(datadir, 'mpv')) | ||||
| foreach size: ['16x16', '32x32', '64x64', '128x128'] | foreach size: ['16x16', '32x32', '64x64', '128x128'] | ||||
| icon_dir = join_paths(datadir, 'icons', 'hicolor', size, 'apps') | icon_dir = join_paths(datadir, 'icons', 'hicolor', size, 'apps') | ||||
| Show All 23 Lines | |||||
| + } else { | + } else { | ||||
| + return MPV_SYSTEMCONFDIR; | + return MPV_SYSTEMCONFDIR; | ||||
| + } | + } | ||||
| + } | + } | ||||
| if (strcmp(type, "desktop") == 0) | if (strcmp(type, "desktop") == 0) | ||||
| return getenv("HOME"); | return getenv("HOME"); | ||||
| return NULL; | return NULL; | ||||
| -- | -- | ||||
| 2.35.5 | 2.39.0 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.