summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd-systemctl
diff options
context:
space:
mode:
authorYuta Hayama <hayama@lineo.co.jp>2023-07-05 15:06:35 +0900
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-10 11:36:06 +0100
commitd18b939fb08b37380ce95934da38e6522392621c (patch)
tree01af9b6d1c70e69e74f818fc57795266a00f667f /meta/recipes-core/systemd/systemd-systemctl
parentcc73360b9728812ed6123e30559b77d8e89cc21c (diff)
downloadopenembedded-core-contrib-d18b939fb08b37380ce95934da38e6522392621c.tar.gz
systemd-systemctl: fix errors in instance name expansion
If the instance name indicated by %i begins with a number, the meaning of the replacement string "\\1{}".format(instance) is ambiguous. To indicate group number 1 regardless of the instance name, use "\g<1>". Signed-off-by: Yuta Hayama <hayama@lineo.co.jp> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd-systemctl')
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index 514f747fe6..7fe751b397 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -202,7 +202,7 @@ class SystemdUnit():
try:
for dependent in config.get('Install', prop):
# expand any %i to instance (ignoring escape sequence %%)
- dependent = re.sub("([^%](%%)*)%i", "\\1{}".format(instance), dependent)
+ dependent = re.sub("([^%](%%)*)%i", "\\g<1>{}".format(instance), dependent)
wants = systemdir / "{}.{}".format(dependent, dirstem) / service
add_link(wants, target)