mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-04-05 13:29:16 +02:00
Move shellcheck and fix error in scripts
Move shellcheck and fix error in scripts Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
parent
97482d0814
commit
e5fee6a82f
30
.github/workflows/ShellCheck.yml
vendored
30
.github/workflows/ShellCheck.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: shellcheck
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
paths-ignore:
|
|
||||||
- '**/README.md'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- '*'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
shellcheck:
|
|
||||||
name: Shellcheck
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
shell_type: [bash, ksh]
|
|
||||||
steps:
|
|
||||||
- name: "📥 Checkout Code"
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Run ShellCheck
|
|
||||||
uses: ludeeus/action-shellcheck@master
|
|
||||||
with:
|
|
||||||
ignore: archlinux
|
|
||||||
severity: warning
|
|
||||||
env:
|
|
||||||
SHELLCHECK_OPTS: -s ${{ matrix.shell_type }}
|
|
13
.github/workflows/main.yml
vendored
13
.github/workflows/main.yml
vendored
@ -18,7 +18,18 @@ jobs:
|
|||||||
name: base
|
name: base
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: "Checkout Code"
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Run ShellCheck
|
||||||
|
uses: ludeeus/action-shellcheck@1.1.0
|
||||||
|
with:
|
||||||
|
ignore: archlinux
|
||||||
|
severity: warning
|
||||||
|
env:
|
||||||
|
SHELLCHECK_OPTS: -s ${{ matrix.shell_type }}
|
||||||
- name: build
|
- name: build
|
||||||
run: make base
|
run: make base
|
||||||
- name: test
|
- name: test
|
||||||
|
@ -29,31 +29,31 @@ fi
|
|||||||
|
|
||||||
cd /usr/src
|
cd /usr/src
|
||||||
|
|
||||||
git clone https://gitlab.kitware.com/cmake/cmake.git CMake -b v$CMAKE_VERSION --depth 1
|
git clone https://gitlab.kitware.com/cmake/cmake.git CMake -b "v$CMAKE_VERSION" --depth 1
|
||||||
|
|
||||||
mkdir /usr/src/CMake-build
|
mkdir /usr/src/CMake-build
|
||||||
cd /usr/src/CMake-build
|
cd /usr/src/CMake-build
|
||||||
|
|
||||||
${WRAPPER} /usr/src/CMake/bootstrap \
|
"${WRAPPER}" /usr/src/CMake/bootstrap \
|
||||||
--parallel=$(nproc) \
|
--parallel="$(nproc)" \
|
||||||
-- -DCMAKE_USE_OPENSSL=OFF
|
-- -DCMAKE_USE_OPENSSL=OFF
|
||||||
${WRAPPER} make -j$(nproc)
|
"${WRAPPER}" make -j"$(nproc)"
|
||||||
|
|
||||||
|
|
||||||
mkdir /usr/src/CMake-ssl-build
|
mkdir /usr/src/CMake-ssl-build
|
||||||
cd /usr/src/CMake-ssl-build
|
cd /usr/src/CMake-ssl-build
|
||||||
|
|
||||||
${WRAPPER} /usr/src/CMake-build/bin/cmake \
|
"${WRAPPER}" /usr/src/CMake-build/bin/cmake \
|
||||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||||
-DBUILD_TESTING:BOOL=OFF \
|
-DBUILD_TESTING:BOOL=OFF \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=/usr/src/cmake-$CMAKE_VERSION \
|
-DCMAKE_INSTALL_PREFIX:PATH="/usr/src/cmake-$CMAKE_VERSION" \
|
||||||
-DCMAKE_USE_OPENSSL:BOOL=ON \
|
-DCMAKE_USE_OPENSSL:BOOL=ON \
|
||||||
-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \
|
-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl \
|
||||||
../CMake
|
../CMake
|
||||||
${WRAPPER} make -j$(nproc) install
|
"${WRAPPER}" make -j"$(nproc)" install
|
||||||
|
|
||||||
# Cleanup install tree
|
# Cleanup install tree
|
||||||
cd /usr/src/cmake-$CMAKE_VERSION
|
cd "/usr/src/cmake-$CMAKE_VERSION"
|
||||||
rm -rf doc man
|
rm -rf doc man
|
||||||
|
|
||||||
# Install files
|
# Install files
|
||||||
|
@ -25,13 +25,13 @@ function do_curl_build {
|
|||||||
|
|
||||||
function build_curl {
|
function build_curl {
|
||||||
local curl_fname=$1
|
local curl_fname=$1
|
||||||
check_var ${curl_fname}
|
check_var "${curl_fname}"
|
||||||
local curl_sha256=$2
|
local curl_sha256=$2
|
||||||
check_var ${curl_sha256}
|
check_var "${curl_sha256}"
|
||||||
check_var ${CURL_DOWNLOAD_URL}
|
check_var "${CURL_DOWNLOAD_URL}"
|
||||||
curl -fsSLO ${CURL_DOWNLOAD_URL}/${curl_fname}.tar.gz
|
curl -fsSLO "${CURL_DOWNLOAD_URL}/${curl_fname}.tar.gz"
|
||||||
check_sha256sum ${curl_fname}.tar.gz ${curl_sha256}
|
check_sha256sum "${curl_fname}.tar.gz ${curl_sha256}"
|
||||||
tar -zxf ${curl_fname}.tar.gz
|
tar -zxf "${curl_fname}.tar.gz"
|
||||||
(cd curl-*/ && do_curl_build)
|
(cd curl-*/ && do_curl_build)
|
||||||
rm -rf curl-*
|
rm -rf curl-*
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,10 @@ url="https://mirrors.edge.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar
|
|||||||
echo "Downloading $url"
|
echo "Downloading $url"
|
||||||
curl -# -LO $url
|
curl -# -LO $url
|
||||||
|
|
||||||
tar xvzf git-${GIT_VERSION}.tar.gz --no-same-owner
|
tar xvzf "git-${GIT_VERSION}.tar.gz" --no-same-owner
|
||||||
rm -f git-${GIT_VERSION}.tar.gz
|
rm -f "git-${GIT_VERSION}.tar.gz"
|
||||||
|
|
||||||
pushd git-${GIT_VERSION}
|
pushd "git-${GIT_VERSION}"
|
||||||
./configure --prefix=/usr/local --with-curl
|
./configure --prefix=/usr/local --with-curl
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
make install
|
make install
|
||||||
@ -38,7 +38,7 @@ popd
|
|||||||
|
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|
||||||
rm -rf git-${GIT_VERSION}
|
rm -rf "git-${GIT_VERSION}"
|
||||||
|
|
||||||
# turn the detached message off
|
# turn the detached message off
|
||||||
git config --global advice.detachedHead false
|
git config --global advice.detachedHead false
|
||||||
|
@ -25,10 +25,10 @@ while [ $# -gt 0 ]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
|
wget "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz"
|
||||||
tar xvf Python-${PYTHON_VERSION}.tgz
|
tar xvf "Python-${PYTHON_VERSION}.tgz"
|
||||||
# Configure, build and install
|
# Configure, build and install
|
||||||
cd Python-${PYTHON_VERSION}
|
cd "Python-${PYTHON_VERSION}"
|
||||||
# Disable --enable-shared --enable-optimizations --prefix=/usr/local/python-${PYTHON_VERSION}
|
# Disable --enable-shared --enable-optimizations --prefix=/usr/local/python-${PYTHON_VERSION}
|
||||||
./configure --with-ensurepip=install
|
./configure --with-ensurepip=install
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
@ -39,4 +39,4 @@ ln -s /usr/local/bin/pip3 /usr/local/bin/pip
|
|||||||
|
|
||||||
# Clean
|
# Clean
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf Python-${PYTHON_VERSION}
|
rm -rf "Python-${PYTHON_VERSION}"
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
# dockcross environment -- the CMAKE_TOOLCHAIN_FILE environmental variable is
|
# dockcross environment -- the CMAKE_TOOLCHAIN_FILE environmental variable is
|
||||||
# always set in this context
|
# always set in this context
|
||||||
|
|
||||||
exec /usr/bin/ccmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} "$@"
|
exec /usr/bin/ccmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${CMAKE_TOOLCHAIN_FILE}" "$@"
|
||||||
|
@ -19,4 +19,4 @@ case $1 in
|
|||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exec /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} "$@"
|
exec /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${CMAKE_TOOLCHAIN_FILE}" "$@"
|
||||||
|
@ -37,24 +37,24 @@ fi
|
|||||||
# Command handlers
|
# Command handlers
|
||||||
#
|
#
|
||||||
command:update-image() {
|
command:update-image() {
|
||||||
$OCI_EXE pull $FINAL_IMAGE
|
$OCI_EXE pull "$FINAL_IMAGE"
|
||||||
}
|
}
|
||||||
|
|
||||||
help:update-image() {
|
help:update-image() {
|
||||||
echo Pull the latest $FINAL_IMAGE .
|
echo Pull the latest "$FINAL_IMAGE" .
|
||||||
}
|
}
|
||||||
|
|
||||||
command:update-script() {
|
command:update-script() {
|
||||||
if cmp -s <( $OCI_EXE run --rm $FINAL_IMAGE ) $0; then
|
if cmp -s <( "$OCI_EXE" run --rm "$FINAL_IMAGE" ) "$0"; then
|
||||||
echo $0 is up to date
|
echo $0 is up to date
|
||||||
else
|
else
|
||||||
echo -n Updating $0 '... '
|
echo -n Updating $0 '... '
|
||||||
$OCI_EXE run --rm $FINAL_IMAGE > $0 && echo ok
|
"$OCI_EXE" run --rm "$FINAL_IMAGE" > "$0" && echo ok
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
help:update-image() {
|
help:update-image() {
|
||||||
echo Update $0 from $FINAL_IMAGE .
|
echo Update "$0" from "$FINAL_IMAGE" .
|
||||||
}
|
}
|
||||||
|
|
||||||
command:update() {
|
command:update() {
|
||||||
@ -63,12 +63,12 @@ command:update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
help:update() {
|
help:update() {
|
||||||
echo Pull the latest $FINAL_IMAGE, and then update $0 from that.
|
echo "Pull the latest $FINAL_IMAGE, and then update $0 from that."
|
||||||
}
|
}
|
||||||
|
|
||||||
command:help() {
|
command:help() {
|
||||||
if [[ $# != 0 ]]; then
|
if [[ $# != 0 ]]; then
|
||||||
if ! has command $1; then
|
if ! has command "$1"; then
|
||||||
err \"$1\" is not an dockcross command
|
err \"$1\" is not an dockcross command
|
||||||
command:help
|
command:help
|
||||||
elif ! has help $1; then
|
elif ! has help $1; then
|
||||||
@ -250,7 +250,7 @@ if [[ $rm_exit_code != 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $run_exit_code
|
exit "$run_exit_code"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
|
@ -35,15 +35,15 @@ fi
|
|||||||
|
|
||||||
cd /usr/src
|
cd /usr/src
|
||||||
|
|
||||||
CMAKE_ROOT=cmake-${CMAKE_VERSION}-Centos5-${ARCH}
|
CMAKE_ROOT="cmake-${CMAKE_VERSION}-Centos5-${ARCH}"
|
||||||
url=https://github.com/dockbuild/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz
|
url="https://github.com/dockbuild/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_ROOT}.tar.gz"
|
||||||
echo "Downloading $url"
|
echo "Downloading $url"
|
||||||
curl -# -LO $url
|
curl -# -LO "$url"
|
||||||
|
|
||||||
tar -xzvf ${CMAKE_ROOT}.tar.gz
|
tar -xzvf "${CMAKE_ROOT}.tar.gz"
|
||||||
rm -f ${CMAKE_ROOT}.tar.gz
|
rm -f "${CMAKE_ROOT}.tar.gz"
|
||||||
|
|
||||||
cd ${CMAKE_ROOT}
|
cd "${CMAKE_ROOT}"
|
||||||
|
|
||||||
rm -rf doc man
|
rm -rf doc man
|
||||||
rm -rf bin/cmake-gui
|
rm -rf bin/cmake-gui
|
||||||
|
@ -24,10 +24,10 @@ cd /tmp
|
|||||||
# 3.6 or later
|
# 3.6 or later
|
||||||
curl -# -LO https://bootstrap.pypa.io/pip/get-pip.py
|
curl -# -LO https://bootstrap.pypa.io/pip/get-pip.py
|
||||||
#curl -# -LO https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
#curl -# -LO https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
||||||
${PYTHON} get-pip.py --ignore-installed
|
"${PYTHON}" get-pip.py --ignore-installed
|
||||||
rm get-pip.py
|
rm get-pip.py
|
||||||
|
|
||||||
${PYTHON} -m pip install --upgrade --ignore-installed setuptools
|
"${PYTHON}" -m pip install --upgrade --ignore-installed setuptools
|
||||||
${PYTHON} -m pip install --ignore-installed conan
|
"${PYTHON}" -m pip install --ignore-installed conan
|
||||||
# Purge cache to save space: https://stackoverflow.com/questions/37513597/is-it-safe-to-delete-cache-pip-directory
|
# Purge cache to save space: https://stackoverflow.com/questions/37513597/is-it-safe-to-delete-cache-pip-directory
|
||||||
${PYTHON} -m pip cache purge
|
"${PYTHON}" -m pip cache purge
|
||||||
|
@ -13,12 +13,12 @@ function check_var {
|
|||||||
# Copied from https://github.com/pypa/manylinux/blob/master/docker/build_scripts/build_utils.sh
|
# Copied from https://github.com/pypa/manylinux/blob/master/docker/build_scripts/build_utils.sh
|
||||||
function check_sha256sum {
|
function check_sha256sum {
|
||||||
local fname=$1
|
local fname=$1
|
||||||
check_var ${fname}
|
check_var "${fname}"
|
||||||
local sha256=$2
|
local sha256=$2
|
||||||
check_var ${sha256}
|
check_var "${sha256}"
|
||||||
|
|
||||||
echo "${sha256} ${fname}" > ${fname}.sha256
|
echo "${sha256} ${fname}" > "${fname}.sha256"
|
||||||
sha256sum -c ${fname}.sha256
|
sha256sum -c "${fname}.sha256"
|
||||||
rm -f ${fname}.sha256
|
rm -f "${fname}.sha256"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user