diff options
| author | Juan M Cruz Alcaraz <juan.m.cruz.alcaraz@linux.intel.com> | 2017-07-25 16:07:52 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-30 08:46:19 +0100 |
| commit | 1305b64ffe6e7b1ab543a25965c0e2e1501c63e9 (patch) | |
| tree | 8d2785d4a7f88179e6d49acd2bf57dfce548edc1 | |
| parent | 68e5381691b059e69671fc4c34260c7d8a550634 (diff) | |
| download | poky-1305b64ffe6e7b1ab543a25965c0e2e1501c63e9.tar.gz | |
package/bbclass: sources are packaged separately from debug.
The configuration variable PACKAGE_DEBUG_SPLIT_STYLE includes
the new mode debug-with-srcpkg that instructs the system to
remove the source files from the debug package but include them in
a separate package with a "-src" suffix in the name.
[YOCTO #9998]
(From OE-Core rev: b8f9ffa37f67172a01837c88c861dc736d267569)
Signed-off-by: Juan M Cruz Alcaraz <juan.m.cruz.alcaraz@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/package.bbclass | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index cc466bd1b2..d2fa6175e6 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
| @@ -879,6 +879,11 @@ python split_and_strip_files () { | |||
| 879 | debugdir = "/.debug" | 879 | debugdir = "/.debug" |
| 880 | debuglibdir = "" | 880 | debuglibdir = "" |
| 881 | debugsrcdir = "" | 881 | debugsrcdir = "" |
| 882 | elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg': | ||
| 883 | debugappend = "" | ||
| 884 | debugdir = "/.debug" | ||
| 885 | debuglibdir = "" | ||
| 886 | debugsrcdir = "/usr/src/debug" | ||
| 882 | else: | 887 | else: |
| 883 | # Original OE-core, a.k.a. ".debug", style debug info | 888 | # Original OE-core, a.k.a. ".debug", style debug info |
| 884 | debugappend = "" | 889 | debugappend = "" |
| @@ -1092,6 +1097,15 @@ python populate_packages () { | |||
| 1092 | 1097 | ||
| 1093 | autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False) | 1098 | autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False) |
| 1094 | 1099 | ||
| 1100 | split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg') | ||
| 1101 | |||
| 1102 | # If debug-with-srcpkg mode is enabled then the src package is added | ||
| 1103 | # into the package list and the source directory as its main content | ||
| 1104 | if split_source_package: | ||
| 1105 | src_package_name = ('%s-src' % d.getVar('PN')) | ||
| 1106 | packages += (' ' + src_package_name) | ||
| 1107 | d.setVar('FILES_%s' % src_package_name, '/usr/src/debug') | ||
| 1108 | |||
| 1095 | # Sanity check PACKAGES for duplicates | 1109 | # Sanity check PACKAGES for duplicates |
| 1096 | # Sanity should be moved to sanity.bbclass once we have the infrastucture | 1110 | # Sanity should be moved to sanity.bbclass once we have the infrastucture |
| 1097 | package_list = [] | 1111 | package_list = [] |
| @@ -1100,7 +1114,12 @@ python populate_packages () { | |||
| 1100 | if pkg in package_list: | 1114 | if pkg in package_list: |
| 1101 | msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg | 1115 | msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg |
| 1102 | package_qa_handle_error("packages-list", msg, d) | 1116 | package_qa_handle_error("packages-list", msg, d) |
| 1103 | elif autodebug and pkg.endswith("-dbg"): | 1117 | # If debug-with-srcpkg mode is enabled then the src package will have |
| 1118 | # priority over dbg package when assigning the files. | ||
| 1119 | # This allows src package to include source files and remove them from dbg. | ||
| 1120 | elif split_source_package and pkg.endswith("-src"): | ||
| 1121 | package_list.insert(0, pkg) | ||
| 1122 | elif autodebug and pkg.endswith("-dbg") and not split_source_package: | ||
| 1104 | package_list.insert(0, pkg) | 1123 | package_list.insert(0, pkg) |
| 1105 | else: | 1124 | else: |
| 1106 | package_list.append(pkg) | 1125 | package_list.append(pkg) |
| @@ -1460,7 +1479,7 @@ python package_do_filedeps() { | |||
| 1460 | for pkg in packages.split(): | 1479 | for pkg in packages.split(): |
| 1461 | if d.getVar('SKIP_FILEDEPS_' + pkg) == '1': | 1480 | if d.getVar('SKIP_FILEDEPS_' + pkg) == '1': |
| 1462 | continue | 1481 | continue |
| 1463 | if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-'): | 1482 | if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-') or pkg.endswith('-src'): |
| 1464 | continue | 1483 | continue |
| 1465 | for files in chunks(pkgfiles[pkg], 100): | 1484 | for files in chunks(pkgfiles[pkg], 100): |
| 1466 | pkglist.append((pkg, files, rpmdeps, pkgdest, magic)) | 1485 | pkglist.append((pkg, files, rpmdeps, pkgdest, magic)) |
| @@ -1578,7 +1597,7 @@ python package_do_shlibs() { | |||
| 1578 | combos.append("-".join(options[0:i])) | 1597 | combos.append("-".join(options[0:i])) |
| 1579 | return combos | 1598 | return combos |
| 1580 | 1599 | ||
| 1581 | if (file.endswith('.dylib') or file.endswith('.so')) and not pkg.endswith('-dev') and not pkg.endswith('-dbg'): | 1600 | if (file.endswith('.dylib') or file.endswith('.so')) and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-src'): |
| 1582 | # Drop suffix | 1601 | # Drop suffix |
| 1583 | name = os.path.basename(file).rsplit(".",1)[0] | 1602 | name = os.path.basename(file).rsplit(".",1)[0] |
| 1584 | # Find all combinations | 1603 | # Find all combinations |
