aboutsummaryrefslogtreecommitdiffstats
path: root/classes/package.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r--classes/package.bbclass38
1 files changed, 25 insertions, 13 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index bb81f33b29..4196135710 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -201,6 +201,26 @@ def runstrip(file, d):
return 1
+PACKAGESTRIPFUNCS += "do_runstrip"
+python do_runstrip() {
+ import stat
+
+ dvar = bb.data.getVar('PKGD', d, True)
+ def isexec(path):
+ try:
+ s = os.stat(path)
+ except (os.error, AttributeError):
+ return 0
+ return (s[stat.ST_MODE] & stat.S_IEXEC)
+
+ for root, dirs, files in os.walk(dvar):
+ for f in files:
+ file = os.path.join(root, f)
+ if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
+ runstrip(file, d)
+}
+
+
def write_package_md5sums (root, outfile, ignorepaths):
# For each regular file under root, writes an md5sum to outfile.
# With thanks to patch.bbclass.
@@ -334,11 +354,12 @@ python perform_packagecopy () {
# Start by 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))
}
python populate_packages () {
- import glob, stat, errno, re,os
+ import glob, errno, re,os
workdir = bb.data.getVar('WORKDIR', d, True)
outdir = bb.data.getVar('DEPLOY_DIR', d, True)
@@ -349,13 +370,6 @@ python populate_packages () {
bb.mkdirhier(outdir)
os.chdir(dvar)
- def isexec(path):
- try:
- s = os.stat(path)
- except (os.error, AttributeError):
- return 0
- return (s[stat.ST_MODE] & stat.S_IEXEC)
-
# Sanity check PACKAGES for duplicates - should be moved to
# sanity.bbclass once we have the infrastucture
package_list = []
@@ -368,12 +382,10 @@ python populate_packages () {
else:
package_list.append(pkg)
+
if (bb.data.getVar('INHIBIT_PACKAGE_STRIP', d, True) != '1'):
- for root, dirs, files in os.walk(dvar):
- for f in files:
- file = os.path.join(root, f)
- if not os.path.islink(file) and not os.path.isdir(file) and isexec(file):
- runstrip(file, d)
+ for f in (bb.data.getVar('PACKAGESTRIPFUNCS', d, True) or '').split():
+ bb.build.exec_func(f, d)
pkgdest = bb.data.getVar('PKGDEST', d, True)
os.system('rm -rf %s' % pkgdest)