summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-12 23:01:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-13 06:18:49 +0100
commit1847d2aa40aa942b14e901634121c1bd3171c9be (patch)
treefdf4ec9cd4d2a939b283eee2c4964491bcc09a7c /meta/lib/oe/package.py
parentbd07f8c9adaee9a1bdd38d2377c9ffaabbb5a469 (diff)
downloadpoky-1847d2aa40aa942b14e901634121c1bd3171c9be.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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package.py')
-rw-r--r--meta/lib/oe/package.py47
1 files changed, 20 insertions, 27 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 811d27964b..52c5f16cf8 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -57,51 +57,44 @@ def file_translate(file):
57def filedeprunner(arg): 57def filedeprunner(arg):
58 import re, subprocess, shlex 58 import re, subprocess, shlex
59 59
60 (pkg, pkgfiles, rpmdeps, pkgdest) = arg 60 (pkg, pkgfiles, rpmdeps, pkgdest, magic) = arg
61 provides = {} 61 provides = {}
62 requires = {} 62 requires = {}
63 63
64 file_re = re.compile(r'\s+\d+\s(.*)') 64 r = re.compile(r'[<>=]+ +[^ ]*')
65 dep_re = re.compile(r'\s+(\S)\s+(.*)')
66 r = re.compile(r'[<>=]+\s+\S*')
67 65
68 def process_deps(pipe, pkg, pkgdest, provides, requires): 66 def process_deps(pipe, pkg, pkgdest, provides, requires):
69 file = None
70 for line in pipe: 67 for line in pipe:
71 line = line.decode("utf-8") 68 f = line.decode("utf-8").split(" ", 1)[0].strip()
69 line = line.decode("utf-8").split(" ", 1)[1].strip()
72 70
73 m = file_re.match(line) 71 if line.startswith("Requires:"):
74 if m:
75 file = m.group(1)
76 file = file.replace(pkgdest + "/" + pkg, "")
77 file = file_translate(file)
78 continue
79
80 m = dep_re.match(line)
81 if not m or not file:
82 continue
83
84 type, dep = m.groups()
85
86 if type == 'R':
87 i = requires 72 i = requires
88 elif type == 'P': 73 elif line.startswith("Provides:"):
89 i = provides 74 i = provides
90 else: 75 else:
91 continue
92
93 if dep.startswith("python("):
94 continue 76 continue
95 dep = r.sub(r'(\g<0>)',dep)
96 77
78 file = f.replace(pkgdest + "/" + pkg, "")
79 file = file_translate(file)
80 value = line.split(":", 1)[1].strip()
81 value = r.sub(r'(\g<0>)', value)
82
83 if value.startswith("rpmlib("):
84 continue
85 if value == "python":
86 continue
97 if file not in i: 87 if file not in i:
98 i[file] = [] 88 i[file] = []
99 i[file].append(dep) 89 i[file].append(value)
100 90
101 return provides, requires 91 return provides, requires
102 92
93 env = os.environ.copy()
94 env["MAGIC"] = magic
95
103 try: 96 try:
104 dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE) 97 dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE, env=env)
105 provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires) 98 provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)
106 except OSError as e: 99 except OSError as e:
107 bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e)) 100 bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e))