summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass28
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)