From: Yuta Hayama Date: Thu, 27 Jul 2023 08:19:43 +0000 (+0900) Subject: systemd-systemctl: fix errors in instance name expansion X-Git-Tag: yocto-3.1.28~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=682e094e6af67e67873f7f08dd8d52b40fcdbded;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git 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>". (From OE-Core rev: d18b939fb08b37380ce95934da38e6522392621c) Signed-off-by: Yuta Hayama Signed-off-by: Richard Purdie Signed-off-by: Steve Sakoman --- diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl index b890bdd6f0d..e003c860e3a 100755 --- a/meta/recipes-core/systemd/systemd-systemctl/systemctl +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl @@ -189,7 +189,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)