Fix error in shellcheck N2

Fix error in shellcheck N2

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2021-07-28 21:41:09 +02:00
parent 347749e2ba
commit 4d2bf9be44
8 changed files with 34 additions and 76 deletions

View File

@ -26,7 +26,7 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore: archlinux
ignore: build-and-install-cmake.sh
severity: warning
env:
SHELLCHECK_OPTS: -s bash

View File

@ -18,7 +18,7 @@ function do_curl_build {
# We do this shared to avoid obnoxious linker issues where git couldn't
# link properly. If anyone wants to make this build statically go for it.
LIBS=-ldl CFLAGS=-Wl,--exclude-libs,ALL ./configure --with-ssl --disable-static > /dev/null
make -j$(nproc) > /dev/null
make -j"$(nproc)" > /dev/null
make install > /dev/null
}

View File

@ -32,7 +32,7 @@ rm -f "git-${GIT_VERSION}.tar.gz"
pushd "git-${GIT_VERSION}"
./configure --prefix=/usr/local --with-curl
make -j$(nproc)
make -j"$(nproc)"
make install
popd

View File

@ -58,48 +58,48 @@ PERL_HASH=03b693901cd8ae807231b1787798cf1f2e0b8a56218d07b7da44f784a7caeb2c
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 install > /dev/null
"${WRAPPER}" sh Configure -des -Dprefix=/opt/perl > /dev/null
"${WRAPPER}" make -j$(nproc) > /dev/null
"${WRAPPER}" make install > /dev/null
}
function build_perl {
local perl_fname=$1
check_var ${perl_fname}
check_var "${perl_fname}"
local perl_sha256=$2
check_var ${perl_sha256}
check_var ${PERL_DOWNLOAD_URL}
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)
rm -rf ${perl_fname} ${perl_fname}.tar.gz
check_var "${perl_sha256}"
check_var "${PERL_DOWNLOAD_URL}"
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)
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 install_sw > /dev/null
"${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 install_sw > /dev/null
}
function build_openssl {
local openssl_fname=$1
check_var ${openssl_fname}
check_var "${openssl_fname}"
local openssl_sha256=$2
check_var ${openssl_sha256}
check_var ${OPENSSL_DOWNLOAD_URL}
curl -fsSLO ${OPENSSL_DOWNLOAD_URL}/${openssl_fname}.tar.gz
check_sha256sum ${openssl_fname}.tar.gz ${openssl_sha256}
tar -xzf ${openssl_fname}.tar.gz
(cd ${openssl_fname} && PATH=/opt/perl/bin:${PATH} do_openssl_build)
rm -rf ${openssl_fname} ${openssl_fname}.tar.gz
check_var "${openssl_sha256}"
check_var" ${OPENSSL_DOWNLOAD_URL}"
curl -fsSLO "${OPENSSL_DOWNLOAD_URL}/${openssl_fname}.tar.gz"
check_sha256sum "${openssl_fname}.tar.gz" "${openssl_sha256}"
tar -xzf "${openssl_fname}.tar.gz"
(cd "${openssl_fname}" && PATH="/opt/perl/bin:${PATH}" do_openssl_build)
rm -rf "${openssl_fname}" "${openssl_fname}.tar.gz"
# Cleanup install tree
rm -rf /usr/ssl/man
}
cd /usr/src
build_perl $PERL_ROOT $PERL_HASH
build_openssl $OPENSSL_ROOT $OPENSSL_HASH
build_perl "$PERL_ROOT" "$PERL_HASH"
build_openssl "$OPENSSL_ROOT" "$OPENSSL_HASH"
# Delete PERL
rm -rf /opt/perl

View File

@ -1,42 +0,0 @@
#!/usr/bin/env bash
#
# Configure, build and install python
#
# Usage:
#
# build-and-install-python.sh [-version 3.9.5]
# needed packages : libncurses5-dev libgdbm-dev libnss3-dev
# libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev
PYTHON_VERSION=3.9.5
while [ $# -gt 0 ]; do
case "$1" in
-version|-v)
PYTHON_VERSION=$2
shift
;;&
*)
echo "Usage: Usage: ${0##*/} [-version 3.9.5]"
exit 1
;;
esac
shift
done
# Download
wget "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz"
tar xvf "Python-${PYTHON_VERSION}.tgz"
# Configure, build and install
cd "Python-${PYTHON_VERSION}"
# Disable --enable-shared --enable-optimizations --prefix=/usr/local/python-${PYTHON_VERSION}
./configure --with-ensurepip=install
make -j$(nproc)
make install #altinstall
ln -s /usr/local/bin/python3 /usr/local/bin/python
ln -s /usr/local/bin/pip3 /usr/local/bin/pip
# Clean
cd ..
rm -rf "Python-${PYTHON_VERSION}"

View File

@ -37,16 +37,16 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
fi
# Enable passwordless sudo capabilities for the user
chown root:$BUILDER_GID $(which gosu)
chmod +s $(which gosu); sync
chown root:"$BUILDER_GID" "$(which gosu)"
chmod +s "$(which gosu)"; sync
# Execute project specific pre execution hook
if [[ -e /work/.dockcross ]]; then
gosu $BUILDER_UID:$BUILDER_GID /work/.dockcross
gosu "$BUILDER_UID:$BUILDER_GID" /work/.dockcross
fi
# Run the command as the specified user/group.
exec gosu $BUILDER_UID:$BUILDER_GID "$@"
exec gosu "$BUILDER_UID:$BUILDER_GID" "$@"
else
# Just run the command as root.
exec "$@"

View File

@ -73,7 +73,7 @@ cd crosstool-ng
git fetch --tags
# checkout
git checkout ${REV}
git checkout "${REV}"
if [ ${REV} = "crosstool-ng-1.23.0" ]; then
patch scripts/build/companion_libs/210-expat.sh -i /dockcross/crosstool-ng-expat.patch
@ -89,7 +89,7 @@ BOOTSTRAP_PREFIX="${CTNG}/prefix"
./bootstrap
./configure \
--prefix "${BOOTSTRAP_PREFIX}"
make -j$(nproc)
make -j"$(nproc)"
make install
##

View File

@ -14,7 +14,7 @@ if ! command -v gpg &> /dev/null; then
fi
GOSU_VERSION=1.12
dpkgArch=$(if test $(uname -m) = "x86_64"; then echo amd64; else echo i386; fi)
dpkgArch=$(if test "$(uname -m)" = "x86_64"; then echo amd64; else echo i386; fi)
url="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}"
url_key="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}.asc"