Skip to contentSkip to conversation

initscripts: filter out empty lines from volatiles in check_requirements()

PATCH New Ming Liu 1 participant 1 message Sep 10, 2013

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

PATCH 1/1 initscripts: filter out empty lines from volatiles in check_requirements()

So far the rules of check_requirements() is too strict to lead mismatch when empty lines exist in volatiles.

---
 .../initscripts-1.0/populate-volatile.sh           |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh +2 -2
index 915b7d0..6ffe1f2 100755
@@ -107,7 +107,7 @@ check_requirements() {
 	TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
 
 	cat ${ROOT_DIR}/etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
-	cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 2 > "${TMP_INTERMED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
 	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
 	NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
 	NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
@@ -121,7 +121,7 @@ check_requirements() {
 
 
 	cat ${ROOT_DIR}/etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
-	cat ${CFGFILE} | grep -v "^#" | cut -d " " -f 3 > "${TMP_INTERMED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
 	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
 
 	NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
Signature · 1 line
1.7.1