mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Fix SC2181 ("[ $?") outside tests/
Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
This commit is contained in:
@@ -87,9 +87,7 @@ coverity_fix_commit()
|
||||
IFS='
|
||||
'
|
||||
for line in $(git log -n 1 --pretty=%b "$REF" | grep -E '^CID'); do
|
||||
echo "$line" | grep -E '^CID [[:digit:]]+: ([[:graph:]]+|[[:space:]])+ \(([[:upper:]]|\_)+\)' > /dev/null
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
if ! echo "$line" | grep -qE '^CID [[:digit:]]+: ([[:graph:]]+|[[:space:]])+ \(([[:upper:]]|\_)+\)'; then
|
||||
echo "error: commit message has an improperly formatted CID defect line"
|
||||
error=1
|
||||
fi
|
||||
|
||||
+1
-3
@@ -120,9 +120,7 @@ load_module_linux() {
|
||||
echo "Loading: $FILE ($VERSION)"
|
||||
fi
|
||||
|
||||
$LDMOD "$KMOD" >/dev/null 2>&1
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
if ! $LDMOD "$KMOD" >/dev/null 2>&1; then
|
||||
echo "Failed to load $KMOD"
|
||||
return 1
|
||||
fi
|
||||
|
||||
+2
-4
@@ -491,10 +491,8 @@ for TAG in $POOL_TAGS; do
|
||||
POOL_NAME=$($ZPOOL_CMD import -d "$POOL_DIR_COPY" | \
|
||||
awk '/pool:/ { print $2; exit 0 }')
|
||||
|
||||
$ZPOOL_CMD import -N -d "$POOL_DIR_COPY" \
|
||||
"$POOL_NAME" &>/dev/null
|
||||
# shellcheck disable=SC2181
|
||||
if [ $? -ne 0 ]; then
|
||||
if ! $ZPOOL_CMD import -N -d "$POOL_DIR_COPY"
|
||||
"$POOL_NAME" &>/dev/null; then
|
||||
fail_nonewline
|
||||
ERROR=1
|
||||
else
|
||||
|
||||
+2
-5
@@ -62,11 +62,8 @@ function usage
|
||||
function or_die
|
||||
{
|
||||
# shellcheck disable=SC2068
|
||||
$@
|
||||
# shellcheck disable=SC2181
|
||||
if [[ $? -ne 0 ]]; then
|
||||
# shellcheck disable=SC2145
|
||||
echo "Command failed: $@"
|
||||
if ! $@; then
|
||||
echo "Command failed: $*"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user