[OE-core] [meta-oe][PATCH] systemd.bbclass: Support . in instance strings

Jonatan Pålsson jonatan.palsson at pelagicore.com
Mon Nov 21 11:02:24 UTC 2016


This modified regular expression allows systemd instance strings (the
string between @ and .service) to contains dots, which is useful for
file names which contain dots. The previous regular expression would
stop matching at the first dot, while this expression stops matching at
the last dot.

Signed-off-by: Jonatan Pålsson <jonatan.palsson at pelagicore.com>
---
 meta/classes/systemd.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index d56c760..9131b82 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -151,7 +151,7 @@ python systemd_populate_packages() {
                 # 'ifplugd at .service'
                 base = None
                 if service.find('@') != -1:
-                    base = re.sub('@[^.]+.', '@.', service)
+                    base = re.sub("@.*\.(?=[^.]*$)", '@.', service)
 
                 for path in searchpaths:
                     if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
-- 
2.10.2




More information about the Openembedded-core mailing list