forked from systemd/systemd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson: use jinja2 for unit templates
We don't need two (and half) templating systems anymore, yay! I'm keeping the changes minimal, to make the diff manageable. Some enhancements due to a better templating system might be possible in the future. For handling of '## ' — see the next commit.
- Loading branch information
Showing
65 changed files
with
133 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,13 +165,18 @@ units = [ | |
] | ||
|
||
in_units = [ | ||
['console-getty.service', ''], | ||
['[email protected]', ''], | ||
['debug-shell.service', ''], | ||
['emergency.service', ''], | ||
['[email protected]', '', | ||
'[email protected]'], | ||
['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES', | ||
'sysinit.target.wants/'], | ||
['quotaon.service', 'ENABLE_QUOTACHECK'], | ||
['rc-local.service', 'HAVE_SYSV_COMPAT'], | ||
['rescue.service', ''], | ||
['[email protected]', ''], | ||
['[email protected]', 'ENABLE_BACKLIGHT'], | ||
['systemd-binfmt.service', 'ENABLE_BINFMT', | ||
'sysinit.target.wants/'], | ||
|
@@ -247,14 +252,6 @@ in_units = [ | |
['[email protected]', ''], | ||
] | ||
|
||
m4_units = [ | ||
['console-getty.service', ''], | ||
['[email protected]', ''], | ||
['[email protected]', '', | ||
'[email protected] '], | ||
['[email protected]', ''], | ||
] | ||
|
||
add_wants = [] | ||
|
||
foreach tuple : in_units | ||
|
@@ -265,15 +262,11 @@ foreach tuple : in_units | |
install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and | ||
(conds.get(1, '') == '' or conf.get(conds[1]) == 1)) | ||
|
||
gen1 = configure_file( | ||
input : file + '.in', | ||
output : file + '.tmp', | ||
configuration : substs) | ||
gen2 = custom_target( | ||
custom_target( | ||
file, | ||
input : gen1, | ||
input : file + '.in', | ||
output : file, | ||
command : [sed, '/^## /d', '@INPUT@'], | ||
command : [meson_render_jinja2, config_h, '@INPUT@'], | ||
capture : true, | ||
install : install, | ||
install_dir : systemunitdir) | ||
|
@@ -285,31 +278,6 @@ foreach tuple : in_units | |
endif | ||
endforeach | ||
|
||
foreach tuple : m4_units | ||
file = tuple[0] | ||
input = tuple.get(3, file + '.m4') | ||
|
||
# we do this here because install_data does not accept custom_target output | ||
conds = tuple[1].split(' ') | ||
install = ((conds.get(0, '') == '' or conf.get(conds[0]) == 1) and | ||
(conds.get(1, '') == '' or conf.get(conds[1]) == 1)) | ||
|
||
custom_target( | ||
file, | ||
input : input, | ||
output: file, | ||
command : [meson_apply_m4, config_h, '@INPUT@'], | ||
capture : true, | ||
install : install, | ||
install_dir : systemunitdir) | ||
|
||
if tuple.length() > 2 and install | ||
foreach target : tuple[2].split() | ||
add_wants += [systemunitdir, target, file] | ||
endforeach | ||
endif | ||
endforeach | ||
|
||
foreach tuple : units | ||
file = tuple[0] | ||
input = tuple.get(3, file) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.