mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 03:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
0db0e1851c
commit
fed5d9c8f0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user