Skip to contentSkip to conversation

systemd-systemctl: fix errors in instance name expansion

PATCH Yuta Hayama 2 participants 2 messages Jul 27, 2023 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi Steve,

Sorry for rushing you.
If the patch obviously needs to be backported to stable branch, could I post a backport request email right away? This issue is not listed in bugzilla, so I was worried that the patch might have been missed.

Regards,

Yuta Hayama

Quoted 37 lines · Yuta Hayama via lists.openembedded.org

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)

---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd-systemctl/systemctl +1 -2
index 514f747fe6..7fe751b397 100755
@@ -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)
 
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#184918): https://lists.openembedded.org/g/openembedded-core/message/184918
Mute This Topic: https://lists.openembedded.org/mt/100386774/7729851
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 10 lines · Yuta Hayama

Hi Steve,

Sorry for rushing you.
If the patch obviously needs to be backported to stable branch, could I post
a backport request email right away? This issue is not listed in bugzilla, so
I was worried that the patch might have been missed.

I have the patch in my mickledore test queue right now, and should have it in kirkstone and dunfell shortly.

Yes, it is fine to send patches for stable branches once they have been accepted in master. It will help ensure that I don't miss something.

Steve

Quoted 48 lines · Yuta Hayama via lists.openembedded.org
Quoted 1 line

If the instance name indicated by %i begins with a number, the meaning

of the

Quoted 6 lines

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)

Review

Quoted 7 lines
---
 meta/recipes-core/systemd/systemd-systemctl/systemctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-core/systemd/systemd-systemctl/systemctl

meta/recipes-core/systemd/systemd-systemctl/systemctl class SystemdUnit(): · line 204

Quoted 7 lines

index 514f747fe6..7fe751b397 100755

meta/recipes-core/systemd/systemd-systemctl/systemctl +0 -0
@@ -202,7 +202,7 @@ class SystemdUnit():
         try:
             for dependent in config.get('Install', prop):
                 # expand any %i to instance (ignoring escape sequence

%%)

meta/recipes-core/systemd/systemd-systemctl/systemctl class SystemdUnit(): · line 205

Quoted 1 line
meta/recipes-core/systemd/systemd-systemctl/systemctl +0 -1
-                dependent = re.sub("([^%](%%)*)%i",

"\\1{}".format(instance), dependent)

meta/recipes-core/systemd/systemd-systemctl/systemctl class SystemdUnit(): · line 205

Quoted 1 line
meta/recipes-core/systemd/systemd-systemctl/systemctl +1 -0
+                dependent = re.sub("([^%](%%)*)%i",

"\\g<1>{}".format(instance), dependent)

meta/recipes-core/systemd/systemd-systemctl/systemctl class SystemdUnit(): · line 206

Quoted 1 line
meta/recipes-core/systemd/systemd-systemctl/systemctl +0 -0
                 wants = systemdir / "{}.{}".format(dependent, dirstem)

/ service

Quoted 8 lines
meta/recipes-core/systemd/systemd-systemctl/systemctl +0 -1
                 add_link(wants, target)
 
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group. View/Reply Online (#184918):

https://lists.openembedded.org/g/openembedded-core/message/184918

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/100386774/7729851
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-