From: Jan Kiszka <
jan.k...@siemens.com>
Only the former needs locking, and the latter benefits from clearer
naming: do_prepare_build is supposed to run prior to the build. The
dependency installation task is now from the user perspective part of
the build again, even when run separately directly before it.
Signed-off-by: Jan Kiszka <
jan.k...@siemens.com>
---
meta/classes/dpkg-base.bbclass | 24 +++++++++---------------
meta/classes/dpkg-raw.bbclass | 4 ++--
meta/classes/dpkg.bbclass | 8 ++++++--
meta/recipes-kernel/linux-module/module.inc | 2 +-
4 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 6299ef8..a2d2ff0 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -15,7 +15,7 @@ python __anonymous() {
dep = "buildchroot-host:do_build"
rootfs = d.getVar('BUILDCHROOT_HOST_DIR', True)
- d.setVarFlag('do_prepare', 'depends', dep)
+ d.setVarFlag('do_prepare_build', 'depends', dep)
d.setVar('BUILDCHROOT_DIR', rootfs)
}
@@ -48,11 +48,17 @@ PPS ?= "${@get_package_srcdir(d)}"
BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-# Empty do_prepare() implementation, to be overwritten if needed
-dpkg_prepare() {
+# Empty do_prepare_build() implementation, to be overwritten if needed
+do_prepare_build() {
true
}
+addtask prepare_build after do_patch before do_build
+do_prepare_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
+# If Isar recipes depend on each other, they typically need the package
+# deployed to isar-apt
+do_prepare_build[deptask] = "do_deploy_deb"
+
MOUNT_LOCKFILE = "${BUILDCHROOT_DIR}/mount.lock"
# Wrap the function dpkg_runbuild with the bind mount for buildroot
@@ -75,18 +81,6 @@ dpkg_undo_mounts() {
sudo rmdir ${BUILDROOT} 2>/dev/null || true
}
-do_prepare() {
- dpkg_do_mounts
- dpkg_prepare
- dpkg_undo_mounts
-}
-
-addtask prepare after do_patch before do_build
-do_prepare[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-# If Isar recipes depend on each other, they typically need the package
-# deployed to isar-apt
-do_prepare[deptask] = "do_deploy_deb"
-
# Placeholder for actual dpkg_runbuild() implementation
dpkg_runbuild() {
die "This should never be called, overwrite it in your derived class"
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index c5f1c88..c848f3d 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -14,7 +14,7 @@ do_install() {
}
do_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
-addtask install after do_unpack before do_prepare
+addtask install after do_unpack before do_prepare_build
deb_package_prepare() {
sudo rm -rf ${D}/DEBIAN
@@ -48,7 +48,7 @@ deb_package_conffiles() {
test -s $CONFFILES || rm $CONFFILES
}
-dpkg_prepare() {
+do_prepare_build() {
deb_package_prepare
deb_package_conffiles
}
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 2e53c1b..fd9656f 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -4,13 +4,17 @@
inherit dpkg-base
# Install build dependencies for package
-dpkg_prepare() {
+do_install_builddeps() {
+ dpkg_do_mounts
E="${@ bb.utils.export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH}
+ dpkg_undo_mounts
}
+addtask install_builddeps after do_prepare_build before do_build
# apt and reprepro may not run in parallel, acquire the Isar lock
-do_prepare[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock"
+do_install_builddeps[lockfiles] = "${DEPLOY_DIR_APT}/isar.lock"
+do_install_builddeps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
# Build package from sources using build script
dpkg_runbuild() {
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index 7bc29a8..08d2c25 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -17,7 +17,7 @@ AUTOLOAD ?= "0"
inherit dpkg
-do_prepare_prepend() {
+do_prepare_build() {
cp -r ${WORKDIR}/debian ${S}/
sed -i -e 's/@PN@/${PN}/g' -e 's/@PV@/${PV}/g' \
-e 's/@KERNEL_NAME@/${KERNEL_NAME}/g' \
--
2.16.4