mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: add --prefix, to only run entries below a path
A package that ships a tmpfiles.d file wants its own paths created
when it is installed, without running every other entry on the
system:
tmpfiles --create --prefix=/var/lib/app
Add the option, it can be given more than once. It and
--exclude-prefix compare whole path components now, before
--exclude-prefix=/dev also left out /devices.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+54
-6
No files matched your search
@@ -30,3 +30,13 @@ assert "File content" "$(texec cat $DIR/text)" = "two words"
|
||||
|
||||
say 'A lone - is no argument'
|
||||
assert "Empty file" "$(texec stat -c %s $DIR/dash)" = "0"
|
||||
|
||||
sep
|
||||
say 'With --prefix only the entries below it are run'
|
||||
run "cat > $CONF" <<CONF
|
||||
f $DIR/in/file
|
||||
f $DIR/out/file
|
||||
f $DIR/input
|
||||
CONF
|
||||
run "/libexec/finit/tmpfiles --create --prefix=$DIR/in $CONF"
|
||||
assert "Only below the prefix" "$(texec sh -c "ls -d $DIR/in* $DIR/out* 2>/dev/null" | tr '\n' ' ')" = "$DIR/in "
|
||||
Reference in new issue
Block a user