From 415eaacb83b1c6df5210fb423e3e96e530b1dc42 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 1 Dec 2016 12:30:34 +0000 Subject: initscripts: populate-volatile: improve config file parsing This improves the config file parsing to permit blank lines and comments following an entry or preceeded by whitespace. Signed-off-by: Mans Rullgard Signed-off-by: Ross Burton --- 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(-) (limited to 'meta/recipes-core/initscripts') 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 ce4622a5e5..91514bac86 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 297245d0e4..bc17c4553d 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: # # where the items are separated by whitespace ! # +# The # character introduces a comment lasting until end of line. +# Blank lines are ignored. +# # : d|f|l : (d)irectory|(f)ile|(l)ink # # A linking example: -- cgit v1.2.3