Patchwork [v2] base-files-3.0.14 configuration files

login
register
mail settings
Submitter Peter Gsellmann
Date March 21, 2011, 12:53 p.m.
Message ID <201103211353.40761.pgsellmann@portner-elektronik.at>
Download mbox | patch
Permalink /patch/1649/
State New, archived
Headers show

Comments

Peter Gsellmann - March 21, 2011, 12:53 p.m.
Mark some files in ${sysconfdir} as configuration files so they are not blindly overwritten when upgrading
Adjust conffiles variable to be usable as default in CONFFILES
Images nylon,slugo inherit and amend default set of conffiles
Image micro has very few configuration files

Signed-off-by: Peter Gsellmann <pgsellmann@portner-elektronik.at>
---
 recipes/base-files/base-files_3.0.14.bb |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
Phil Blundell - March 21, 2011, 4:39 p.m.
On Mon, 2011-03-21 at 13:53 +0100, Peter Gsellmann wrote:
> Mark some files in ${sysconfdir} as configuration files so they are not blindly overwritten when upgrading
> Adjust conffiles variable to be usable as default in CONFFILES
> Images nylon,slugo inherit and amend default set of conffiles
> Image micro has very few configuration files

Note that these are DISTROs, not images.  Also, it's "slugos".

> +CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf" + ${conffiles}

Does that actually work?  I'm not convinced that this notation will do
what you seem to be expecting.

p.
Peter Gsellmann - March 21, 2011, 6:19 p.m.
Am Montag, 21. März 2011, 17:39:06 schrieb Phil Blundell:
> On Mon, 2011-03-21 at 13:53 +0100, Peter Gsellmann wrote:
> > Mark some files in ${sysconfdir} as configuration files so they are not blindly overwritten when upgrading
> > Adjust conffiles variable to be usable as default in CONFFILES
> > Images nylon,slugo inherit and amend default set of conffiles
> > Image micro has very few configuration files
> 
> Note that these are DISTROs, not images.  Also, it's "slugos".
> 
> > +CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf" + ${conffiles}
> 
> Does that actually work?  I'm not convinced that this notation will do
> what you seem to be expecting.
:-( no, sorry. I am always confused about where bash-syntax or python-syntax counts.
This statement seems to works but dont know if its the canonical syntax:
CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf ${conffiles}"
If ok, i will resend patch v3 tomorrow.


Peter

Patch

diff --git a/recipes/base-files/base-files_3.0.14.bb b/recipes/base-files/base-files_3.0.14.bb
index 0aa27f4..65cab03 100644
--- a/recipes/base-files/base-files_3.0.14.bb
+++ b/recipes/base-files/base-files_3.0.14.bb
@@ -1,7 +1,8 @@ 
 DESCRIPTION = "Miscellaneous files for the base system."
 SECTION = "base"
 PRIORITY = "required"
-PR = "r102"
+PR = "r103"
+
 LICENSE = "GPL"
 
 SRC_URI = " \
@@ -55,10 +56,10 @@  media = "card cf net ram"
 media_micro = ""
 
 volatiles = "cache run log lock tmp"
-conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
-	     ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
-	     ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
-	     ${sysconfdir}/default"
+conffiles = "${sysconfdir}/fstab ${sysconfdir}/host.conf ${sysconfdir}/hostname \
+            ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
+            ${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
+            "
 
 #
 # set standard hostname, might be a candidate for a DISTRO variable? :M:
@@ -95,7 +96,7 @@  do_install () {
 	fi
 
         if [ "${DISTRO}" != "micro" -a "${DISTRO}" != "micro-uclibc" ]; then
-                install -m 644 ${WORKDIR}/issue*  ${D}${sysconfdir}  
+                install -m 644 ${WORKDIR}/issue*  ${D}${sysconfdir}
 
                 if [ -n "${DISTRO_NAME}" ]; then
         		echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
@@ -181,8 +182,8 @@  PACKAGE_ARCH_rt3000 = "rt3000"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-CONFFILES_${PN} = "${sysconfdir}/fstab ${sysconfdir}/hostname"
-CONFFILES_${PN}_micro = ""
-CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
-CONFFILES_${PN}_slugos = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
+CONFFILES_${PN} = ${conffiles}
+CONFFILES_${PN}_micro = "${sysconfdir}/hostname ${sysconfdir}/nsswitch.conf"
+CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf" + ${conffiles}
+CONFFILES_${PN}_slugos = "${sysconfdir}/resolv.conf" + ${conffiles}