aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-08-29 23:21:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-30 23:59:52 +0100
commit37f2d4df507c760ea4c12b67526db8277e5684eb (patch)
treef66ad1d3e0d8572076e5df16737aed2a6b499e48
parenta803938407ee5a55fb40a6940bb6680ba21909b0 (diff)
downloadopenembedded-core-37f2d4df507c760ea4c12b67526db8277e5684eb.zip
openembedded-core-37f2d4df507c760ea4c12b67526db8277e5684eb.tar.gz
openembedded-core-37f2d4df507c760ea4c12b67526db8277e5684eb.tar.bz2
package_rpm.bbclass: Filter out unwanted file deps for nativesdk packages
Filter out any file dependencies on absolute paths and any dependencies on Perl modules for nativesdk packages. It is assumed that they will be provided by the native host if needed, and they mess up the dependency handling if they are present. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package_rpm.bbclass25
1 files changed, 23 insertions, 2 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 084546f..62324b3 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -7,10 +7,28 @@ RPMBUILD="rpmbuild"
PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
-# Maintaining the perfile dependencies has singificant overhead when writing the
+# Maintaining the perfile dependencies has singificant overhead when writing the
# packages. When set, this value merges them for efficiency.
MERGEPERFILEDEPS = "1"
+# Filter dependencies based on a provided function.
+def filter_deps(var, f):
+ import collections
+
+ depends_dict = bb.utils.explode_dep_versions2(var)
+ newdeps_dict = collections.OrderedDict()
+ for dep in depends_dict:
+ if f(dep):
+ newdeps_dict[dep] = depends_dict[dep]
+ return bb.utils.join_deps(newdeps_dict, commasep=False)
+
+# Filter out absolute paths (typically /bin/sh and /usr/bin/env) and any perl
+# dependencies for nativesdk packages.
+def filter_nativesdk_deps(srcname, var):
+ if var and srcname.startswith("nativesdk-"):
+ var = filter_deps(var, lambda dep: not dep.startswith('/') and dep != 'perl' and not dep.startswith('perl('))
+ return var
+
# Construct per file dependencies file
def write_rpm_perfiledata(srcname, d):
workdir = d.getVar('WORKDIR')
@@ -26,7 +44,8 @@ def write_rpm_perfiledata(srcname, d):
dependsflist = (d.getVar(dependsflist_key) or "")
for dfile in dependsflist.split():
key = "FILE" + varname + "_" + dfile + "_" + pkg
- depends_dict = bb.utils.explode_dep_versions(d.getVar(key) or "")
+ deps = filter_nativesdk_deps(srcname, d.getVar(key) or "")
+ depends_dict = bb.utils.explode_dep_versions(deps)
file = dfile.replace("@underscore@", "_")
file = file.replace("@closebrace@", "]")
file = file.replace("@openbrace@", "[")
@@ -359,6 +378,8 @@ python write_specfile () {
splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d)
splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d)
+ splitrdepends = filter_nativesdk_deps(srcname, splitrdepends)
+
# Gather special src/first package data
if srcname == splitname:
srcrdepends = splitrdepends