diff options
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-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 |