capture cmp(1) error output

This commit is contained in:
Jérémy Lecour 2023-07-03 11:42:22 +02:00 committed by Jérémy Lecour
parent 71e49db330
commit 8bb66e0511
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
2 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,7 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Changed
* extract "include_files" function
* capture cmp(1) error output
### Deprecated

View file

@ -285,7 +285,7 @@ check_unpersisted_state() {
rm -f "${STATE_FILE_DIFF}"
if [ -f "${STATE_FILE_LATEST}" ]; then
cmp_result=$(cmp "${STATE_FILE_LATEST}" "${STATE_FILE_CURRENT}")
cmp_result=$(cmp "${STATE_FILE_LATEST}" "${STATE_FILE_CURRENT}" 2>&1)
cmp_rc=$?
if [ ${cmp_rc} -eq 0 ]; then
@ -326,7 +326,7 @@ report_state_changes() {
# But if there is a previous known state
# let's compare with the new known state
if [ -f "${STATE_FILE_PREVIOUS}" ]; then
cmp_result=$(cmp "${STATE_FILE_PREVIOUS}" "${STATE_FILE_LATEST}")
cmp_result=$(cmp "${STATE_FILE_PREVIOUS}" "${STATE_FILE_LATEST}" 2>&1)
cmp_rc=$?
if [ ${cmp_rc} -eq 0 ]; then