[OE-core] [PATCH 15/22] package.bbclass: Make use of cleandirs and dirs function flags
Richard Purdie
richard.purdie at linuxfoundation.org
Sun Feb 3 23:55:45 UTC 2013
We can use the cleandirs and dirs flags for the fuctions to handle
directory cleaning and creation at the bitbake level rather than
using these calls within the functions
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/package.bbclass | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 7e45655..22ca546 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -429,11 +429,8 @@ python perform_packagecopy () {
dest = d.getVar('D', True)
dvar = d.getVar('PKGD', True)
- bb.mkdirhier(dvar)
-
# Start by package population by taking a copy of the installed
# files to operate on
- subprocess.call('rm -rf %s/*' % (dvar), shell=True)
# Preserve sparse files and hard links
subprocess.call('tar -cf - -C %s -ps . | tar -xf - -C %s' % (dest, dvar), shell=True)
@@ -441,6 +438,8 @@ python perform_packagecopy () {
if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross-canadian', d):
rpath_replace (dvar, d)
}
+perform_packagecopy[cleandirs] = "${PKGD}"
+perform_packagecopy[dirs] = "${PKGD}"
# We generate a master list of directories to process, we start by
# seeding this list with reasonable defaults, then load from
@@ -897,7 +896,6 @@ python populate_packages () {
package_list.append(pkg)
d.setVar('PACKAGES', ' '.join(package_list))
pkgdest = d.getVar('PKGDEST', True)
- subprocess.call('rm -rf %s' % pkgdest, shell=True)
seen = []
@@ -1823,7 +1821,7 @@ addtask package before do_build after do_install
PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
SSTATETASKS += "do_package"
do_package[sstate-name] = "package"
-do_package[cleandirs] = "${PKGDESTWORK}"
+do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
do_package[sstate-lockfile-shared] = "${PACKAGELOCK}"
do_package_setscene[dirs] = "${STAGING_DIR}"
--
1.7.10.4
More information about the Openembedded-core
mailing list