aboutsummaryrefslogtreecommitdiffstats
path: root/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-10-30 00:08:19 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-09 12:32:21 +0000
commit29c7d3351f43678c6e93b707b301832009f64b31 (patch)
treeb9efdab13022465251708c8343afa6396a32078d /classes/package.bbclass
parentc41e3631d31a1932fcbb0098eab0520f90711cc3 (diff)
downloadopenembedded-29c7d3351f43678c6e93b707b301832009f64b31.tar.gz
package.bbclass: Change to operate on a copy of the install directory instead of directly. Also take the opportunity to rename the temp directories so their function is clear (from Poky)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r--classes/package.bbclass35
1 files changed, 24 insertions, 11 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index 2c085be797..03618ba6fc 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -2,7 +2,8 @@
# General packaging help functions
#
-PKGDEST = "${WORKDIR}/install"
+PKGD = "${WORKDIR}/package"
+PKGDEST = "${WORKDIR}/packages-split"
def legitimize_package_name(s):
"""
@@ -28,7 +29,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
"""
import os, os.path, bb
- dvar = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
packages = bb.data.getVar('PACKAGES', d, True).split()
@@ -299,7 +300,7 @@ python package_do_split_locales() {
bb.note("datadir not defined")
return
- dvar = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
pn = bb.data.getVar('PN', d, True)
if pn + '-locale' in packages:
@@ -333,19 +334,29 @@ python package_do_split_locales() {
bb.data.setVar('PACKAGES', ' '.join(packages), d)
}
+python perform_packagecopy () {
+ import os
+
+ dest = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
+
+ bb.mkdirhier(dvar)
+
+ # Start by package population by taking a copy of the installed
+ # files to operate on
+ os.system('cp -pPR %s/* %s/' % (dest, dvar))
+}
+
python populate_packages () {
import os, glob, stat, errno, re
workdir = bb.data.getVar('WORKDIR', d, True)
outdir = bb.data.getVar('DEPLOY_DIR', d, True)
- dvar = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
packages = bb.data.getVar('PACKAGES', d, True)
pn = bb.data.getVar('PN', d, True)
bb.mkdirhier(outdir)
- bb.mkdirhier(dvar)
-
-
os.chdir(dvar)
def isexec(path):
@@ -981,7 +992,8 @@ python package_depchains() {
}
-PACKAGEFUNCS ?= "package_do_split_locales \
+PACKAGEFUNCS ?= "perform_packagecopy \
+ package_do_split_locales \
populate_packages \
package_do_shlibs \
package_do_pkgconfig \
@@ -1029,11 +1041,12 @@ python package_do_package () {
workdir = bb.data.getVar('WORKDIR', d, True)
outdir = bb.data.getVar('DEPLOY_DIR', d, True)
- dvar = bb.data.getVar('D', d, True)
+ dest = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
pn = bb.data.getVar('PN', d, True)
- if not workdir or not outdir or not dvar or not pn or not packages:
- bb.error("WORKDIR, DEPLOY_DIR, D, and PN all must be defined, unable to package")
+ if not workdir or not outdir or not dest or not dvar or not pn or not packages:
+ bb.error("WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package")
return
for f in (bb.data.getVar('PACKAGEFUNCS', d, True) or '').split():