]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: Add PACKAGESPLITFUNCS variable
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Feb 2013 17:31:30 +0000 (17:31 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Feb 2013 13:12:19 +0000 (13:12 +0000)
Prepending to populate_packages is rather ugly and means its hard to trace
errors and also profiling informaiton is summed together in one function.

This patch starts to split out the prepends to become separate functions
to avoid these issues. This is generally a neater way to write functions
than prepending to where there can sometimes be variable scope issues
and we've been bitten by whitespace issues in the past.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass
meta/classes/package.bbclass
meta/classes/update-alternatives.bbclass
meta/classes/update-rc.d_real.bbclass

index 4805944ccbe7cb3ebeed8773d13a349cd376a29d..00117a6cd87684b9bb7fe46c69132bd6848546a8 100644 (file)
@@ -301,7 +301,9 @@ if [ x"$D" = "x" ]; then
 fi
 }
 
-python populate_packages_prepend () {
+PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
+
+python split_kernel_packages () {
     import re
 
     modinfoexp = re.compile("([^=]+)=(.*)")
index a93fef984c7d97703755436402d5bc6c17036b72..6e7e06ed531471cc5e298623b1dd1a2937e337da 100644 (file)
@@ -1759,6 +1759,9 @@ PACKAGEBUILDPKGD ?= " \
                 ${PACKAGE_PREPROCESS_FUNCS} \
                 split_and_strip_files \
                 fixup_perms \
+                "
+# Functions which split PKGD up into separate packages
+PACKAGESPLITFUNCS ?= " \
                 package_do_split_locales \
                 populate_packages"
 # Functions which process metadata based on split packages
@@ -1798,6 +1801,9 @@ python do_package () {
     for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split():
         bb.build.exec_func(f, d)
 
+    for f in (d.getVar('PACKAGESPLITFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+
     # Build global list of files in each split package
     global pkgfiles
     pkgfiles = {}
index 90bc56b9fbaec6c1703030e8165b5666601686e7..8f4d0976a9b6baefe6ab1102b2139625d4b1a7f8 100644 (file)
@@ -282,7 +282,9 @@ python perform_packagecopy_append () {
                     bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target))
 }
 
-python populate_packages_prepend () {
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
+
+python populate_packages_updatealternatives () {
     pn = d.getVar('BPN', True)
 
     # Do actual update alternatives processing
index 0cd671fe77ac3f9581d402977114222dfe3a0398..f9d55fbec81895962a710bf8c682ecd9d0e51800 100644 (file)
@@ -47,7 +47,9 @@ python __anonymous() {
     update_rc_after_parse(d)
 }
 
-python populate_packages_prepend () {
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
+
+python populate_packages_updatercd () {
     def update_rcd_package(pkg):
         bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
         """