diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-03-06 10:32:30 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-06 23:12:27 +0000 |
commit | ccc413fd93f5e7572afd50bbfac8532f07fed9b1 (patch) | |
tree | 4d985e403ea574ce22896e258a5dc1f6b2f65b00 /meta/classes | |
parent | bb4597c4d96b8b8f37e06bfca954826599049b0e (diff) | |
download | poky-ccc413fd93f5e7572afd50bbfac8532f07fed9b1.tar.gz |
Add source package to ${PACKAGES}
Permanently adds the -src source package to ${PACKAGES} instead of
relying on creating it dynamically at packaging time. The source package
is now defined in bitbake.conf, just like -dev and -dbg packages.
For compatibility, the -src package is still added dynamically if it was
missing, since some recipes have a tendency to completely override
PACKAGES and do so without manually adding back the -src package.
This allows RDEPENDS on the -src packages, which wasn't previously
possible.
[YOCTO #13203]
(From OE-Core rev: b25e1edf0204fc2f64aa8d66e09b8e2d67b90e17)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package.bbclass | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index 749c7d9ea1..4c0a859536 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -1128,7 +1128,7 @@ python populate_packages () { | |||
1128 | workdir = d.getVar('WORKDIR') | 1128 | workdir = d.getVar('WORKDIR') |
1129 | outdir = d.getVar('DEPLOY_DIR') | 1129 | outdir = d.getVar('DEPLOY_DIR') |
1130 | dvar = d.getVar('PKGD') | 1130 | dvar = d.getVar('PKGD') |
1131 | packages = d.getVar('PACKAGES') | 1131 | packages = d.getVar('PACKAGES').split() |
1132 | pn = d.getVar('PN') | 1132 | pn = d.getVar('PN') |
1133 | 1133 | ||
1134 | bb.utils.mkdirhier(outdir) | 1134 | bb.utils.mkdirhier(outdir) |
@@ -1138,32 +1138,34 @@ python populate_packages () { | |||
1138 | 1138 | ||
1139 | split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg') | 1139 | split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg') |
1140 | 1140 | ||
1141 | # If debug-with-srcpkg mode is enabled then the src package is added | 1141 | # If debug-with-srcpkg mode is enabled then add the source package if it |
1142 | # into the package list and the source directory as its main content | 1142 | # doesn't exist and add the source file contents to the source package. |
1143 | if split_source_package: | 1143 | if split_source_package: |
1144 | src_package_name = ('%s-src' % d.getVar('PN')) | 1144 | src_package_name = ('%s-src' % d.getVar('PN')) |
1145 | packages += (' ' + src_package_name) | 1145 | if not src_package_name in packages: |
1146 | packages.append(src_package_name) | ||
1146 | d.setVar('FILES_%s' % src_package_name, '/usr/src/debug') | 1147 | d.setVar('FILES_%s' % src_package_name, '/usr/src/debug') |
1147 | 1148 | ||
1148 | # Sanity check PACKAGES for duplicates | 1149 | # Sanity check PACKAGES for duplicates |
1149 | # Sanity should be moved to sanity.bbclass once we have the infrastructure | 1150 | # Sanity should be moved to sanity.bbclass once we have the infrastructure |
1150 | package_dict = {} | 1151 | package_dict = {} |
1151 | 1152 | ||
1152 | for i, pkg in enumerate(packages.split()): | 1153 | for i, pkg in enumerate(packages): |
1153 | if pkg in package_dict: | 1154 | if pkg in package_dict: |
1154 | msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg | 1155 | msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg |
1155 | package_qa_handle_error("packages-list", msg, d) | 1156 | package_qa_handle_error("packages-list", msg, d) |
1156 | # If debug-with-srcpkg mode is enabled then the src package will have | 1157 | # Ensure the source package gets the chance to pick up the source files |
1157 | # priority over dbg package when assigning the files. | 1158 | # before the debug package by ordering it first in PACKAGES. Whether it |
1158 | # This allows src package to include source files and remove them from dbg. | 1159 | # actually picks up any source files is controlled by |
1159 | elif split_source_package and pkg.endswith("-src"): | 1160 | # PACKAGE_DEBUG_SPLIT_STYLE. |
1161 | elif pkg.endswith("-src"): | ||
1160 | package_dict[pkg] = (10, i) | 1162 | package_dict[pkg] = (10, i) |
1161 | elif autodebug and pkg.endswith("-dbg"): | 1163 | elif autodebug and pkg.endswith("-dbg"): |
1162 | package_dict[pkg] = (30, i) | 1164 | package_dict[pkg] = (30, i) |
1163 | else: | 1165 | else: |
1164 | package_dict[pkg] = (50, i) | 1166 | package_dict[pkg] = (50, i) |
1165 | package_list = sorted(package_dict.keys(), key=package_dict.get) | 1167 | packages = sorted(package_dict.keys(), key=package_dict.get) |
1166 | d.setVar('PACKAGES', ' '.join(package_list)) | 1168 | d.setVar('PACKAGES', ' '.join(packages)) |
1167 | pkgdest = d.getVar('PKGDEST') | 1169 | pkgdest = d.getVar('PKGDEST') |
1168 | 1170 | ||
1169 | seen = [] | 1171 | seen = [] |
@@ -1181,7 +1183,7 @@ python populate_packages () { | |||
1181 | if "/.debug/" in path or path.endswith("/.debug"): | 1183 | if "/.debug/" in path or path.endswith("/.debug"): |
1182 | debug.append(path) | 1184 | debug.append(path) |
1183 | 1185 | ||
1184 | for pkg in package_list: | 1186 | for pkg in packages: |
1185 | root = os.path.join(pkgdest, pkg) | 1187 | root = os.path.join(pkgdest, pkg) |
1186 | bb.utils.mkdirhier(root) | 1188 | bb.utils.mkdirhier(root) |
1187 | 1189 | ||
@@ -1252,7 +1254,7 @@ python populate_packages () { | |||
1252 | 1254 | ||
1253 | # Handle LICENSE_EXCLUSION | 1255 | # Handle LICENSE_EXCLUSION |
1254 | package_list = [] | 1256 | package_list = [] |
1255 | for pkg in packages.split(): | 1257 | for pkg in packages: |
1256 | if d.getVar('LICENSE_EXCLUSION-' + pkg): | 1258 | if d.getVar('LICENSE_EXCLUSION-' + pkg): |
1257 | msg = "%s has an incompatible license. Excluding from packaging." % pkg | 1259 | msg = "%s has an incompatible license. Excluding from packaging." % pkg |
1258 | package_qa_handle_error("incompatible-license", msg, d) | 1260 | package_qa_handle_error("incompatible-license", msg, d) |