]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: Split into two tasks, one which prepares the packages and then packa...
authorRichard Purdie <richard@openedhand.com>
Fri, 20 Oct 2006 16:09:05 +0000 (16:09 +0000)
committerRichard Purdie <richard@openedhand.com>
Fri, 20 Oct 2006 16:09:05 +0000 (16:09 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@807 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/base.bbclass
meta/classes/debian.bbclass
meta/classes/package.bbclass
meta/classes/package_deb.bbclass
meta/classes/package_ipk.bbclass
meta/classes/package_rpm.bbclass
meta/classes/package_tar.bbclass

index 54c30f7b8fa450b38e36bbd314e11ee78dd4f7f8..3a393a04db5bd7af2f94f6498a4fd83314999bab 100644 (file)
@@ -565,7 +565,7 @@ do_populate_staging[dirs] = "${STAGING_DIR}/${TARGET_SYS}/bin ${STAGING_DIR}/${T
                             ${STAGING_DATADIR} \
                             ${S} ${B}"
 
-addtask populate_staging after do_package
+addtask populate_staging after do_package_write
 
 python do_populate_staging () {
        bb.build.exec_func('do_stage', d)
index 698d917b512eadcf58bfb5d1ccb354e2043e94c3..7ffa6c1a2778a67598a6a71c8ce806f1850b5fca 100644 (file)
@@ -8,7 +8,7 @@ BUILD_ALL_DEPS = "1"
 
 # Better expressed as ensure all RDEPENDS package before we package
 # This means we can't have circular RDEPENDS/RRECOMMENDS
-do_package[rdeptask] = "do_package"
+do_package_write[rdeptask] = "do_package"
 
 python debian_package_name_hook () {
        import glob, copy, stat, errno, re
index 271c8f585cacbc4f61badad642efe99d9783802c..a429e43c44a3c9d74fe0b2a044ce9ecd39a62021 100644 (file)
@@ -451,8 +451,6 @@ python populate_packages () {
                        if found == False:
                                bb.note("%s contains dangling symlink to %s" % (pkg, l))
                bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
-
-       bb.build.exec_func('emit_pkgdata', d)
 }
 populate_packages[dirs] = "${D}"
 
@@ -482,6 +480,11 @@ python emit_pkgdata() {
                write_if_exists(sf, pkg, 'DESCRIPTION')
                write_if_exists(sf, pkg, 'RDEPENDS')
                write_if_exists(sf, pkg, 'RPROVIDES')
+               write_if_exists(sf, pkg, 'RRECOMMENDS')
+               write_if_exists(sf, pkg, 'RSUGGESTS')
+               write_if_exists(sf, pkg, 'RPROVIDES')
+               write_if_exists(sf, pkg, 'RREPLACES')
+               write_if_exists(sf, pkg, 'RCONFLICTS')
                write_if_exists(sf, pkg, 'PKG')
                write_if_exists(sf, pkg, 'ALLOW_EMPTY')
                write_if_exists(sf, pkg, 'FILES')
@@ -490,7 +493,6 @@ python emit_pkgdata() {
                write_if_exists(sf, pkg, 'pkg_preinst')
                write_if_exists(sf, pkg, 'pkg_prerm')
                sf.close()
-       bb.build.exec_func("read_subpackage_metadata", d)
 }
 emit_pkgdata[dirs] = "${STAGING_DIR}/pkgdata/runtime"
 
@@ -822,29 +824,48 @@ python package_depchains() {
 }
 
 
-PACKAGEFUNCS = "package_do_split_locales \
+
+PACKAGEFUNCS ?= "package_do_split_locales \
                populate_packages \
                package_do_shlibs \
                package_do_pkgconfig \
                read_shlibdeps \
-               package_depchains"
+               package_depchains \
+               emit_pkgdata"
 
 python package_do_package () {
        for f in (bb.data.getVar('PACKAGEFUNCS', d, 1) or '').split():
                bb.build.exec_func(f, d)
 }
-
-do_package[dirs] = "${D}"
 # shlibs requires any DEPENDS to have already packaged for the *.list files
 do_package[deptask] = "do_package"
-EXPORT_FUNCTIONS do_package
+do_package[dirs] = "${D}"
 addtask package before do_build after do_install
 
+
+
+PACKAGE_WRITE_FUNCS ?= "read_subpackage_metadata"
+
+python package_do_package_write () {
+       for f in (bb.data.getVar('PACKAGE_WRITE_FUNCS', d, 1) or '').split():
+               bb.build.exec_func(f, d)
+}
+do_package_write[dirs] = "${D}"
+addtask package_write before do_build after do_package
+
+
+EXPORT_FUNCTIONS do_package do_package_write
+
+
 #
 # Helper functions for the package writing classes
 #
 
 python package_mapping_rename_hook () {
+       """
+       Rewrite variables to account for package renaming in things
+       like debian.bbclass or manual PKG variable name changes
+       """
        runtime_mapping_rename("RDEPENDS", d)
        runtime_mapping_rename("RRECOMMENDS", d)
        runtime_mapping_rename("RSUGGESTS", d)
index de93593c95a4237f663738b41057f211ceb99fc0..c19a9249d56e6bbea12e2e4b166d0dedcf4eb266 100644 (file)
@@ -2,7 +2,7 @@ inherit package
 DEPENDS_prepend="${@["dpkg-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}"
 BOOTSTRAP_EXTRA_RDEPENDS += "dpkg"
 DISTRO_EXTRA_RDEPENDS += "dpkg"
-PACKAGEFUNCS += "do_package_deb"
+PACKAGE_WRITE_FUNCS += "do_package_deb"
 IMAGE_PKGTYPE ?= "deb"
 
 python package_deb_fn () {
index f297381f87b27fe23d1e7888e3989969e8b32ac4..54fecf665959da9d0bcf8f11e5b6142dd9854327 100644 (file)
@@ -2,7 +2,7 @@ inherit package
 DEPENDS_prepend="${@["ipkg-utils-native ", ""][(bb.data.getVar('PACKAGES', d, 1) == '')]}"
 BOOTSTRAP_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
 DISTRO_EXTRA_RDEPENDS += "ipkg-collateral ipkg ipkg-link"
-PACKAGEFUNCS += "do_package_ipk"
+PACKAGE_WRITE_FUNCS += "do_package_ipk"
 IMAGE_PKGTYPE ?= "ipk"
 
 python package_ipk_fn () {
index ee579bed55d449813c9800e8b42e5a5e1bc5a081..4955792916b5cde448cf885e62db5ac246fb41dc 100644 (file)
@@ -2,7 +2,7 @@ inherit package
 inherit rpm_core
 
 RPMBUILD="rpmbuild --short-circuit ${RPMOPTS}"
-PACKAGEFUNCS += "do_package_rpm"
+PACKAGE_WRITE_FUNCS += "do_package_rpm"
 IMAGE_PKGTYPE ?= "rpm"
 
 python write_specfile() {
index d8c7919c3abe3699bd83ee3505f6241e678fb7d0..81ae0f84a06de5be80cfdf0b57193f7846b942f1 100644 (file)
@@ -1,6 +1,6 @@
 inherit package
 
-PACKAGEFUNCS += "do_package_tar"
+PACKAGE_WRITE_FUNCS += "do_package_tar"
 IMAGE_PKGTYPE ?= "tar"
 
 python package_tar_fn () {