<div dir="ltr">This seems to find a many more missed dependencies which is good thing.<div><br></div><div>There is +- 20 failures found in meta-oe recipes and there is still at least one in oe-core:</div><div><br></div><div><div>ERROR: nativesdk-libcheck-0.10.0-r0 do_package_qa: QA Issue: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/checkmk contained in package nativesdk-libcheck requires /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/gawk, but no providers found in RDEPENDS_nativesdk-libcheck? [file-rdeps]</div></div><div><br></div><div>I wonder why this one wasn&#39;t catched by oe-core autobuilder.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 16, 2017 at 6:44 PM,  <span dir="ltr">&lt;<a href="mailto:git@git.openembedded.org" target="_blank">git@git.openembedded.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is an automated email from the git hooks/post-receive script.<br>
<br>
rpurdie pushed a commit to branch master-next<br>
in repository openembedded-core.<br>
<br>
commit bf017930036f19b3d6df8e5b50d997<wbr>9ee7045c5c<br>
Author: Peter Kjellerstedt &lt;<a href="mailto:pkj@axis.com">pkj@axis.com</a>&gt;<br>
AuthorDate: Tue Aug 15 16:41:56 2017 -0500<br>
<br>
    package.bbclass: Restore functionality to detect RPM dependencies<br>
<br>
    During the transition to dnf and rpm4, the functionality to<br>
    automatically make RPM determine dependencies was lost.<br>
<br>
    Before the transition, an OE specific tool called rpmdeps-oecore had<br>
    been added to the rpm suit. It was based on the rpmdeps tool that is<br>
    part of rpm. For each file specified on its command line, it would<br>
    output the provides and requires that RPM could determine.<br>
<br>
    During the transition to rpm4, rpmdeps-oecore was replaced with the<br>
    standard rpmdeps. However, what no one noticed was that unless rpmdeps<br>
    is given options, e.g., -P or -R, to tell it what it should output, it<br>
    will not output anything. Thus, it would do all the work to determine<br>
    the requirements, but would keep silent about it. And since no output<br>
    from rpmdeps is expected unless there are requirements, there were no<br>
    warnings indicating that everything was not working as expected.<br>
<br>
    Porting the old rpmdeps-oecore to work with rpm4 is not really<br>
    possible since it relied on being able to access internals of RPM that<br>
    are no longer available. However, it turned out that rpmdeps had a<br>
    debug option, --rpmfcdebug, that would output exactly the information<br>
    that we need, albeit in a different format and to stderr. To make this<br>
    usable, rpmdeps has now received a new option, --alldeps, which sends<br>
    the information we need to stdout.<br>
<br>
    (From OE-Core rev: 958501b3d9201aaabb81ec644c6049<wbr>e0c9b737e7)<br>
<br>
    Signed-off-by: Peter Kjellerstedt &lt;<a href="mailto:peter.kjellerstedt@axis.com">peter.kjellerstedt@axis.com</a>&gt;<br>
    Signed-off-by: Mark Hatle &lt;<a href="mailto:mark.hatle@windriver.com">mark.hatle@windriver.com</a>&gt;<br>
    Signed-off-by: Richard Purdie &lt;<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@<wbr>linuxfoundation.org</a>&gt;<br>
---<br>
 meta/classes/package.bbclass |  5 ++--<br>
 meta/lib/oe/package.py       | 60 ++++++++++++++++++++++++++++++<wbr>+-------------<br>
 2 files changed, 44 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass<br>
index d2fa617..2fe30da 100644<br>
--- a/meta/classes/package.bbclass<br>
+++ b/meta/classes/package.bbclass<br>
@@ -1453,7 +1453,7 @@ if [ x&quot;$D&quot; = &quot;x&quot; ]; then<br>
 fi<br>
 }<br>
