Skip to content

Commit 0263816

Browse files
keszybzbluca
authored andcommitted
sysusers: simplify meson config
There were two parts, for templated and non-templated files, and they were more different than they should be.
1 parent ecf8468 commit 0263816

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

sysusers.d/meson.build

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
22

3-
files = [['README', ''],
4-
['systemd-coredump.conf', 'ENABLE_COREDUMP'],
5-
['systemd-oom.conf', 'ENABLE_OOMD']]
3+
files = [['README', true],
4+
['systemd-coredump.conf', conf.get('ENABLE_COREDUMP') == 1],
5+
['systemd-oom.conf', conf.get('ENABLE_OOMD') == 1],
6+
['systemd-remote.conf', conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1]]
67

7-
foreach pair : files
8-
if not enable_sysusers
9-
# do nothing
10-
elif pair[1] == '' or conf.get(pair[1]) == 1
11-
install_data(pair[0], install_dir : sysusersdir)
12-
else
13-
message('Not installing sysusers.d/@0@ because @1@ is @2@'
14-
.format(pair[0], pair[1], conf.get(pair[1], 0)))
8+
foreach tuple : files
9+
if enable_sysusers and tuple[1]
10+
install_data(tuple[0], install_dir : sysusersdir)
1511
endif
1612
endforeach
1713

18-
19-
if enable_sysusers and conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
20-
install_data('systemd-remote.conf', install_dir : sysusersdir)
21-
endif
22-
23-
24-
in_files = [['basic.conf', enable_sysusers],
25-
['systemd-journal.conf', enable_sysusers],
26-
['systemd-network.conf', enable_sysusers and conf.get('ENABLE_NETWORKD') == 1],
27-
['systemd-resolve.conf', enable_sysusers and conf.get('ENABLE_RESOLVE') == 1],
28-
['systemd-timesync.conf', enable_sysusers and conf.get('ENABLE_TIMESYNCD') == 1]]
14+
in_files = [['basic.conf', true],
15+
['systemd-journal.conf', true],
16+
['systemd-network.conf', conf.get('ENABLE_NETWORKD') == 1],
17+
['systemd-resolve.conf', conf.get('ENABLE_RESOLVE') == 1],
18+
['systemd-timesync.conf', conf.get('ENABLE_TIMESYNCD') == 1]]
2919

3020
foreach tuple : in_files
3121
file = tuple[0]
@@ -34,6 +24,6 @@ foreach tuple : in_files
3424
input : file + '.in',
3525
output: file,
3626
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
37-
install : tuple[1],
27+
install : enable_sysusers and tuple[1],
3828
install_dir : sysusersdir)
3929
endforeach

0 commit comments

Comments
 (0)