<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 2, 2015 at 9:36 PM, Robert Yang <span dir="ltr">&lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":1hy" class="" style="overflow:hidden">+QAPATHTEST[conffiles] = &quot;package_qa_check_conffiles&quot;<br>
+def package_qa_check_conffiles(path, name, d, elf, messages):<br>
+    &quot;&quot;&quot; Check files in ${sysconfdir} are marked by CONFFILES &quot;&quot;&quot;<br>
+<br>
+    if os.path.islink(path) or not os.path.exists(path):<br>
+        return True<br>
+<br>
+    sysconfdir = d.getVar(&#39;sysconfdir&#39;, True)<br>
+    dest = d.getVar(&#39;PKGDEST&#39;, True)<br>
+    sysconfdir_path = os.path.join(os.path.join(dest, name), \<br>
+                        sysconfdir.lstrip(&#39;/&#39;))<br>
+<br>
+    if not path.startswith(sysconfdir_path):<br>
+        return True</div></blockquote></div><br>This is missing a trailing slash, so e.g. checking /etcfoo would match, not just /etc. Whenever you use startswith() on a path, remember to append &#39;/&#39; or os.sep to the string being checked (of course, if we also need to match just &#39;/etc&#39; without anything further, which I don&#39;t think is the case here, you&#39;d also have to check explicitly with ==, as &#39;/etc/&#39; won&#39;t be found at the beginning of &#39;/etc&#39;. It&#39;s a common thing to miss, I think we have other occurrences of this in the metadata :)<br>-- <br><div class="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>