package.bbclass: copy dotfiles in root D to PKGD
PATCH 1/1 package.bbclass: copy dotfiles in root D to PKGD
Use shtuil.copytree() to copy D ("image") to PKGD ("package"). The previous system("cp %s/* ...") missed dotfiles/dirs at the top-level.
Relies on Python 2.5+ version of copytree() to create missing path components.
Signed-off-by Michael Smith <[email protected]>
--- classes/package.bbclass | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
classes/package.bbclass +9 -6
@@ -354,15 +354,18 @@ python package_do_split_locales() { } python perform_packagecopy () { - dest = bb.data.getVar('D', d, True) - dvar = bb.data.getVar('PKGD', d, True) + import shutil - bb.mkdirhier(dvar) + installdest = bb.data.getVar('D', d, True) + pkgcopy = bb.data.getVar('PKGD', d, True) - # Start by package population by taking a copy of the installed + # Start package population by taking a copy of the installed # files to operate on - os.system('rm -rf %s/*' % (dvar)) - os.system('cp -pPR %s/* %s/' % (dest, dvar)) + shutil.rmtree(pkgcopy, True) + + # copytree() automatically creates missing path components in pkgcopy. + # Preserve symlinks (don't dereference). + shutil.copytree(installdest, pkgcopy, symlinks=True) } python populate_packages () {
Signature · 1 line
1.7.0.4
Quoted 8 lines · Michael Smith
Use
shtuil.copytree()to copy D ("image") to PKGD ("package"). The previoussystem("cp %s/* ...")missed dotfiles/dirs at the top-level.Relies on Python 2.5+ version of
copytree()to create missing path components.Signed-off-by Michael Smith <[email protected]>
Acked-by Chris Larson <[email protected]>
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics