mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
firmware: finalise mtree health check
Not what I was expecting from a base tool like mtree... * Missing files are not seen as an error condition, so remove our ignored files (they show up as nonexistent) and then count how many files are missing. If there is at least a missing file show the output and don't say everything is swell. * Since we prefilter MTREE_OUT on a real error just show the output since it's likely there's an error to see.
This commit is contained in:
parent
57bef4363f
commit
9325d87b4e
@ -86,12 +86,19 @@ set_check()
|
||||
MTREE_OUT=$(${MTREE} -X ${TMPFILE} < ${FILE} 2>&1)
|
||||
MTREE_RET=${?}
|
||||
|
||||
MTREE_OUT=$(echo "${MTREE_OUT}" | grep -Fvx "${GREP_PATTERNS}")
|
||||
MTREE_MIA=$(echo "${MTREE_OUT}" | grep -c ' missing$')
|
||||
|
||||
if [ ${MTREE_RET} -eq 0 ]; then
|
||||
echo "No problems detected." >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
if [ "${MTREE_MIA}" = "0" ]; then
|
||||
echo "No problems detected." >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
else
|
||||
echo "Missing files: ${MTREE_MIA}" >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
echo "${MTREE_OUT}" >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
fi
|
||||
else
|
||||
echo "Error ${MTREE_RET} ocurred." >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
echo -n "${MTREE_OUT}" | grep -Fvx "${GREP_PATTERNS}" | \
|
||||
>> ${PKG_PROGRESS_FILE} 2>&1
|
||||
echo "${MTREE_OUT}" >> ${PKG_PROGRESS_FILE} 2>&1
|
||||
fi
|
||||
|
||||
rm ${TMPFILE}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user