Patchwork [1/3] package_ipk: check CONFFILES exist before adding them to metadata

login
register
mail settings
Submitter Ross Burton
Date Feb. 14, 2013, 5:52 p.m.
Message ID <b1c98f2ddb9165ae580daa42c509caca1fe7cdbc.1360864224.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/44649/
State Accepted
Commit fb87edc881009cf4d582cd95c248884551fe07fe
Headers show

Comments

Ross Burton - Feb. 14, 2013, 5:52 p.m.
opkg-build verifies that conffiles exist, so verify that the specified files
actually exist before writing them to conffiles.

This mirrors the behaviour of FILES and package_rpm's CONFFILES handling.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/package_ipk.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Martin Jansa - Feb. 14, 2013, 6:31 p.m.
On Thu, Feb 14, 2013 at 05:52:50PM +0000, Ross Burton wrote:
> opkg-build verifies that conffiles exist, so verify that the specified files
> actually exist before writing them to conffiles.

Shouldn't this show at least a warning about missing conffile?

opkg-build error saved me few times before adding CONFFILES with wrong
pattern not matching anything in FILES.

I understand that you cannot use fatal error here for that xorg.conf
use-case, but warning would be nice.

> This mirrors the behaviour of FILES and package_rpm's CONFFILES handling.

 
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/classes/package_ipk.bbclass |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
> index d735051..e5e76ef 100644
> --- a/meta/classes/package_ipk.bbclass
> +++ b/meta/classes/package_ipk.bbclass
> @@ -440,7 +440,8 @@ python do_package_ipk () {
>                  bb.utils.unlockfile(lf)
>                  raise bb.build.FuncFailed("unable to open conffiles for writing.")
>              for f in conffiles_str.split():
> -                conffiles.write('%s\n' % f)
> +                if os.path.exists(oe.path.join(root, f)):
> +                    conffiles.write('%s\n' % f)
>              conffiles.close()
>  
>          os.chdir(basedir)
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Ross Burton - Feb. 14, 2013, 7:14 p.m.
On 14 February 2013 18:31, Martin Jansa <martin.jansa@gmail.com> wrote:
> Shouldn't this show at least a warning about missing conffile?
>
> opkg-build error saved me few times before adding CONFFILES with wrong
> pattern not matching anything in FILES.

I'm pretty certain rpm doesn't produce a warning, so we'd want to fix
that up too.

Anyway, do we want to introduce warnings that by design will always
cause errors on a set of packages?

Ross

Patch

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index d735051..e5e76ef 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -440,7 +440,8 @@  python do_package_ipk () {
                 bb.utils.unlockfile(lf)
                 raise bb.build.FuncFailed("unable to open conffiles for writing.")
             for f in conffiles_str.split():
-                conffiles.write('%s\n' % f)
+                if os.path.exists(oe.path.join(root, f)):
+                    conffiles.write('%s\n' % f)
             conffiles.close()
 
         os.chdir(basedir)