mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: add the L? entry
tmpfiles.d(5) has L? for a link that is only made when what it points
to exists:
L? /etc/localtime - - - - ../usr/share/zoneinfo/UTC
The ? was not read, so this made the link whatever was there.
Finit has had this as its own l entry. Read L? as l.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+15
-1
No files matched your search
@@ -31,6 +31,16 @@ 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 'L? only makes the link when what it points to is there'
|
||||
run "cat > $CONF" <<CONF
|
||||
L? $DIR/there - - - - /etc/passwd
|
||||
L? $DIR/missing - - - - /no/such/file
|
||||
CONF
|
||||
run "/libexec/finit/tmpfiles --create $CONF"
|
||||
assert "Link to a path that is there" "$(texec readlink $DIR/there)" = "/etc/passwd"
|
||||
assert "No link to a missing path" "$(texec sh -c "ls $DIR | grep -c missing")" = "0"
|
||||
|
||||
sep
|
||||
say 'With --prefix only the entries below it are run'
|
||||
run "cat > $CONF" <<CONF
|
||||
|
||||
Reference in new issue
Block a user