Use systemd-tmpfiles for var dirs when on systemd
Putting packages files in /var prevent makes new install start with an already populated /var, which prevent taking advantage of the systemd provided tmpfiles.d/var.conf, which notably has this line: q /var 0755 - - - -> on supported filesystems (currently that means btrfs), this creates /var as a subvolume, which has the benefit of excluding it from / snapshots. On non-systemd system, the `meson install` behavior stays the same, /var/lib/pacman and /var/cache/pacman/pkg are included in DESTDIR. Signed-off-by: Max Gautier <mg@max.gautier.name>
This commit is contained in:
parent
f343db5b8e
commit
7da78a3102
2 changed files with 18 additions and 3 deletions
17
meson.build
17
meson.build
|
@ -445,9 +445,20 @@ install_data(
|
|||
'proto/proto.install',
|
||||
install_dir : join_paths(DATAROOTDIR, 'pacman'))
|
||||
|
||||
foreach path : [
|
||||
join_paths(LOCALSTATEDIR, 'lib/pacman/'),
|
||||
join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'),
|
||||
systemd = dependency('systemd', required: false)
|
||||
if systemd.found()
|
||||
install_data('tmpfiles.conf',
|
||||
rename: 'pacman.conf',
|
||||
install_dir: systemd.get_variable(pkgconfig: 'tmpfilesdir'))
|
||||
var_paths = []
|
||||
else
|
||||
var_paths = [
|
||||
join_paths(LOCALSTATEDIR, 'lib/pacman/'),
|
||||
join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/'),
|
||||
]
|
||||
endif
|
||||
|
||||
foreach path : var_paths + [
|
||||
join_paths(DATAROOTDIR, 'makepkg-template/'),
|
||||
join_paths(DATAROOTDIR, 'libalpm/hooks/'),
|
||||
]
|
||||
|
|
4
tmpfiles.conf
Normal file
4
tmpfiles.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Setup pacman data and cache directories
|
||||
|
||||
d %S/pacman
|
||||
d %C/pacman/pkg
|
Loading…
Add table
Reference in a new issue