<br>
-RPMDEPS = &quot;${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmdeps --rcfile ${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmrc  --macros ${STAGING_LIBDIR_NATIVE}/rpm/<wbr>macros --define &#39;_rpmconfigdir ${STAGING_LIBDIR_NATIVE}/rpm/&#39;<wbr>&quot;<br>
+RPMDEPS = &quot;${STAGING_LIBDIR_NATIVE}/rpm/<wbr>rpmdeps --alldeps&quot;<br>
<br>
 # Collect perfile run-time dependency metadata<br>
 # Output:<br>
@@ -1470,7 +1470,6 @@ python package_do_filedeps() {<br>
     pkgdest = d.getVar(&#39;PKGDEST&#39;)<br>
     packages = d.getVar(&#39;PACKAGES&#39;)<br>
     rpmdeps = d.getVar(&#39;RPMDEPS&#39;)<br>
-    magic = d.expand(&quot;${STAGING_DIR_<wbr>NATIVE}${datadir_native}/misc/<wbr>magic.mgc&quot;)<br>
<br>
     def chunks(files, n):<br>
         return [files[i:i+n] for i in range(0, len(files), n)]<br>
@@ -1482,7 +1481,7 @@ python package_do_filedeps() {<br>
         if pkg.endswith(&#39;-dbg&#39;) or pkg.endswith(&#39;-doc&#39;) or pkg.find(&#39;-locale-&#39;) != -1 or pkg.find(&#39;-localedata-&#39;) != -1 or pkg.find(&#39;-gconv-&#39;) != -1 or pkg.find(&#39;-charmap-&#39;) != -1 or pkg.startswith(&#39;kernel-module-<wbr>&#39;) or pkg.endswith(&#39;-src&#39;):<br>
             continue<br>
         for files in chunks(pkgfiles[pkg], 100):<br>
-            pkglist.append((pkg, files, rpmdeps, pkgdest, magic))<br>
+            pkglist.append((pkg, files, rpmdeps, pkgdest))<br>
<br>
     processed = oe.utils.multiprocess_exec( pkglist, oe.package.filedeprunner)<br>
<br>
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py<br>
index 43748b2..a79c668 100644<br>
--- a/meta/lib/oe/package.py<br>
+++ b/meta/lib/oe/package.py<br>
@@ -162,44 +162,68 @@ def file_translate(file):<br>
 def filedeprunner(arg):<br>
     import re, subprocess, shlex<br>
<br>
-    (pkg, pkgfiles, rpmdeps, pkgdest, magic) = arg<br>
+    (pkg, pkgfiles, rpmdeps, pkgdest) = arg<br>
     provides = {}<br>
     requires = {}<br>
<br>
-    r = re.compile(r&#39;[&lt;&gt;=]+ +[^ ]*&#39;)<br>
+    file_re = re.compile(r&#39;\s+\d+\s(.*)&#39;)<br>
+    dep_re = re.compile(r&#39;\s+(\S)\s+(.*)&#39;)<br>
+    r = re.compile(r&#39;[&lt;&gt;=]+\s+\S*&#39;)<br>
<br>
     def process_deps(pipe, pkg, pkgdest, provides, requires):<br>
+        file = None<br>
         for line in pipe:<br>
-            f = line.decode(&quot;utf-8&quot;).split(&quot; &quot;, 1)[0].strip()<br>
-            line = line.decode(&quot;utf-8&quot;).split(&quot; &quot;, 1)[1].strip()<br>
+            line = line.decode(&quot;utf-8&quot;)<br>
<br>
-            if line.startswith(&quot;Requires:&quot;):<br>
+            m = file_re.match(line)<br>
+            if m:<br>
+                file = m.group(1)<br>
+                file = file.replace(pkgdest + &quot;/&quot; + pkg, &quot;&quot;)<br>
+                file = file_translate(file)<br>
+                continue<br>
+<br>
+            m = dep_re.match(line)<br>
+            if not m or not file:<br>
+                continue<br>
+<br>
+            type, dep = m.groups()<br>
+<br>
+            if type == &#39;R&#39;:<br>
                 i = requires<br>
-            elif line.startswith(&quot;Provides:&quot;):<br>
+            elif type == &#39;P&#39;:<br>
                 i = provides<br>
             else:<br>
-                continue<br>
+               continue<br>
<br>
-            file = f.replace(pkgdest + &quot;/&quot; + pkg, &quot;&quot;)<br>
-            file = file_translate(file)<br>
-            value = line.split(&quot;:&quot;, 1)[1].strip()<br>
-            value = r.sub(r&#39;(\g&lt;0&gt;)&#39;, value)<br>
+            if dep.startswith(&quot;python(&quot;):<br>
+                continue<br>
<br>
-            if value.startswith(&quot;rpmlib(&quot;):<br>
+            # Ignore all perl(VMS::...) and perl(Mac::...) dependencies. These<br>
+            # are typically used conditionally from the Perl code, but are<br>
+            # generated as unconditional dependencies.<br>
+            if dep.startswith(&#39;perl(VMS::&#39;) or dep.startswith(&#39;perl(Mac::&#39;):<br>
                 continue<br>
-            if value == &quot;python&quot;:<br>
+<br>
+            # Ignore perl dependencies on .pl files.<br>
+            if dep.startswith(&#39;perl(&#39;) and dep.endswith(&#39;.pl)&#39;):<br>
                 continue<br>
+<br>
+            # Remove perl versions and perl module versions since they typically<br>
+            # do not make sense when used as package versions.<br>
+            if dep.startswith(&#39;perl&#39;) and r.search(dep):<br>
+                dep = dep.split()[0]<br>
+<br>
+            # Put parentheses around any version specifications.<br>
+            dep = r.sub(r&#39;(\g&lt;0&gt;)&#39;,dep)<br>
+<br>
             if file not in i:<br>
                 i[file] = []<br>
-            i[file].append(value)<br>
+            i[file].append(dep)<br>
<br>
         return provides, requires<br>
<br>
-    env = os.environ.copy()<br>
-    env[&quot;MAGIC&quot;] = magic<br>
-<br>
     try:<br>
-        dep_popen = subprocess.Popen(shlex.split(<wbr>rpmdeps) + pkgfiles, stdout=subprocess.PIPE, env=env)<br>
+        dep_popen = subprocess.Popen(shlex.split(<wbr>rpmdeps) + pkgfiles, stdout=subprocess.PIPE)<br>
         provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)<br>
     except OSError as e:<br>
         bb.error(&quot;rpmdeps: &#39;%s&#39; command failed, &#39;%s&#39;&quot; % (shlex.split(rpmdeps) + pkgfiles, e))<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
To stop receiving notification emails like this one, please contact<br>
the administrator of this repository.<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-commits mailing list<br>
<a href="mailto:Openembedded-commits@lists.openembedded.org">Openembedded-commits@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-commits" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>commits</a><br>
</font></span></blockquote></div><br></div>