summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@googlemail.com>2012-02-22 16:03:20 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2012-02-23 16:46:31 +0100
commit114cefffb9879b9e52c3323872a7dfac03d626a9 (patch)
treef3b3a7093582beff5268a5a1c039c084095a37f1 /meta-oe/classes
parent4c66cea57941e0048c5635e5b0ef7ec430d2f828 (diff)
downloadmeta-openembedded-114cefffb9879b9e52c3323872a7dfac03d626a9.tar.gz
systemd.bbclass: automatically extend RDEPENDS for *-systemd packages
* append systemd functionalty moved into systemd_add_rdepends * append base-pgk in case receipe does not set RDEPENDS for *-systemd package Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/systemd.bbclass21
1 files changed, 17 insertions, 4 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index c712e17c3..dd423b5c6 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -122,10 +122,6 @@ python populate_packages_prepend () {
122 postrm += bb.data.getVar('systemd_postrm', localdata, 1) 122 postrm += bb.data.getVar('systemd_postrm', localdata, 1)
123 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) 123 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
124 124
125 rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
126 rdepends.append("systemd")
127 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
128
129 # add files to FILES_*-systemd if existent and not already done 125 # add files to FILES_*-systemd if existent and not already done
130 def systemd_append_file(pkg_systemd, file_append): 126 def systemd_append_file(pkg_systemd, file_append):
131 appended = False 127 appended = False
@@ -185,10 +181,27 @@ python populate_packages_prepend () {
185 raise bb.build.FuncFailed, "\n\nFor package %s SYSTEMD_SERVICE-entry %s does not exist" % \ 181 raise bb.build.FuncFailed, "\n\nFor package %s SYSTEMD_SERVICE-entry %s does not exist" % \
186 (pkg_systemd, service) 182 (pkg_systemd, service)
187 183
184 # *-systemd packages get RDEPENDS to systemd and their base package
185 def systemd_add_rdepends(pkg_systemd):
186 # RDEPENDS_${pkg_systemd} += pkg_systemd_base systemd
187 rdepends = d.getVar('RDEPENDS_' + pkg_systemd, 1) or ""
188 rdepends_arr = rdepends.split()
189 if not 'systemd' in rdepends_arr:
190 rdepends = '%s %s' % (rdepends, 'systemd')
191 pkg_systemd_base = pkg_systemd.replace('-systemd', '')
192 # no automatism for:
193 # recipes setting rdepends themselves AND
194 # not rdepending myself AND
195 # avoid double entries
196 if len(rdepends_arr) == 0 and pkg_systemd != '${PN}' and not pkg_systemd_base in rdepends:
197 rdepends = '%s %s' % (rdepends, pkg_systemd_base)
198 d.setVar('RDEPENDS_' + pkg_systemd, rdepends)
199
188 200
189 # run all modifications once when creating package 201 # run all modifications once when creating package
190 if os.path.exists('${D}'): 202 if os.path.exists('${D}'):
191 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split(): 203 for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
192 systemd_generate_package_scripts(pkg_systemd) 204 systemd_generate_package_scripts(pkg_systemd)
205 systemd_add_rdepends(pkg_systemd)
193 systemd_check_services() 206 systemd_check_services()
194} 207}