On 10/04/2015 02:40 AM, Christopher Larson wrote:

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

    On Fri, Oct 2, 2015 at 9:36 PM, Robert Yang <[email protected]
    <mailto:[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.

Thanks, after a world testing, there 187 binary rpm packages have this issue
(have /etc/foo, but no CONFFILES set), how about we do this as Debian:
1) Treat all the files under /etc/ as CONFFILES
2) Move the files out or /etc/ if it is not a conffile
3) If the file /etc/foo is a conffile, and is changed during runtime,
   then create a symlink /etc/foo -> /var/foo

// Robert

--
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