Patchwork [2/4] package_deb: check CONFFILES exist before adding them to metadata

login
register
mail settings
Submitter Ross Burton
Date Feb. 15, 2013, 1:09 p.m.
Message ID <d10840601395769e8147ad9c22b03cc263469e8d.1360933659.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/44691/
State Accepted
Commit 767a3d1c45f97add720174a7034df750bfb09a8e
Headers show

Comments

Ross Burton - Feb. 15, 2013, 1:09 p.m.
dpkg-deb 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_deb.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 5740948..b44eb2d 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -411,7 +411,8 @@  python do_package_deb () {
                 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)