core: support %j in unit dependency resolution
authorPatrick Williams <patrick@stwcx.xyz>
Thu, 20 Dec 2018 14:59:18 +0000 (08:59 -0600)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 22 Dec 2018 08:21:13 +0000 (17:21 +0900)
commit8eab766804ef4fa21d26c00fd0baab3f1a47bb5c
tree1c305649abe3842060577d91fa1106bdd8698909
parent1742aae2aa8cd33897250d6fcfbe10928e43eb2f
core: support %j in unit dependency resolution

Commit 250e9fadbcc0ca90e697d7efb40855b054ed3b8f introduced
support for %j/%J specifier in unit files.  The function
unit_name_printf is used in unit dependency resolution,
such as Wants / After directives, but was missing support
for the %j.  Add to allow directives such as:

    [Unit]
    Wants=bar-%j.target

Fixes: systemd/systemd#11217
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
src/core/unit-printf.c
test/TEST-28-PERCENTJ-WANTEDBY/Makefile [new file with mode: 0644]
test/TEST-28-PERCENTJ-WANTEDBY/test.sh [new file with mode: 0755]