Patchwork [meta-oe] syslog-ng: fix a multilib build failure and a QA issue

login
register
mail settings
Submitter jackie huang
Date Aug. 8, 2014, 9:42 a.m.
Message ID <1407490972-15320-1-git-send-email-jackie.huang@windriver.com>
Download mbox | patch
Permalink /patch/77531/
State Accepted, archived
Headers show

Comments

jackie huang - Aug. 8, 2014, 9:42 a.m.
From: Jackie Huang <jackie.huang@windriver.com>

* Use BPN instead of PN to fix the multilib build failure:
ERROR: Function failed: SYSTEMD_SERVICE_lib32-syslog-ng value
lib32-syslog-ng.service does not exist

* Do not add syslog-init for systemd to fix the QA issue:
WARNING: syslog-ng: alternative target (/etc/init.d/syslog or
/etc/init.d/syslog.syslog-ng) does not exist, skipping...
WARNING: syslog-ng: NOT adding alternative provide /etc/init.d/syslog:
/etc/init.d/syslog.syslog-ng does not exist
WARNING: alt_link == alt_target: /etc/init.d/syslog ==
/etc/init.d/syslog

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 meta-oe/recipes-support/syslog-ng/syslog-ng.inc | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Patch

diff --git a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
index 3cedba6..57976b3 100644
--- a/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
+++ b/meta-oe/recipes-support/syslog-ng/syslog-ng.inc
@@ -84,11 +84,17 @@  RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "",
 RPROVIDES_${PN} += "${PN}-systemd"
 RREPLACES_${PN} += "${PN}-systemd"
 RCONFLICTS_${PN} += "${PN}-systemd"
-SYSTEMD_SERVICE_${PN} = "${PN}.service"
-
-ALTERNATIVE_${PN} = "syslog-init"
-ALTERNATIVE_PRIORITY[syslog-init] = "200"
-ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
+SYSTEMD_SERVICE_${PN} = "${BPN}.service"
+
+# no syslog-init for systemd
+python () {
+    if 'sysvinit' in d.getVar("DISTRO_FEATURES", True).split():
+        pn = d.getVar('PN', True)
+        sysconfdir = d.getVar('sysconfdir', True)
+        d.appendVar('ALTERNATIVE_%s' % (pn), ' syslog-init')
+        d.setVarFlag('ALTERNATIVE_PRIORITY', 'syslog-init', '200')
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (sysconfdir))
+}
 
 INITSCRIPT_NAME = "syslog"
 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 90 0 1 6 ."