<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"><<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>></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] = "package_qa_check_conffiles"<br>
+def package_qa_check_conffiles(path, name, d, elf, messages):<br>
+ """ Check files in ${sysconfdir} are marked by CONFFILES """<br>
+<br>
+ if os.path.islink(path) or not os.path.exists(path):<br>
+ return True<br>
+<br>
+ sysconfdir = d.getVar('sysconfdir', True)<br>
+ dest = d.getVar('PKGDEST', True)<br>
+ sysconfdir_path = os.path.join(os.path.join(dest, name), \<br>
+ sysconfdir.lstrip('/'))<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 '/' or os.sep to the string being checked (of course, if we also need to match just '/etc' without anything further, which I don't think is the case here, you'd also have to check explicitly with ==, as '/etc/' won't be found at the beginning of '/etc'. It'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>