Patchwork [1/1] useradd.bbclass: add missing functions to preinst

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Aug. 16, 2013, 2:10 a.m.
Message ID <e6a20d726b71351903f90b6d209104bc9a753b3d.1376618940.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/55901/
State Accepted
Commit 1cf5a36aa9f0b9e69b289b09f3d3f519a62d3c17
Headers show

Comments

Qi.Chen@windriver.com - Aug. 16, 2013, 2:10 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

The preinst scripts are calling bbnote, bbwarn and bbfatal functions,
but these functions are not written to the preinst scripts.

This patch writes these missing functions to the preinst scripts to
avoid the 'not found' errors.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/useradd.bbclass |    3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 21daae8..eabfc5d 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -168,6 +168,9 @@  fakeroot python populate_packages_prepend () {
         preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True)
         if not preinst:
             preinst = '#!/bin/sh\n'
+        preinst += 'bbnote () {\n%s}\n' % d.getVar('bbnote', True)
+        preinst += 'bbwarn () {\n%s}\n' % d.getVar('bbwarn', True)
+        preinst += 'bbfatal () {\n%s}\n' % d.getVar('bbfatal', True)
         preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd', True)
         preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd', True)
         preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems', True)