Skip to content

Commit 64910d0

Browse files
committed
OS (Linux): detect fedora variants
Fix #1830
1 parent 821462e commit 64910d0

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

src/detection/os/os_linux.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,21 @@ FF_MAYBE_UNUSED static bool detectDebianDerived(FFOSResult* result)
291291
return false;
292292
}
293293

294+
FF_MAYBE_UNUSED static bool detectFedoraVariant(FFOSResult* result)
295+
{
296+
if (ffStrbufEqualS(&result->variantID, "coreos")
297+
|| ffStrbufEqualS(&result->variantID, "kinoite")
298+
|| ffStrbufEqualS(&result->variantID, "sericea")
299+
|| ffStrbufEqualS(&result->variantID, "silverblue"))
300+
{
301+
ffStrbufAppendC(&result->id, '-');
302+
ffStrbufAppend(&result->id, &result->variantID);
303+
ffStrbufSetStatic(&result->idLike, "fedora");
304+
return true;
305+
}
306+
return false;
307+
}
308+
294309
static void detectOS(FFOSResult* os)
295310
{
296311
#ifdef FF_CUSTOM_OS_RELEASE_PATH
@@ -341,13 +356,15 @@ void ffDetectOSImpl(FFOSResult* os)
341356
detectOS(os);
342357

343358
#ifdef __linux__
344-
if(ffStrbufIgnCaseEqualS(&os->id, "ubuntu"))
359+
if(ffStrbufEqualS(&os->id, "ubuntu"))
345360
getUbuntuFlavour(os);
346-
else if(ffStrbufIgnCaseEqualS(&os->id, "debian"))
361+
else if(ffStrbufEqualS(&os->id, "debian"))
347362
{
348363
if (!detectDebianDerived(os))
349364
getDebianVersion(os);
350365
}
366+
else if(ffStrbufEqualS(&os->id, "fedora"))
367+
detectFedoraVariant(os);
351368
else if(ffStrbufEqualS(&os->id, "linuxmint"))
352369
{
353370
if (ffStrbufEqualS(&os->name, "LMDE"))

src/logo/builtin.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,8 +1771,7 @@ static const FFlogo F[] = {
17711771
},
17721772
// FedoraSilverblue
17731773
{
1774-
.names = {"Fedora_silverblue", "fedora-silverblue"},
1775-
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
1774+
.names = {"Fedora-Silverblue"},
17761775
.lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SILVERBLUE,
17771776
.colors = {
17781777
FF_COLOR_FG_BLUE,
@@ -1784,8 +1783,7 @@ static const FFlogo F[] = {
17841783
},
17851784
// FedoraKinoite
17861785
{
1787-
.names = {"Fedora_kinoite", "fedora-kinoite"},
1788-
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
1786+
.names = {"Fedora-Kinoite"},
17891787
.lines = FASTFETCH_DATATEXT_LOGO_FEDORA_KINOITE,
17901788
.colors = {
17911789
FF_COLOR_FG_BLUE,
@@ -1796,8 +1794,7 @@ static const FFlogo F[] = {
17961794
},
17971795
// FedoraSericea
17981796
{
1799-
.names = {"Fedora_sericea", "fedora-sericea"},
1800-
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
1797+
.names = {"Fedora-Sericea"},
18011798
.lines = FASTFETCH_DATATEXT_LOGO_FEDORA_SERICEA,
18021799
.colors = {
18031800
FF_COLOR_FG_BLUE,
@@ -1808,8 +1805,7 @@ static const FFlogo F[] = {
18081805
},
18091806
// FedoraCoreOS
18101807
{
1811-
.names = {"Fedora_coreos", "fedora-coreos"},
1812-
.type = FF_LOGO_LINE_TYPE_ALTER_BIT,
1808+
.names = {"Fedora-CoreOS"},
18131809
.lines = FASTFETCH_DATATEXT_LOGO_FEDORA_COREOS,
18141810
.colors = {
18151811
FF_COLOR_FG_BLUE,

0 commit comments

Comments
 (0)