summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-10-20 16:09:05 +0000
committerRichard Purdie <richard@openedhand.com>2006-10-20 16:09:05 +0000
commite2b821a8345b65318da04ecde14d15924a229c8a (patch)
tree20860f6b00d9f0a9a0fa861cc8593499f326ad2c /meta/classes
parent49d42d9fe619a6897cd95ba42defcb1e5a4bff1f (diff)
downloadpoky-e2b821a8345b65318da04ecde14d15924a229c8a.tar.gz
package.bbclass: Split into two tasks, one which prepares the packages and then package_write which actually generates the packages. The two stage approach allows us to avoid circular dependency issues from classes like debian.bbclass. As the data being emitted into pkgdata/ changed, you need to either wipe tmp or rerun the do_install/do_package tasks (wipe the do_xyz stamps from the stamps dir). Everything will repackage anyway due to the new task.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@807 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass2
-rw-r--r--meta/classes/debian.bbclass2
-rw-r--r--meta/classes/package.bbclass37
-rw-r--r--meta/classes/package_deb.bbclass2
-rw-r--r--meta/classes/package_ipk.bbclass2
-rw-r--r--meta/classes/package_rpm.bbclass2
-rw-r--r--meta/classes/package_tar.bbclass2
7 files changed, 35 insertions, 14 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 54c30f7b8f..3a393a04db 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -565,7 +565,7 @@ do_populate_staging[dirs] = "${STAGING_DIR}/${TARGET_SYS}/bin ${STAGING_DIR}/${T
565 ${STAGING_DATADIR} \ 565 ${STAGING_DATADIR} \
566 ${S} ${B}" 566 ${S} ${B}"
567 567
568addtask populate_staging after do_package 568addtask populate_staging after do_package_write
569 569
570python do_populate_staging () { 570python do_populate_staging () {
571 bb.build.exec_func('do_stage', d) 571 bb.build.exec_func('do_stage', d)
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass
index 698d917b51..7ffa6c1a27 100644
--- a/meta/classes/debian.bbclass
+++ b/meta/classes/debian.bbclass
@@ -8,7 +8,7 @@ BUILD_ALL_DEPS = "1"
8 8
9# Better expressed as ensure all RDEPENDS package before we package 9# Better expressed as ensure all RDEPENDS package before we package
10# This means we can't have circular RDEPENDS/RRECOMMENDS 10# This means we can't have circular RDEPENDS/RRECOMMENDS
11do_package[rdeptask] = "do_package" 11do_package_write[rdeptask] = "do_package"
12 12
13python debian_package_name_hook () { 13python debian_package_name_hook () {
14 import glob, copy, stat, errno, re 14 import glob, copy, stat, errno, re
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 271c8f585c..a429e43c44 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -451,8 +451,6 @@ python populate_packages () {
451 if found == False: 451 if found == False:
452 bb.note("%s contains dangling symlink to %s" % (pkg, l)) 452 bb.note("%s contains dangling symlink to %s" % (pkg, l))
453 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) 453 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
454
455 bb.build.exec_func('emit_pkgdata', d)
456} 454}
457populate_packages[dirs] = "${D}" 455populate_packages[dirs] = "${D}"
458 456
@@ -482,6 +480,11 @@ python emit_pkgdata() {
482 write_if_exists(sf, pkg, 'DESCRIPTION') 480 write_if_exists(sf, pkg, 'DESCRIPTION')
483 write_if_exists(sf, pkg, 'RDEPENDS') 481 write_if_exists(sf, pkg, 'RDEPENDS')
484 write_if_exists(sf, pkg, 'RPROVIDES') 482 write_if_exists(sf, pkg, 'RPROVIDES')
483 write_if_exists(sf, pkg, 'RRECOMMENDS')
484 write_if_exists(sf, pkg, 'RSUGGESTS')
485 write_if_exists(sf, pkg, 'RPROVIDES')
486 write_if_exists(sf, pkg, 'RREPLACES')
487 write_if_exists(sf, pkg, 'RCONFLICTS')
485 write_if_exists(sf, pkg, 'PKG') 488 write_if_exists(sf, pkg, 'PKG')
486 write_if_exists(sf, pkg, 'ALLOW_EMPTY') 489 write_if_exists(sf, pkg, 'ALLOW_EMPTY')
487 write_if_exists(sf, pkg, 'FILES') 490 write_if_exists(sf, pkg, 'FILES')
@@ -490,7 +493,6 @@ python emit_pkgdata() {
490 write_if_exists(sf, pkg, 'pkg_preinst') 493 write_if_exists(sf, pkg, 'pkg_preinst')
491 write_if_exists(sf, pkg, 'pkg_prerm') 494 write_if_exists(sf, pkg, 'pkg_prerm')
492 sf.close() 495 sf.close()
493 bb.build.exec_func("read_subpackage_metadata", d)
494} 496}
495emit_pkgdata[dirs] = "${STAGING_DIR}/pkgdata/runtime" 497emit_pkgdata[dirs] = "${STAGING_DIR}/pkgdata/runtime"
496 498
@@ -822,29 +824,48 @@ python package_depchains() {
822} 824}
823 825
824 826
825PACKAGEFUNCS = "package_do_split_locales \ 827
828PACKAGEFUNCS ?= "package_do_split_locales \
826 populate_packages \ 829 populate_packages \
827 package_do_shlibs \ 830 package_do_shlibs \
828 package_do_pkgconfig \ 831 package_do_pkgconfig \
829 read_shlibdeps \ 832 read_shlibdeps \
830 package_depchains" 833 package_depchains \
834 emit_pkgdata"
831 835
832python package_do_package () { 836python package_do_package () {
833 for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split(): 837 for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split():
834 bb.build.exec_func(f, d) 838 bb.build.exec_func(f, d)
835} 839}
836
837do_package[dirs] = "${D}"
838# shlibs requires any DEPENDS to have already packaged for the *.list files 840# shlibs requires any DEPENDS to have already packaged for the *.list files
839do_package[deptask] = "do_package" 841do_package[deptask] = "do_package"
840EXPORT_FUNCTIONS do_package 842do_package[dirs] = "${D}"
841addtask package before do_build after do_install 843addtask package before do_build after do_install
842 844
845
846
847PACKAGE_WRITE_FUNCS ?= "read_subpackage_metadata"
848
849python package_do_package_write () {
850 for f in (bb.data.getVar('PACKAGE_WRITE_FUNCS', d, 1) or '').split():
851 bb.build.exec_func(f, d)
852}
853do_package_write[dirs] = "${D}"
854addtask package_write before do_build after do_package
855
856
857EXPORT_FUNCTIONS do_package do_package_write
858
859
843# 860#
844# Helper functions for the package writing classes 861# Helper functions for the package writing classes
845# 862#
846 863
847python package_mapping_rename_hook () { 864python package_mapping_rename_hook () {
865 """
866 Rewrite variables to account for package renaming in things
867 like debian.bbclass or manual PKG variable name changes
868 """
848 runtime_mapping_rename("RDEPENDS", d) 869 runtime_mapping_rename("RDEPENDS", d)
849 runtime_mapping_rename("RRECOMMENDS", d) 870 runtime_mapping_rename("RRECOMMENDS", d)
850 runtime_mapping_rename("RSUGGESTS", d) 871 runtime_mapping_rename("RSUGGESTS", d)
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index de93593c95..c19a9249d5 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -2,7 +2,7 @@ inherit package
2DEPENDS_prepend="${@["dpkg-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" 2DEPENDS_prepend="${@["dpkg-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}"
3BOOTSTRAP_EXTRA_RDEPENDS += "dpkg" 3BOOTSTRAP_EXTRA_RDEPENDS += "dpkg"
4DISTRO_EXTRA_RDEPENDS += "dpkg" 4DISTRO_EXTRA_RDEPENDS += "dpkg"
5PACKAGEFUNCS += "do_package_deb" 5PACKAGE_WRITE_FUNCS += "do_package_deb"
6IMAGE_PKGTYPE ?= "deb" 6IMAGE_PKGTYPE ?= "deb"
7 7
8python package_deb_fn () { 8python package_deb_fn () {
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index f297381f87..54fecf6659 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -2,7 +2,7 @@ inherit package
2DEPENDS_prepend="${@["ipkg-utils-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}" 2DEPENDS_prepend="${@["ipkg-utils-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}"
3BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" 3BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
4DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link" 4DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
5PACKAGEFUNCS += "do_package_ipk" 5PACKAGE_WRITE_FUNCS += "do_package_ipk"
6IMAGE_PKGTYPE ?= "ipk" 6IMAGE_PKGTYPE ?= "ipk"
7 7
8python package_ipk_fn () { 8python package_ipk_fn () {
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index ee579bed55..4955792916 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -2,7 +2,7 @@ inherit package
2inherit rpm_core 2inherit rpm_core
3 3
4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}" 4RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}"
5PACKAGEFUNCS += "do_package_rpm" 5PACKAGE_WRITE_FUNCS += "do_package_rpm"
6IMAGE_PKGTYPE ?= "rpm" 6IMAGE_PKGTYPE ?= "rpm"
7 7
8python write_specfile() { 8python write_specfile() {
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index d8c7919c3a..81ae0f84a0 100644
--- a/meta/classes/package_tar.bbclass
+++ b/meta/classes/package_tar.bbclass
@@ -1,6 +1,6 @@
1inherit package 1inherit package
2 2
3PACKAGEFUNCS += "do_package_tar" 3PACKAGE_WRITE_FUNCS += "do_package_tar"
4IMAGE_PKGTYPE ?= "tar" 4IMAGE_PKGTYPE ?= "tar"
5 5
6python package_tar_fn () { 6python package_tar_fn () {