Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mans Rullgard <mans@mansr.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] initscripts: populate-volatile: improve config file parsing
Date: Thu,  1 Dec 2016 12:30:34 +0000	[thread overview]
Message-ID: <20161201123034.16769-1-mans@mansr.com> (raw)

This improves the config file parsing to permit blank lines and
comments following an entry or preceeded by whitespace.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 6 +++---
 meta/recipes-core/initscripts/initscripts-1.0/volatiles            | 6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index ce4622a5e555..91514bac86fa 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -150,9 +150,9 @@ apply_cfgfile() {
 		return 1
 	}
 
-	cat ${CFGFILE} | grep -v "^#" | \
-		while read LINE; do
-		eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
+	cat ${CFGFILE} | sed 's/#.*//' | \
+	while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do
+		test -z "${TLTARGET}" && continue
 		TNAME=${ROOT_DIR}${TNAME}
 		[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
 
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
index 297245d0e40e..bc17c4553da2 100644
--- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -1,11 +1,13 @@
 # This configuration file lists filesystem objects that should get verified
 # during startup and be created if missing.
 #
-# Every line must either be a comment starting with #
-# or a definition of format:
+# Entries have the following format:
 # <type> <owner> <group> <mode> <path> <linksource>
 # where the items are separated by whitespace !
 #
+# The # character introduces a comment lasting until end of line.
+# Blank lines are ignored.
+#
 # <type> : d|f|l : (d)irectory|(f)ile|(l)ink
 #
 # A linking example:
-- 
2.10.2



                 reply	other threads:[~2016-12-01 12:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161201123034.16769-1-mans@mansr.com \
    --to=mans@mansr.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox