All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Christopher Larson <clarson@kergoth.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [YP 2.1] [RFC PATCH] insane.bbclass: check files under /etc/ are marked by CONFFILES
Date: Sun, 4 Oct 2015 10:59:28 +0800	[thread overview]
Message-ID: <56109610.8010306@windriver.com> (raw)
In-Reply-To: <CABcZANmVOTOAgvfSrsQVi9-1eQ5q4p+f+7dFcWVAdCrJaNS-=g@mail.gmail.com>



On 10/04/2015 02:40 AM, Christopher Larson wrote:
>
> On Sat, Oct 3, 2015 at 11:39 AM, Christopher Larson <clarson@kergoth.com
> <mailto:clarson@kergoth.com>> wrote:
>
>     On Fri, Oct 2, 2015 at 9:36 PM, Robert Yang <liezhi.yang@windriver.com
>     <mailto:liezhi.yang@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.

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


      reply	other threads:[~2015-10-04  2:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03  4:36 [YP 2.1] [RFC PATCH] insane.bbclass: check files under /etc/ are marked by CONFFILES Robert Yang
2015-10-03 18:39 ` Christopher Larson
2015-10-03 18:40   ` Christopher Larson
2015-10-04  2:59     ` Robert Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56109610.8010306@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=clarson@kergoth.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.