Changeset View
Changeset View
Standalone View
Standalone View
files/0001-Support-a-stateless-configuration-on-nix-systems.patch
| From e5ad826988bd2f9ad5e9d33ddf973298f8f06c4e Mon Sep 17 00:00:00 2001 | From 84148b15f2ed8a29a8f6cbdc78ad9367536d1ce0 Mon Sep 17 00:00:00 2001 | ||||
| From: Ikey Doherty <ikey@solus-project.com> | From: Pierre-Yves <pyu@riseup.net> | ||||
| Date: Sat, 12 Mar 2016 13:48:00 +0000 | Date: Sat, 11 Aug 2018 00:09:46 +0200 | ||||
| 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. | ||||
| Signed-off-by: Ikey Doherty <ikey@solus-project.com> | Signed-off-by: Pierre-Yves <pyu@riseup.net> | ||||
| --- | --- | ||||
| osdep/path-unix.c | 12 ++++++++++-- | osdep/path-unix.c | 12 ++++++++++-- | ||||
| waftools/generators/headers.py | 1 + | waftools/generators/headers.py | 1 + | ||||
| wscript_build.py | 2 +- | wscript_build.py | 2 +- | ||||
| 3 files changed, 12 insertions(+), 3 deletions(-) | 3 files changed, 12 insertions(+), 3 deletions(-) | ||||
| diff --git a/osdep/path-unix.c b/osdep/path-unix.c | diff --git a/osdep/path-unix.c b/osdep/path-unix.c | ||||
| index d9a49ab..71466f4 100644 | index d9a49ab..71466f4 100644 | ||||
| Show All 33 Lines | @@ -28,6 +28,7 @@ def __add_mpv_defines__(ctx): | ||||
| from sys import argv | from sys import argv | ||||
| ctx.define("CONFIGURATION", " ".join(argv)) | ctx.define("CONFIGURATION", " ".join(argv)) | ||||
| ctx.define("MPV_CONFDIR", ctx.env.CONFLOADDIR) | ctx.define("MPV_CONFDIR", ctx.env.CONFLOADDIR) | ||||
| + ctx.define("MPV_SYSTEMCONFDIR", ctx.env.DATADIR + '/mpv') | + ctx.define("MPV_SYSTEMCONFDIR", ctx.env.DATADIR + '/mpv') | ||||
| ctx.define("FULLCONFIG", __escape_c_string(__get_features_string__(ctx))) | ctx.define("FULLCONFIG", __escape_c_string(__get_features_string__(ctx))) | ||||
| def configure(ctx): | def configure(ctx): | ||||
| diff --git a/wscript_build.py b/wscript_build.py | diff --git a/wscript_build.py b/wscript_build.py | ||||
| index 1bf67b0..190c9f8 100644 | index 4d974fd..e873ac2 100644 | ||||
| --- a/wscript_build.py | --- a/wscript_build.py | ||||
| +++ b/wscript_build.py | +++ b/wscript_build.py | ||||
| @@ -577,7 +577,7 @@ def build(ctx): | @@ -726,7 +726,7 @@ def build(ctx): | ||||
| ctx.env.DATADIR + '/applications', | |||||
| ['etc/mpv.desktop'] ) | ['etc/mpv.desktop'] ) | ||||
| if ctx.dependency_satisfied('encoding'): | |||||
| - ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] ) | - ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] ) | ||||
| + ctx.install_files(ctx.env.DATADIR + '/mpv', ['etc/encoding-profiles.conf'] ) | + ctx.install_files(ctx.env.DATADIR + '/mpv', ['etc/encoding-profiles.conf'] ) | ||||
| for size in '16x16 32x32 64x64'.split(): | for size in '16x16 32x32 64x64'.split(): | ||||
| ctx.install_as( | ctx.install_as( | ||||
| -- | -- | ||||
| 2.7.1 | 2.18.0 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.