diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-03 17:31:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-06 13:13:00 +0000 |
commit | 4cae28e3095edc63032318d3f94c6cf7872601b0 (patch) | |
tree | 62ad4d653ce959441a33e8fbc39df7141a405a6b /meta | |
parent | 1c906e76432fbe9fb1ca9a41e6d309b432222d32 (diff) | |
download | poky-4cae28e3095edc63032318d3f94c6cf7872601b0.tar.gz |
package.bbclass: Add PACKAGESPLITFUNCS variable
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.
(From OE-Core rev: 4f9963d1d82ee896fe9491d6a8b32be42cd06f14)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/kernel.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/package.bbclass | 6 | ||||
-rw-r--r-- | meta/classes/update-alternatives.bbclass | 4 | ||||
-rw-r--r-- | meta/classes/update-rc.d_real.bbclass | 4 |
4 files changed, 15 insertions, 3 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 4805944ccb..00117a6cd8 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -301,7 +301,9 @@ if [ x"$D" = "x" ]; then | |||
301 | fi | 301 | fi |
302 | } | 302 | } |
303 | 303 | ||
304 | python populate_packages_prepend () { | 304 | PACKAGESPLITFUNCS_prepend = "split_kernel_packages " |
305 | |||
306 | python split_kernel_packages () { | ||
305 | import re | 307 | import re |
306 | 308 | ||
307 | modinfoexp = re.compile("([^=]+)=(.*)") | 309 | modinfoexp = re.compile("([^=]+)=(.*)") |
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index a93fef984c..6e7e06ed53 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1759,6 +1759,9 @@ PACKAGEBUILDPKGD ?= " \ | |||
1759 | ${PACKAGE_PREPROCESS_FUNCS} \ | 1759 | ${PACKAGE_PREPROCESS_FUNCS} \ |
1760 | split_and_strip_files \ | 1760 | split_and_strip_files \ |
1761 | fixup_perms \ | 1761 | fixup_perms \ |
1762 | " | ||
1763 | # Functions which split PKGD up into separate packages | ||
1764 | PACKAGESPLITFUNCS ?= " \ | ||
1762 | package_do_split_locales \ | 1765 | package_do_split_locales \ |
1763 | populate_packages" | 1766 | populate_packages" |
1764 | # Functions which process metadata based on split packages | 1767 | # Functions which process metadata based on split packages |
@@ -1798,6 +1801,9 @@ python do_package () { | |||
1798 | for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split(): | 1801 | for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split(): |
1799 | bb.build.exec_func(f, d) | 1802 | bb.build.exec_func(f, d) |
1800 | 1803 | ||
1804 | for f in (d.getVar('PACKAGESPLITFUNCS', True) or '').split(): | ||
1805 | bb.build.exec_func(f, d) | ||
1806 | |||
1801 | # Build global list of files in each split package | 1807 | # Build global list of files in each split package |
1802 | global pkgfiles | 1808 | global pkgfiles |
1803 | pkgfiles = {} | 1809 | pkgfiles = {} |
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass index 90bc56b9fb..8f4d0976a9 100644 --- a/meta/classes/update-alternatives.bbclass +++ b/meta/classes/update-alternatives.bbclass | |||
@@ -282,7 +282,9 @@ python perform_packagecopy_append () { | |||
282 | bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target)) | 282 | bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target)) |
283 | } | 283 | } |
284 | 284 | ||
285 | python populate_packages_prepend () { | 285 | PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives " |
286 | |||
287 | python populate_packages_updatealternatives () { | ||
286 | pn = d.getVar('BPN', True) | 288 | pn = d.getVar('BPN', True) |
287 | 289 | ||
288 | # Do actual update alternatives processing | 290 | # Do actual update alternatives processing |
diff --git a/meta/classes/update-rc.d_real.bbclass b/meta/classes/update-rc.d_real.bbclass index 0cd671fe77..f9d55fbec8 100644 --- a/meta/classes/update-rc.d_real.bbclass +++ b/meta/classes/update-rc.d_real.bbclass | |||
@@ -47,7 +47,9 @@ python __anonymous() { | |||
47 | update_rc_after_parse(d) | 47 | update_rc_after_parse(d) |
48 | } | 48 | } |
49 | 49 | ||
50 | python populate_packages_prepend () { | 50 | PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd " |
51 | |||
52 | python populate_packages_updatercd () { | ||
51 | def update_rcd_package(pkg): | 53 | def update_rcd_package(pkg): |
52 | bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg) | 54 | bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg) |
53 | """ | 55 | """ |