summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes/systemd.bbclass
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2012-02-24 20:55:17 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2012-02-24 23:42:16 +0100
commitc9f5703aded908f2c61171abe2969e41d35028e2 (patch)
tree6ab0523b8016fba7b0e7c82672ce9a80276370bd /meta-oe/classes/systemd.bbclass
parenta21a910dde8b330705f0f651d26f9fd8862e9229 (diff)
downloadmeta-openembedded-c9f5703aded908f2c61171abe2969e41d35028e2.tar.gz
systemd.bbclass: do not mangle PACKAGES variable in native, nativesdk and cross
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes/systemd.bbclass')
-rw-r--r--meta-oe/classes/systemd.bbclass72
1 files changed, 36 insertions, 36 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index dd423b5c6..0329b904f 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -28,40 +28,34 @@ systemctl disable ${SYSTEMD_SERVICE}
28 28
29def systemd_after_parse(d): 29def systemd_after_parse(d):
30 def systemd_check_vars(): 30 def systemd_check_vars():
31 bpn = d.getVar('BPN', 1) 31 bb_filename = d.getVar('FILE')
32 # not for native / only at parse time 32 packages = d.getVar('PACKAGES', 1)
33 if d.getVar('BB_WORKERCONTEXT', True) is None and \ 33
34 bpn + "-native" != d.getVar('PN', 1) and \ 34 # check SYSTEMD_PACKAGES
35 bpn + "-cross" != d.getVar('PN', 1) and \ 35 systemd_pkgs = d.getVar('SYSTEMD_PACKAGES', 1) or ""
36 bpn + "-nativesdk" != d.getVar('PN', 1): 36 if systemd_pkgs == "":
37 bb_filename = d.getVar('FILE') 37 raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_PACKAGES" % bb_filename
38 packages = d.getVar('PACKAGES', 1) 38 for pkg_systemd in systemd_pkgs.split():
39 39 if pkg_systemd.find("-systemd") == -1:
40 # check SYSTEMD_PACKAGES 40 if pkg_systemd != d.getVar('PN', 1):
41 systemd_pkgs = d.getVar('SYSTEMD_PACKAGES', 1) or "" 41 raise bb.build.FuncFailed, \
42 if systemd_pkgs == "": 42 "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN} (deprecated)" % \
43 raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_PACKAGES" % bb_filename 43 (bb_filename, pkg_systemd)
44 for pkg_systemd in systemd_pkgs.split():
45 if pkg_systemd.find("-systemd") == -1:
46 if pkg_systemd != d.getVar('PN', 1):
47 raise bb.build.FuncFailed, \
48 "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN} (deprecated)" % \
49 (bb_filename, pkg_systemd)
50 else:
51 bb.warn("%s: it is recommended to set SYSTEMD_PACKAGES as <existing-package>-systemd" % bb_filename)
52 else: 44 else:
53 pkg_systemd_base = pkg_systemd.replace('-systemd', '') 45 bb.warn("%s: it is recommended to set SYSTEMD_PACKAGES as <existing-package>-systemd" % bb_filename)
54 if pkg_systemd_base not in packages: 46 else:
55 raise bb.build.FuncFailed, \ 47 pkg_systemd_base = pkg_systemd.replace('-systemd', '')
56 "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN} (deprecated)" % \ 48 if pkg_systemd_base not in packages:
57 ( bb_filename, pkg_systemd) 49 raise bb.build.FuncFailed, \
58 50 "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN} (deprecated)" % \
59 # check SYSTEMD_SERVICE 51 ( bb_filename, pkg_systemd)
60 for pkg_systemd in systemd_pkgs.split(): 52
61 service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd 53 # check SYSTEMD_SERVICE
62 systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or "" 54 for pkg_systemd in systemd_pkgs.split():
63 if systemd_services == "": 55 service_pkg = 'SYSTEMD_SERVICE' + "_" + pkg_systemd
64 raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_SERVICE / %s" % (bb_filename, service_pkg) 56 systemd_services = d.getVar(service_pkg, 1) or d.getVar('SYSTEMD_SERVICE', 1) or ""
57 if systemd_services == "":
58 raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_SERVICE / %s" % (bb_filename, service_pkg)
65 59
66 # prepend systemd-packages not already included 60 # prepend systemd-packages not already included
67 def systemd_create_package(pkg_systemd): 61 def systemd_create_package(pkg_systemd):
@@ -71,9 +65,15 @@ def systemd_after_parse(d):
71 d.setVar('PACKAGES', packages) 65 d.setVar('PACKAGES', packages)
72 66
73 67
74 systemd_check_vars() 68 bpn = d.getVar('BPN', 1)
75 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): 69 # not for native / only at parse time
76 systemd_create_package(pkg_systemd) 70 if d.getVar('BB_WORKERCONTEXT', True) is None and \
71 bpn + "-native" != d.getVar('PN', 1) and \
72 bpn + "-cross" != d.getVar('PN', 1) and \
73 bpn + "-nativesdk" != d.getVar('PN', 1):
74 systemd_check_vars()
75 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
76 systemd_create_package(pkg_systemd)
77 77
78 78
79python __anonymous() { 79python __anonymous() {