summaryrefslogtreecommitdiff
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-15 15:38:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-15 15:44:02 +0000
commitda5ec06814e105451cca11cce76b5c5231110524 (patch)
tree26509c91f86257e03e75b51f027af5c6ae65e855 /meta/classes/package.bbclass
parent674fdfd018e0daea561dddc4f8e38eceee685c7a (diff)
downloadopenembedded-core-da5ec06814e105451cca11cce76b5c5231110524.tar.gz
openembedded-core-da5ec06814e105451cca11cce76b5c5231110524.tar.bz2
openembedded-core-da5ec06814e105451cca11cce76b5c5231110524.zip
package: Add auto package splitting of .debug files
Creating FILES_${PN}-dbg is tedious and also pretty pointless. We might as well assume ".debug" is a special directory name and split into -dbg automatically. This change does so without changing the rest of the splitting logic too much. It can be disabled for the cases where we really do want manual control of the -dbg packages (e.g. qt4) with NOAUTOPACKAGEDEBUG = "1". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2bae34189d..54f7ae55cf 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1039,6 +1039,8 @@ python populate_packages () {
bb.utils.mkdirhier(outdir)
os.chdir(dvar)
+
+ autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG", True) or False)
# Sanity check PACKAGES for duplicates
# Sanity should be moved to sanity.bbclass once we have the infrastucture
@@ -1048,6 +1050,8 @@ python populate_packages () {
if pkg in package_list:
msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
package_qa_handle_error("packages-list", msg, d)
+ elif autodebug and pkg.endswith("-dbg"):
+ package_list.insert(0, pkg)
else:
package_list.append(pkg)
d.setVar('PACKAGES', ' '.join(package_list))
@@ -1058,6 +1062,16 @@ python populate_packages () {
# os.mkdir masks the permissions with umask so we have to unset it first
oldumask = os.umask(0)
+ debug = []
+ for root, dirs, files in cpath.walk(dvar):
+ dir = root[len(dvar):]
+ if not dir:
+ dir = os.sep
+ for f in (files + dirs):
+ path = "." + os.path.join(dir, f)
+ if "/.debug/" in path or path.endswith("/.debug"):
+ debug.append(path)
+
for pkg in package_list:
root = os.path.join(pkgdest, pkg)
bb.utils.mkdirhier(root)
@@ -1071,6 +1085,9 @@ python populate_packages () {
origfiles = filesvar.split()
files = files_from_filevars(origfiles)
+ if autodebug and pkg.endswith("-dbg"):
+ files.extend(debug)
+
for file in files:
if (not cpath.islink(file)) and (not cpath.exists(file)):
continue