Skip to content

Commit e70da53

Browse files
committed
Manjaro Linux proper identification
Co-authored-by: Lars Erik Wik <53906608+larsewi@users.noreply.github.com>
1 parent 1cf2be1 commit e70da53

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

libenv/sysinfo.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,12 @@ static void OSClasses(EvalContext *ctx)
13791379
SetFlavor(ctx, "gentoo");
13801380
}
13811381

1382-
if (stat("/etc/arch-release", &statbuf) != -1)
1382+
if (stat("/etc/manjaro-release", &statbuf) != -1)
1383+
{
1384+
Log(LOG_LEVEL_VERBOSE, "This appears to be a Manjaro Linux system.");
1385+
SetFlavor(ctx, "manjaro");
1386+
}
1387+
else if (stat("/etc/arch-release", &statbuf) != -1)
13831388
{
13841389
Log(LOG_LEVEL_VERBOSE, "This appears to be an Arch Linux system.");
13851390
SetFlavor(ctx, "archlinux");
@@ -3654,6 +3659,12 @@ static void SysOSNameHuman(EvalContext *ctx)
36543659
"Amazon", CF_DATA_TYPE_STRING,
36553660
"source=agent,derived-from=amazon_linux");
36563661
}
3662+
else if (EvalContextClassGet(ctx, NULL, "manjaro") != NULL)
3663+
{
3664+
EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_SYS, lval,
3665+
"Manjaro", CF_DATA_TYPE_STRING,
3666+
"source=agent,derived-from=manjaro");
3667+
}
36573668
else if (EvalContextClassGet(ctx, NULL, "arch") != NULL)
36583669
{
36593670
EvalContextVariablePutSpecial(ctx, SPECIAL_SCOPE_SYS, lval,

tests/acceptance/01_vars/02_functions/001.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ bundle agent test
3434
!darwin::
3535
"uid_bin" int => getuid("bin");
3636

37-
(linux.!archlinux.!SuSE.!redhat.!gentoo)|solaris|hpux|aix::
37+
(linux.!manjaro.!archlinux.!SuSE.!redhat.!gentoo)|solaris|hpux|aix::
3838
"num_root" int => "0";
3939
"num_daemon" int => "1";
4040
"num_bin" int => "2";
41-
archlinux|SuSE|redhat|gentoo::
41+
manjaro|archlinux|SuSE|redhat|gentoo::
4242
"num_root" int => "0";
4343
"num_daemon" int => "2";
4444
"num_bin" int => "1";

tests/acceptance/01_vars/02_functions/002.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ bundle agent test
4747
!linux.!freebsd.!solaris.!darwin.!openbsd.!hpux.!aix::
4848
"gid_0" string => "fixme";
4949

50-
archlinux|SuSE|redhat|gentoo::
50+
manjaro|archlinux|SuSE|redhat|gentoo::
5151
"num_daemon" int => "2";
52-
(linux.!archlinux.!SuSE.!redhat.!gentoo)|freebsd|darwin|openbsd::
52+
(linux.!manjaro.!archlinux.!SuSE.!redhat.!gentoo)|freebsd|darwin|openbsd::
5353
"num_daemon" int => "1";
5454
solaris::
5555
"num_daemon" int => "12";

tests/acceptance/02_classes/01_basic/expected_os_classes.cf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bundle agent check
2626
"hpux",
2727
"suse",
2828
"opensuse",
29+
"manjaro",
2930
"archlinux",
3031
"windows",
3132
"freebsd",

0 commit comments

Comments
 (0)