X Tutup
Skip to content

Commit fce9abb

Browse files
committed
meson: use a/b instead of join_paths(a,b)
It is nicer and shorter.
1 parent 0b5f1bd commit fce9abb

File tree

22 files changed

+163
-164
lines changed

22 files changed

+163
-164
lines changed

hwdb.d/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if conf.get('ENABLE_HWDB') == 1
4949

5050
if install_sysconfdir
5151
meson.add_install_script('sh', '-c',
52-
mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
52+
mkdir_p.format(sysconfdir / 'udev/hwdb.d'))
5353

5454
meson.add_install_script('sh', '-c',
5555
'test -n "$DESTDIR" || @0@/systemd-hwdb update'.format(rootbindir))

man/meson.build

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ foreach tuple : xsltproc.found() ? manpages : []
5454
htmlaliases += alias + '.html'
5555
endforeach
5656

57-
mandirn = join_paths(get_option('mandir'), 'man' + section)
57+
mandirn = get_option('mandir') / ('man' + section)
5858

5959
if condition == '' or conf.get(condition) == 1
6060
p1 = custom_target(
@@ -74,7 +74,7 @@ foreach tuple : xsltproc.found() ? manpages : []
7474
output : htmlalias,
7575
command : [ln, '-fs', html, '@OUTPUT@'])
7676
if want_html
77-
dst = join_paths(docdir, 'html', htmlalias)
77+
dst = docdir / 'html' / htmlalias
7878
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
7979
meson.add_install_script('sh', '-c', cmd)
8080
p2 += link
@@ -89,7 +89,7 @@ foreach tuple : xsltproc.found() ? manpages : []
8989
command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
9090
depends : [custom_entities_ent, p2],
9191
install : want_html,
92-
install_dir : join_paths(docdir, 'html'))
92+
install_dir : docdir / 'html')
9393
html_pages += p3
9494

9595
file = files(tuple[0] + '.xml')
@@ -132,7 +132,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
132132
html = stem + '.html'
133133
man = stem + '.' + section
134134

135-
mandirn = join_paths(get_option('mandir'), 'man' + section)
135+
mandirn = get_option('mandir') / ('man' + section)
136136

137137
p1 = custom_target(
138138
man,
@@ -152,7 +152,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
152152
output : htmlalias,
153153
command : [ln, '-fs', html, '@OUTPUT@'])
154154
if want_html
155-
dst = join_paths(docdir, 'html', htmlalias)
155+
dst = docdir / 'html' / htmlalias
156156
cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
157157
meson.add_install_script('sh', '-c', cmd)
158158
p2 += link
@@ -167,7 +167,7 @@ foreach tuple : xsltproc.found() ? [['systemd.directives', '7', systemd_directiv
167167
command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
168168
depends : [custom_entities_ent, p2],
169169
install : want_html and have_lxml,
170-
install_dir : join_paths(docdir, 'html'))
170+
install_dir : docdir / 'html')
171171
html_pages += p3
172172
endforeach
173173

meson.build

Lines changed: 116 additions & 116 deletions
Large diffs are not rendered by default.

network/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if conf.get('ENABLE_NETWORKD') == 1
1212

1313
if install_sysconfdir
1414
meson.add_install_script('sh', '-c',
15-
mkdir_p.format(join_paths(sysconfdir, 'systemd/network')))
15+
mkdir_p.format(sysconfdir / 'systemd/network'))
1616
endif
1717
endif
1818

shell-completion/bash/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if bashcompletiondir == ''
66
if bash_completion.found()
77
bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir')
88
else
9-
bashcompletiondir = join_paths(datadir, 'bash-completion/completions')
9+
bashcompletiondir = datadir / 'bash-completion/completions'
1010
endif
1111
endif
1212

shell-completion/zsh/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
zshcompletiondir = get_option('zshcompletiondir')
44
if zshcompletiondir == ''
5-
zshcompletiondir = join_paths(datadir, 'zsh/site-functions')
5+
zshcompletiondir = datadir / 'zsh/site-functions'
66
endif
77

