[OE-core] [YP 2.1] [RFC PATCH] insane.bbclass: check files under /etc/ are marked by CONFFILES

Christopher Larson clarson at kergoth.com
Sat Oct 3 18:40:48 UTC 2015


On Sat, Oct 3, 2015 at 11:39 AM, Christopher Larson <clarson at kergoth.com>
wrote:

> On Fri, Oct 2, 2015 at 9:36 PM, Robert Yang <liezhi.yang at windriver.com>
> wrote:
>
>> +QAPATHTEST[conffiles] = "package_qa_check_conffiles"
>> +def package_qa_check_conffiles(path, name, d, elf, messages):
>> +    """ Check files in ${sysconfdir} are marked by CONFFILES """
>> +
>> +    if os.path.islink(path) or not os.path.exists(path):
>> +        return True
>> +
>> +    sysconfdir = d.getVar('sysconfdir', True)
>> +    dest = d.getVar('PKGDEST', True)
>> +    sysconfdir_path = os.path.join(os.path.join(dest, name), \
>> +                        sysconfdir.lstrip('/'))
>> +
>> +    if not path.startswith(sysconfdir_path):
>> +        return True
>>
>
> 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


To clarify, os.sep needs adding to sysconfdir_path, not path :) I realized
my wording was ambiguous.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151003/f90112b0/attachment-0002.html>


More information about the Openembedded-core mailing list