mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
scripts: fix shellcheck warnings
On my system (shellcheck v0.7.1) make lint shows a few warnings about needing to quote variables. Fix those. PS I am not sure why those are not shown by GHA CI, I assume there is different shellcheck version used. Add shellcheck -- version to the appropriate Makefile target to avoid confusion. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
5f3631916a
commit
2166d47482
1
Makefile
1
Makefile
@ -401,6 +401,7 @@ lint:
|
|||||||
flake8 --config=scripts/flake8.cfg test/inhfd/*.py
|
flake8 --config=scripts/flake8.cfg test/inhfd/*.py
|
||||||
flake8 --config=scripts/flake8.cfg test/others/rpc/config_file.py
|
flake8 --config=scripts/flake8.cfg test/others/rpc/config_file.py
|
||||||
flake8 --config=scripts/flake8.cfg lib/py/images/pb2dict.py
|
flake8 --config=scripts/flake8.cfg lib/py/images/pb2dict.py
|
||||||
|
shellcheck --version
|
||||||
shellcheck scripts/*.sh
|
shellcheck scripts/*.sh
|
||||||
shellcheck scripts/ci/*.sh scripts/ci/apt-install
|
shellcheck scripts/ci/*.sh scripts/ci/apt-install
|
||||||
shellcheck test/others/crit/*.sh
|
shellcheck test/others/crit/*.sh
|
||||||
|
@ -12,7 +12,7 @@ max_apt_retries=5
|
|||||||
# hashsum mismatches, DNS errors and similar things
|
# hashsum mismatches, DNS errors and similar things
|
||||||
while true; do
|
while true; do
|
||||||
(( install_retry_counter+=1 ))
|
(( install_retry_counter+=1 ))
|
||||||
if [ ${install_retry_counter} -gt ${max_apt_retries} ]; then
|
if [ "${install_retry_counter}" -gt "${max_apt_retries}" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
@ -20,5 +20,5 @@ while true; do
|
|||||||
|
|
||||||
# In case it is a network error let's wait a bit.
|
# In case it is a network error let's wait a bit.
|
||||||
echo "Retrying attempt ${install_retry_counter}"
|
echo "Retrying attempt ${install_retry_counter}"
|
||||||
sleep ${install_retry_counter}
|
sleep "${install_retry_counter}"
|
||||||
done
|
done
|
||||||
|
@ -45,8 +45,8 @@ bindmount=""
|
|||||||
|
|
||||||
function remove_bindmount {
|
function remove_bindmount {
|
||||||
if [ -n "$bindmount" ]; then
|
if [ -n "$bindmount" ]; then
|
||||||
$JOIN_CT umount $bindmount
|
$JOIN_CT umount "$bindmount"
|
||||||
$JOIN_CT rm -rf $bindmount
|
$JOIN_CT rm -rf "$bindmount"
|
||||||
bindmount=""
|
bindmount=""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ function save_mountpoint {
|
|||||||
# Nothing to do, if no file system is on top of autofs
|
# Nothing to do, if no file system is on top of autofs
|
||||||
[ "$top_mount_fs_type" = "autofs" ] && return
|
[ "$top_mount_fs_type" = "autofs" ] && return
|
||||||
|
|
||||||
bindmount=$($JOIN_CT mktemp -d)
|
bindmount="$($JOIN_CT mktemp -d)"
|
||||||
if [ -z "$bindmount" ]; then
|
if [ -z "$bindmount" ]; then
|
||||||
echo "Failed to create temporary directory"
|
echo "Failed to create temporary directory"
|
||||||
return 1
|
return 1
|
||||||
|
@ -26,7 +26,7 @@ IMGFILE=$CRTOOLS_IMAGE_DIR"/tmpfiles.tar.gz"
|
|||||||
MY_NAME=$(basename "$0")
|
MY_NAME=$(basename "$0")
|
||||||
|
|
||||||
case "$CRTOOLS_SCRIPT_ACTION" in
|
case "$CRTOOLS_SCRIPT_ACTION" in
|
||||||
$POSTDUMP )
|
"$POSTDUMP")
|
||||||
if [ "$#" -lt 1 ]; then
|
if [ "$#" -lt 1 ]; then
|
||||||
echo "$MY_NAME: ERROR! No files are given."
|
echo "$MY_NAME: ERROR! No files are given."
|
||||||
exit 1
|
exit 1
|
||||||
@ -34,7 +34,7 @@ case "$CRTOOLS_SCRIPT_ACTION" in
|
|||||||
tar "$DUMPARGS" "$IMGFILE" -- "$@"
|
tar "$DUMPARGS" "$IMGFILE" -- "$@"
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
$PRERESTORE )
|
"$PRERESTORE")
|
||||||
if [ "$#" -ne 0 ]; then
|
if [ "$#" -ne 0 ]; then
|
||||||
echo "$MY_NAME: ERROR! Not expected script args."
|
echo "$MY_NAME: ERROR! Not expected script args."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user