commit: bc99265637446283620eed378bd77cc540566c83
Author: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 20 05:45:52 2023 +0000
Commit: Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Wed Dec 20 05:45:52 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc992656
app-misc/fastfetch: make `.jsonc` suffix optional
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>
...etch-2.4.0.ebuild => fastfetch-2.4.0-r1.ebuild} | 4 +++
.../fastfetch-2.4.0-default-config-suffix.patch | 35 ++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/app-misc/fastfetch/fastfetch-2.4.0.ebuild
b/app-misc/fastfetch/fastfetch-2.4.0-r1.ebuild
similarity index 98%
rename from app-misc/fastfetch/fastfetch-2.4.0.ebuild
rename to app-misc/fastfetch/fastfetch-2.4.0-r1.ebuild
index 4af72e9b74c7..4590e479070b 100644
--- a/app-misc/fastfetch/fastfetch-2.4.0.ebuild
+++ b/app-misc/fastfetch/fastfetch-2.4.0-r1.ebuild
@@ -62,6 +62,10 @@ REQUIRED_USE="
chafa? ( imagemagick )
"
+PATCHES=(
+ "${FILESDIR}"/${P}-default-config-suffix.patch
+)
+
src_configure() {
local fastfetch_enable_imagemagick7=no
local fastfetch_enable_imagemagick6=no
diff --git
a/app-misc/fastfetch/files/fastfetch-2.4.0-default-config-suffix.patch
b/app-misc/fastfetch/files/fastfetch-2.4.0-default-config-suffix.patch
new file mode 100644
index 000000000000..fcf21ce0af23
--- /dev/null
+++ b/app-misc/fastfetch/files/fastfetch-2.4.0-default-config-suffix.patch
@@ -0,0 +1,35 @@
+Make specifying `.jsonc` suffix for configs optional
+
+https://github.com/fastfetch-cli/fastfetch/commit/456a58c8f57aaf22c51571ec0ead1e7c40c3d860
+
+From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= <[email protected]>
+Date: Tue, 19 Dec 2023 15:26:51 +0800
+Subject: [PATCH] fastfetch: default preset names to `.jsonc`
+
+Fix #666
+--- a/src/fastfetch.c
++++ b/src/fastfetch.c
+@@ -501,6 +501,11 @@ static void optionParseConfigFile(FFdata* data, const
char* key, const char* val
+ ffStrbufAppendS(&absolutePath, value);
+
+ bool success = isJsonConfig ? parseJsoncFile(absolutePath.chars) :
parseConfigFile(data, absolutePath.chars);
++ if (!success)
++ {
++ ffStrbufAppendS(&absolutePath, ".jsonc");
++ success = parseJsoncFile(absolutePath.chars);
++ }
+
+ if(success)
+ return;
+@@ -514,6 +519,11 @@ static void optionParseConfigFile(FFdata* data, const
char* key, const char* val
+ ffStrbufAppendS(&absolutePath, value);
+
+ bool success = isJsonConfig ? parseJsoncFile(absolutePath.chars) :
parseConfigFile(data, absolutePath.chars);
++ if (!success)
++ {
++ ffStrbufAppendS(&absolutePath, ".jsonc");
++ success = parseJsoncFile(absolutePath.chars);
++ }
+
+ if(success)
+ return;