On Sat, Oct 3, 2015 at 11:39 AM, Christopher Larson <[email protected]>
wrote:

> On Fri, Oct 2, 2015 at 9:36 PM, Robert Yang <[email protected]>
> 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
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to