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
This commit is contained in:
Richard Purdie
2006-10-20 16:09:05 +00:00
parent 49d42d9fe6
commit e2b821a834
7 changed files with 35 additions and 14 deletions

View 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)

View 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

View 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)

View 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 () {

View 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 () {

View 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() {

View File

@@ -1,6 +1,6 @@
inherit package
PACKAGEFUNCS += "do_package_tar"
PACKAGE_WRITE_FUNCS += "do_package_tar"
IMAGE_PKGTYPE ?= "tar"
python package_tar_fn () {