88
custom_target(

src/boot/efi/meson.build

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
7171
efi_libdir = get_option('efi-libdir')
7272
if efi_libdir == ''
7373
# New location first introduced with gnu-efi 3.0.11
74-
efi_libdir = join_paths('/usr/lib/gnuefi', EFI_MACHINE_TYPE_NAME)
74+
efi_libdir = '/usr/lib/gnuefi' / EFI_MACHINE_TYPE_NAME
7575
cmd = run_command(test, '-e', efi_libdir)
7676

7777
if cmd.returncode() != 0
7878
# Fall back to the old approach
7979
cmd = run_command(efi_cc + ['-print-multi-os-directory'])
8080
if cmd.returncode() == 0
81-
path = join_paths('/usr/lib', cmd.stdout().strip())
81+
path = '/usr/lib' / cmd.stdout().strip()
8282
cmd = run_command(env, 'realpath', '-e', path)
8383
if cmd.returncode() == 0
8484
efi_libdir = cmd.stdout().strip()
@@ -148,13 +148,13 @@ if have_gnu_efi
148148

149149
efi_location_map = [
150150
# New locations first introduced with gnu-efi 3.0.11
151-
[join_paths(efi_libdir, 'efi.lds'),
152-
join_paths(efi_libdir, 'crt0.o')],
151+
[efi_libdir / 'efi.lds',
152+
efi_libdir / 'crt0.o'],
153153
# Older locations...
154-
[join_paths(efi_libdir, 'gnuefi', 'elf_@0@_efi.lds'.format(gnu_efi_path_arch)),
155-
join_paths(efi_libdir, 'gnuefi', 'crt0-efi-@0@.o'.format(gnu_efi_path_arch))],
156-
[join_paths(efi_libdir, 'elf_@0@_efi.lds'.format(gnu_efi_path_arch)),
157-
join_paths(efi_libdir, 'crt0-efi-@0@.o'.format(gnu_efi_path_arch))]]
154+
[efi_libdir / 'gnuefi' / 'elf_@0@_efi.lds'.format(gnu_efi_path_arch),
155+
efi_libdir / 'gnuefi' / 'crt0-efi-@0@.o'.format(gnu_efi_path_arch)],
156+
[efi_libdir / 'elf_@0@_efi.lds'.format(gnu_efi_path_arch),
157+
efi_libdir / 'crt0-efi-@0@.o'.format(gnu_efi_path_arch)]]
158158
efi_lds = ''
159159
foreach location : efi_location_map
160160
if efi_lds == ''
@@ -191,7 +191,7 @@ if have_gnu_efi
191191
'-nostdlib',
192192
'-std=gnu99',
193193
'-isystem', efi_incdir,
194-
'-isystem', join_paths(efi_incdir, gnu_efi_path_arch),
194+
'-isystem', efi_incdir / gnu_efi_path_arch,
195195
'-I', fundamental_path,
196196
'-DSD_BOOT',
197197
'-include', efi_config_h,

src/core/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
210210
meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
211211

212212
if install_sysconfdir
213-
meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(pkgsysconfdir, 'system')))
214-
meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(pkgsysconfdir, 'user')))
215-
meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'xdg/systemd')))
213+
meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'system'))
214+
meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'user'))
215+
meson.add_install_script('sh', '-c', mkdir_p.format(sysconfdir / 'xdg/systemd'))
216216
endif
217217

218218
############################################################

src/cryptsetup/cryptsetup-tokens/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if conf.get('HAVE_LIBCRYPTSETUP_PLUGINS') == 1
55
cryptsetup_token_c_args = ['-fvisibility=hidden']
66

77
cryptsetup_token_sym = files('cryptsetup-token.sym')
8-
cryptsetup_token_sym_path = join_paths(meson.current_source_dir(), 'cryptsetup-token.sym')
8+
cryptsetup_token_sym_path = meson.current_source_dir() / 'cryptsetup-token.sym'
99

1010
if conf.get('HAVE_TPM2') == 1
1111
cryptsetup_token_systemd_tpm2_sources = files('''

src/fundamental/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ sources = '''
1414

1515
# for sd-boot
1616
fundamental_source_paths = []
17-
foreach s : sources
18-
fundamental_source_paths += join_paths(meson.current_source_dir(), s)
17+
foreach source : sources
18+
fundamental_source_paths += meson.current_source_dir() / source
1919
endforeach
2020

2121
# for libbasic

0 commit comments

Comments
 (0)
X Tutup