sysupdate: automatically clean up orphaned files after auto-update

This adds an operation equivalent to "systemd-sysupdate cleanup" after
an update completed (regardless if that update was entirely successful
or not).  This ensures that any orphaned files are automatically cleaned
up, if they are not referenced by any transfer file's patterns anymore.

Follow-up for: d82e256bb9
This commit is contained in:
Lennart Poettering
2026-06-24 10:42:16 +02:00
parent 1dcd2966a0
commit 5bd7cc7a6b
4 changed files with 162 additions and 30 deletions
+12
View File
@@ -360,6 +360,18 @@
<xi:include href="version-info.xml" xpointer="v251"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--cleanup=</option></term>
<listitem><para>Takes a boolean argument. When used in combination with the <command>update</command>
command, automatically performs the equivalent of the <command>cleanup</command> command afterwards,
removing any orphaned files that are no longer covered by the patterns of the currently defined
transfer files. This is useful to garbage-collect files that used to be owned by a transfer file that
has since been modified, disabled or removed. Defaults to off.</para>
<xi:include href="version-info.xml" xpointer="v262"/></listitem>
</varlistentry>
<varlistentry>
<term><option>--offline</option></term>