diff options
author | Peter Kjellerstedt <pkj@axis.com> | 2017-08-15 16:41:55 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-17 00:21:14 +0100 |
commit | fed5d9c8f013c2c6d29b92e874f523555f339cf5 (patch) | |
tree | ad188352513a99560779f6c1b49e6028e395c89f /meta/classes | |
parent | 0db0e1851c8c23cbfbccb9553391fb8da08bf645 (diff) | |
download | poky-fed5d9c8f013c2c6d29b92e874f523555f339cf5.tar.gz |
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.
(From OE-Core rev: ce55e6c6d8b654b5fb21dec8180b471bfd33601a)
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>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 5562074ae4..1deaf832da 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -7,10 +7,28 @@ RPMBUILD="rpmbuild" | |||
7 | 7 | ||
8 | PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" | 8 | PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms" |
9 | 9 | ||
10 | # Maintaining the perfile dependencies has singificant overhead when writing the | 10 | # Maintaining the perfile dependencies has singificant overhead when writing the |
11 | # packages. When set, this value merges them for efficiency. | 11 | # packages. When set, this value merges them for efficiency. |
12 | MERGEPERFILEDEPS = "1" | 12 | MERGEPERFILEDEPS = "1" |
13 | 13 | ||
14 | # Filter dependencies based on a provided function. | ||
15 | def filter_deps(var, f): | ||
16 | import collections | ||
17 | |||
18 | depends_dict = bb.utils.explode_dep_versions2(var) | ||
19 | newdeps_dict = collections.OrderedDict() | ||
20 | for dep in depends_dict: | ||
21 | if f(dep): | ||
22 | newdeps_dict[dep] = depends_dict[dep] | ||
23 | return bb.utils.join_deps(newdeps_dict, commasep=False) | ||
24 | |||
25 | # Filter out absolute paths (typically /bin/sh and /usr/bin/env) and any perl | ||
26 | # dependencies for nativesdk packages. | ||
27 | def filter_nativesdk_deps(srcname, var): | ||
28 | if var and srcname.startswith("nativesdk-"): | ||
29 | var = filter_deps(var, lambda dep: not dep.startswith('/') and dep != 'perl' and not dep.startswith('perl(')) | ||
30 | return var | ||
31 | |||
14 | # Construct per file dependencies file | 32 | # Construct per file dependencies file |
15 | def write_rpm_perfiledata(srcname, d): | 33 | def write_rpm_perfiledata(srcname, d): |
16 | workdir = d.getVar('WORKDIR') | 34 | workdir = d.getVar('WORKDIR') |
@@ -26,7 +44,8 @@ def write_rpm_perfiledata(srcname, d): | |||
26 | dependsflist = (d.getVar(dependsflist_key) or "") | 44 | dependsflist = (d.getVar(dependsflist_key) or "") |
27 | for dfile in dependsflist.split(): | 45 | for dfile in dependsflist.split(): |
28 | key = "FILE" + varname + "_" + dfile + "_" + pkg | 46 | key = "FILE" + varname + "_" + dfile + "_" + pkg |
29 | depends_dict = bb.utils.explode_dep_versions(d.getVar(key) or "") | 47 | deps = filter_nativesdk_deps(srcname, d.getVar(key) or "") |
48 | depends_dict = bb.utils.explode_dep_versions(deps) | ||
30 | file = dfile.replace("@underscore@", "_") | 49 | file = dfile.replace("@underscore@", "_") |
31 | file = file.replace("@closebrace@", "]") | 50 | file = file.replace("@closebrace@", "]") |
32 | file = file.replace("@openbrace@", "[") | 51 | file = file.replace("@openbrace@", "[") |
@@ -359,6 +378,8 @@ python write_specfile () { | |||
359 | splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d) | 378 | splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d) |
360 | splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d) | 379 | splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d) |
361 | 380 | ||
381 | splitrdepends = filter_nativesdk_deps(srcname, splitrdepends) | ||
382 | |||
362 | # Gather special src/first package data | 383 | # Gather special src/first package data |
363 | if srcname == splitname: | 384 | if srcname == splitname: |
364 | srcrdepends = splitrdepends | 385 | srcrdepends = splitrdepends |