From 317b74142039983646e805488699bda534b4e3ab Mon Sep 17 00:00:00 2001
From: Bensuperpc <bensuperpc@gmail.com>
Date: Thu, 29 Jul 2021 09:07:11 +0200
Subject: [PATCH] Fix error in shellcheck N3

Fix error in shellcheck N3

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
---
 imagefiles/build-and-install-cmake.sh   | 2 +-
 imagefiles/build-and-install-openssl.sh | 6 +++---
 imagefiles/dockcross                    | 4 ++--
 imagefiles/install-gosu-binary.sh       | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/imagefiles/build-and-install-cmake.sh b/imagefiles/build-and-install-cmake.sh
index 121c24e..54ec1e4 100755
--- a/imagefiles/build-and-install-cmake.sh
+++ b/imagefiles/build-and-install-cmake.sh
@@ -69,7 +69,7 @@ file(
 list(GET status 0 error_code)
 list(GET status 1 error_msg)
 if(error_code)
-  message(FATAL_ERROR "error: Failed to download ${url} - ${error_msg}")
+  message(FATAL_ERROR "error: Failed to download \${url} - \${error_msg}")
 else()
   message(STATUS "CMake: HTTPS download works")
 endif()
diff --git a/imagefiles/build-and-install-openssl.sh b/imagefiles/build-and-install-openssl.sh
index 6211f29..02907c2 100755
--- a/imagefiles/build-and-install-openssl.sh
+++ b/imagefiles/build-and-install-openssl.sh
@@ -59,7 +59,7 @@ PERL_DOWNLOAD_URL=https://www.cpan.org/src/5.0
 
 function do_perl_build {
     "${WRAPPER}" sh Configure -des -Dprefix=/opt/perl > /dev/null
-    "${WRAPPER}" make -j$(nproc) > /dev/null
+    "${WRAPPER}" make -j"$(nproc)" > /dev/null
     "${WRAPPER}" make install > /dev/null
 }
 
@@ -72,13 +72,13 @@ function build_perl {
     curl -fsSLO "${PERL_DOWNLOAD_URL}/${perl_fname}.tar.gz"
     check_sha256sum "${perl_fname}.tar.gz" "${perl_sha256}"
     tar -xzf "${perl_fname}.tar.gz"
-    (cd $"{perl_fname}" && do_perl_build)
+    (cd "${perl_fname}" && do_perl_build)
     rm -rf "${perl_fname}" "${perl_fname}.tar.gz"
 }
 
 function do_openssl_build {
     "${WRAPPER}" ./config no-shared -fPIC "$CONFIG_FLAG" --prefix=/usr/local/ssl --openssldir=/usr/local/ssl > /dev/null
-    "${WRAPPER}" make -j$(nproc) > /dev/null
+    "${WRAPPER}" make -j"$(nproc)" > /dev/null
     "${WRAPPER}" make install_sw > /dev/null
 }
 
diff --git a/imagefiles/dockcross b/imagefiles/dockcross
index 8e15c1f..e3dd171 100755
--- a/imagefiles/dockcross
+++ b/imagefiles/dockcross
@@ -133,7 +133,7 @@ while [[ $# != 0 ]]; do
             ;;
         -*)
             err Unknown option \"$1\"
-            command:help
+            command:help $1
             exit
             ;;
 
@@ -152,7 +152,7 @@ done
 # Source the config file if it exists
 DEFAULT_DOCKCROSS_CONFIG=~/.dockcross
 FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}}
-
+# shellcheck source=~/.dockcross
 [[ -f "$FINAL_CONFIG" ]] && source "$FINAL_CONFIG"
 
 # Set the docker image
diff --git a/imagefiles/install-gosu-binary.sh b/imagefiles/install-gosu-binary.sh
index c2b7f2b..34a9280 100755
--- a/imagefiles/install-gosu-binary.sh
+++ b/imagefiles/install-gosu-binary.sh
@@ -19,7 +19,8 @@ url="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpk
 url_key="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}.asc"
 
 # download and verify the signature
-export GNUPGHOME="$(mktemp -d)"
+GNUPGHOME=$(mktemp -d)
+export $GNUPGHOME
 
 gpg --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \
 gpg --keyserver hkp://pgp.key-server.io:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \