Skip to content

Commit

Permalink
Merge pull request #1918 from gozora/master
Browse files Browse the repository at this point in the history
Added default value (0) for crc variable (XFS) to avoid
messages like: "[: -eq: unary operator expected"
when using with older versions of xfsprogs, see
#1915
  • Loading branch information
jsmeix committed Sep 26, 2018
2 parents fbcfdef + b35c0a3 commit 6ddfd56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions usr/share/rear/lib/filesystems-functions.sh
Expand Up @@ -217,8 +217,13 @@ function xfs_parse
continue
fi

# crc and ftype are mutually exclusive
if [ $crc -eq 1 ] && [ $var = "ftype" ]; then
# crc and ftype are mutually exclusive.
# crc option might be even completely missing in older versions of
# xfsprogs, which would cause behaviour like described in
# https://github.com/rear/rear/issues/1915.
# To avoid messages like "[: -eq: unary operator expected",
# we will set default value for $crc variable to 0.
if [ ${crc:-0} -eq 1 ] && [ $var = "ftype" ]; then
i=$((i+1))
continue
fi
Expand Down

0 comments on commit 6ddfd56

Please sign in to comment.