summaryrefslogtreecommitdiffstats
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-16 11:56:30 +0000
commitb7766e4bbe61d025346365de4cbafcae56909c27 (patch)
treeebcd60ba21718a84ddf42491ef978fd501d4fd09 /meta/classes/package.bbclass
parent89f13c75eae2fdc2859246c0f9c4122728adffb7 (diff)
downloadpoky-b7766e4bbe61d025346365de4cbafcae56909c27.tar.gz
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". (From OE-Core rev: da5ec06814e105451cca11cce76b5c5231110524) 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 () {
1039 1039
1040 bb.utils.mkdirhier(outdir) 1040 bb.utils.mkdirhier(outdir)
1041 os.chdir(dvar) 1041 os.chdir(dvar)
1042
1043 autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG", True) or False)
1042 1044
1043 # Sanity check PACKAGES for duplicates 1045 # Sanity check PACKAGES for duplicates
1044 # Sanity should be moved to sanity.bbclass once we have the infrastucture 1046 # Sanity should be moved to sanity.bbclass once we have the infrastucture
@@ -1048,6 +1050,8 @@ python populate_packages () {
1048 if pkg in package_list: 1050 if pkg in package_list:
1049 msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg 1051 msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
1050 package_qa_handle_error("packages-list", msg, d) 1052 package_qa_handle_error("packages-list", msg, d)
1053 elif autodebug and pkg.endswith("-dbg"):
1054 package_list.insert(0, pkg)
1051 else: 1055 else:
1052 package_list.append(pkg) 1056 package_list.append(pkg)
1053 d.setVar('PACKAGES', ' '.join(package_list)) 1057 d.setVar('PACKAGES', ' '.join(package_list))
@@ -1058,6 +1062,16 @@ python populate_packages () {
1058 # os.mkdir masks the permissions with umask so we have to unset it first 1062 # os.mkdir masks the permissions with umask so we have to unset it first
1059 oldumask = os.umask(0) 1063 oldumask = os.umask(0)
1060 1064
1065 debug = []
1066 for root, dirs, files in cpath.walk(dvar):
1067 dir = root[len(dvar):]
1068 if not dir:
1069 dir = os.sep
1070 for f in (files + dirs):
1071 path = "." + os.path.join(dir, f)
1072 if "/.debug/" in path or path.endswith("/.debug"):
1073 debug.append(path)
1074
1061 for pkg in package_list: 1075 for pkg in package_list:
1062 root = os.path.join(pkgdest, pkg) 1076 root = os.path.join(pkgdest, pkg)
1063 bb.utils.mkdirhier(root) 1077 bb.utils.mkdirhier(root)
@@ -1071,6 +1085,9 @@ python populate_packages () {
1071 origfiles = filesvar.split() 1085 origfiles = filesvar.split()
1072 files = files_from_filevars(origfiles) 1086 files = files_from_filevars(origfiles)
1073 1087
1088 if autodebug and pkg.endswith("-dbg"):
1089 files.extend(debug)
1090
1074 for file in files: 1091 for file in files:
1075 if (not cpath.islink(file)) and (not cpath.exists(file)): 1092 if (not cpath.islink(file)) and (not cpath.exists(file)):
1076 continue 1093 continue