tmpfiles: add --purge and the $ modifier

When a package is removed, the state its tmpfiles.d file made is left
behind, there was no way to ask for it to be removed.

systemd-tmpfiles has --purge for that, which removes what the entries
marked with a $ after the type make:

    d$ /var/lib/app 0750 app app
    tmpfiles --purge /usr/lib/tmpfiles.d/app.conf

Add the same.  It only takes the entries of files on the command line,
never all of the tmpfiles.d files, and a path is removed before the
one above it.  A $ was until now read and ignored.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 19:23:50 +01:00
1 parent 575267f09b
commit 26568bc0fd
5 files changed
+104 -4

No files matched your search

+1 -1
View File
@@ -17,4 +17,4 @@ files or common packages already rely on, last what few will miss.
2. Command line
---------------
Missing options: `--root` and `--purge`.
Missing option: `--root`.