diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 23:01:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 23:01:34 +0100 |
commit | 592ef8966295008c96c2a2b4138b16345a7c05b1 (patch) | |
tree | 3841497303e3240ac1bbde74db9a2b5563602079 /meta/lib/oe/package.py | |
parent | aea90e9ee6f34e7c1c08307080b1e29646668df6 (diff) | |
download | openembedded-core-contrib-592ef8966295008c96c2a2b4138b16345a7c05b1.tar.gz |
Revert "package.bbclass: Restore functionality to detect RPM dependencies"
This reverts commit aea90e9ee6f34e7c1c08307080b1e29646668df6.
RP hadn't meant to merge this yet and its causing problems so delay it until its
ready.
Diffstat (limited to 'meta/lib/oe/package.py')
-rw-r--r-- | meta/lib/oe/package.py | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 811d27964bc..52c5f16cf8e 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -57,51 +57,44 @@ def file_translate(file): def filedeprunner(arg): import re, subprocess, shlex - (pkg, pkgfiles, rpmdeps, pkgdest) = arg + (pkg, pkgfiles, rpmdeps, pkgdest, magic) = arg provides = {} requires = {} - file_re = re.compile(r'\s+\d+\s(.*)') - dep_re = re.compile(r'\s+(\S)\s+(.*)') - r = re.compile(r'[<>=]+\s+\S*') + r = re.compile(r'[<>=]+ +[^ ]*') def process_deps(pipe, pkg, pkgdest, provides, requires): - file = None for line in pipe: - line = line.decode("utf-8") + f = line.decode("utf-8").split(" ", 1)[0].strip() + line = line.decode("utf-8").split(" ", 1)[1].strip() - m = file_re.match(line) - if m: - file = m.group(1) - file = file.replace(pkgdest + "/" + pkg, "") - file = file_translate(file) - continue - - m = dep_re.match(line) - if not m or not file: - continue - - type, dep = m.groups() - - if type == 'R': + if line.startswith("Requires:"): i = requires - elif type == 'P': + elif line.startswith("Provides:"): i = provides else: - continue - - if dep.startswith("python("): continue - dep = r.sub(r'(\g<0>)',dep) + file = f.replace(pkgdest + "/" + pkg, "") + file = file_translate(file) + value = line.split(":", 1)[1].strip() + value = r.sub(r'(\g<0>)', value) + + if value.startswith("rpmlib("): + continue + if value == "python": + continue if file not in i: i[file] = [] - i[file].append(dep) + i[file].append(value) return provides, requires + env = os.environ.copy() + env["MAGIC"] = magic + try: - dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE) + dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE, env=env) provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires) except OSError as e: bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e)) |