Skip to contentSkip to conversation

systemd.class - Allow enabling of parameterised services

PATCH In review Bob Ham 1 participant 2 messages Nov 19, 2015 – Dec 3, 2015

lore
Share & tools
lore

Bob Ham

author
#0 lore raw

PATCH 1/1 systemd.class - Allow enabling of parameterised services

Currently the systemd.class will check whether a service exists when it is requested to enabled it. However, its check does not take into account that a service like '[email protected]' can be enabled from a service named '[email protected]'. This patch alters the check function in systemd.class to look for '[email protected]' if the normal check fails.

---
 meta/classes/systemd.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
meta/classes/systemd.bbclass +14 -0
index 46e72c7..db7873f 100644
@@ -59,6 +59,8 @@ systemd_populate_packages[vardepsexclude] += "OVERRIDES"
 
 
 python systemd_populate_packages() {
+    import re
+
     if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
         return
 
@@ -144,10 +146,22 @@ python systemd_populate_packages() {
         for pkg_systemd in systemd_packages.split():
             for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
                 path_found = ''
+
+                # Deal with adding, for example, '[email protected]' from
+                # '[email protected]'
+                base = None
+                if service.find('@') != -1:
+                    base = re.sub('@[^.]+.', '@.', service)
+
                 for path in searchpaths:
                     if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
                         path_found = path
                         break
+                    elif base is not None:
+                        if os.path.exists(oe.path.join(d.getVar("D", True), path, base)):
+                            path_found = path
+                            break
+
                 if path_found != '':
                     systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
                 else:
Signature · 1 line
2.1.4
author
#1 lore raw
Quoted 3 lines · Bob Ham

CThis patch alters the check function
in systemd.class to look for '[email protected]' if the normal check fails.

*ping*

Signature · 2 lines
Bob Ham <[email protected]>
Software Engineer
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Open First
Collabora is hiring!
Please check out our latest opportunities here:
http://bit.ly/Collabora-Careers
<<<<<<<<