Fix shellcheck problems

Change-Id: I277fd923f62aa5888d7e18c89471909732da30e5
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Tony Sarajärvi
2024-02-13 08:19:00 +00:00
parent ebdea5a794
commit f074859391
15 changed files with 33 additions and 34 deletions

View File

@@ -27,10 +27,10 @@ DownloadAndExtract () {
sourceFile="http://ci-files01-hki.ci.qt.io/input/axivion/bauhaus-suite-7_7_4-x86_64-gnu_linux.tar.gz"
targetFile="bauhaus-suite-7_7_4-x86_64-gnu_linux.tar.gz"
sha1="df17ac0521864a7f1c0b5b3bfded1817cbf47bae"
cd $HOME
cd "$HOME"
DownloadAndExtract "$sourceFile" "$sha1" "$targetFile" "$HOME"
mkdir $HOME/.bauhaus
mkdir "$HOME/.bauhaus"
cd "$HOME/.bauhaus"
wget http://ci-files01-hki.ci.qt.io/input/axivion/Qt_Evaluation_QSR_INTERN_20250118.key
cd "$HOME"

View File

@@ -8,6 +8,7 @@
PROVISIONING_DIR="$(dirname "$0")/../.."
# shellcheck source=../unix/common.sourced.sh
source "$PROVISIONING_DIR/common/unix/common.sourced.sh"
@@ -21,8 +22,7 @@ then
fi
# Verify that yama.ptrace_scope = 0, if it's supported by the kernel.
ptrace_scope_value=`sudo sysctl kernel.yama.ptrace_scope 2>/dev/null \
| sed -E 's/.*([0-9])$/\1/'`
ptrace_scope_value=$(sudo sysctl kernel.yama.ptrace_scope 2>/dev/null | sed -E 's/.*([0-9])$/\1/')
if [ -n "$ptrace_scope_value" ] && [ "$ptrace_scope_value" != 0 ]
then
fatal "kernel.yama.ptrace_scope = $ptrace_scope_value \

View File

@@ -7,16 +7,16 @@ echo "Installing vcpkg android ports"
pushd "${BASH_SOURCE%/*}/vcpkg" || exit
cp "${BASH_SOURCE%/*}/../shared/vcpkg-configuration.json" .
$VCPKG_ROOT/vcpkg install --triplet x86-android-qt --x-install-root x86-android-qt-tmp --debug
$VCPKG_ROOT/vcpkg install --triplet x86_64-android-qt --x-install-root x86_64-android-qt-tmp --debug
"$VCPKG_ROOT/vcpkg" install --triplet x86-android-qt --x-install-root x86-android-qt-tmp --debug
"$VCPKG_ROOT/vcpkg" install --triplet x86_64-android-qt --x-install-root x86_64-android-qt-tmp --debug
mkdir -p $VCPKG_ROOT/installed
cp -R x86-android-qt-tmp/* $VCPKG_ROOT/installed/
cp -R x86_64-android-qt-tmp/* $VCPKG_ROOT/installed/
mkdir -p "$VCPKG_ROOT/installed"
cp -R x86-android-qt-tmp/* "$VCPKG_ROOT/installed/"
cp -R x86_64-android-qt-tmp/* "$VCPKG_ROOT/installed/"
versions=$(jq -r '.overrides[] | "vcpkg \(.name) for android = \(.version)"' vcpkg.json)
versions="${versions//vcpkg/\\nvcpkg}"
echo $versions >> ~/versions.txt
echo "$versions" >> ~/versions.txt
rm -rf x86-android-qt-tmp
rm -rf x86_64-android-qt-tmp

View File

@@ -7,14 +7,14 @@ echo "Installing vcpkg ports"
pushd "${BASH_SOURCE%/*}/vcpkg" || exit
cp "${BASH_SOURCE%/*}/../shared/vcpkg-configuration.json" .
$VCPKG_ROOT/vcpkg install --triplet x64-linux-qt --x-install-root x64-linux-qt-tmp --debug
"$VCPKG_ROOT/vcpkg" install --triplet x64-linux-qt --x-install-root x64-linux-qt-tmp --debug
mkdir -p "$VCPKG_ROOT/installed"
cp -R x64-linux-qt-tmp/* $VCPKG_ROOT/installed/
cp -R x64-linux-qt-tmp/* "$VCPKG_ROOT/installed/"
versions=$(jq -r '.overrides[] | "vcpkg \(.name) = \(.version)"' vcpkg.json)
versions="${versions//vcpkg/\\nvcpkg}"
echo $versions >> ~/versions.txt
echo "$versions" >> ~/versions.txt
rm -rf x64-linux-qt-tmp

View File

@@ -28,11 +28,11 @@ vcpkgToolSourceFolder="$HOME/vcpkg-tool-$vcpkgToolReleaseTag"
vcpkgToolBuildFolder="$HOME/vcpkg-tool-$vcpkgToolReleaseTag/build"
InstallFromCompressedFileFromURL "$vcpkgToolCacheUrl" "$vcpkgToolOfficialUrl" "$vcpkgToolSHA1" "$HOME" ""
cmake -S $vcpkgToolSourceFolder -B $vcpkgToolBuildFolder -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF
cmake --build $vcpkgToolBuildFolder --parallel
cmake -S "$vcpkgToolSourceFolder" -B "$vcpkgToolBuildFolder" -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF
cmake --build "$vcpkgToolBuildFolder" --parallel
cp $vcpkgToolBuildFolder/vcpkg $vcpkgRoot/
rm -rf $vcpkgToolSourceFolder
cp "$vcpkgToolBuildFolder/vcpkg" "$vcpkgRoot/"
rm -rf "$vcpkgToolSourceFolder"
if [ ! -f "$vcpkgRoot/vcpkg" ]
then

View File

@@ -12,13 +12,13 @@ dir_length=${#dir}
dylib_regex="^$dir/.*\.dylib$"
find "$dir" -type f -name '*.dylib' | while read -r library_path; do
install_name=$(otool -D "$library_path" | sed -n '2p' | egrep "$dylib_regex" )
install_name=$(otool -D "$library_path" | sed -n '2p' | grep -E "$dylib_regex" )
if [ -n "$install_name" ]; then
fixed_install_name="@rpath${install_name:dir_length}"
install_name_tool -id "$fixed_install_name" "$library_path"
fi
otool -L "$library_path" | awk '/\t/ {print $1}' | egrep "$dylib_regex" | while read -r dependency_path; do
otool -L "$library_path" | awk '/\t/ {print $1}' | grep -E "$dylib_regex" | while read -r dependency_path; do
fixed_dependency_path="@loader_path${dependency_path:dir_length}"
install_name_tool -change "$dependency_path" "$fixed_dependency_path" "$library_path"
done

View File

@@ -50,7 +50,7 @@ VerifyHash () {
*) echo "FATAL! Unknown hash length: $hashLength" 1>&2 ;;
esac | cut -d ' ' -f 1`
if [ -z $hash ] || [ ! "$expectedHash" = "$hash" ]
if [ -z "$hash" ] || [ ! "$expectedHash" = "$hash" ]
then
echo "FAIL! wrong file hash: $file $hash" 1>&2
return 1

View File

@@ -22,7 +22,7 @@ prefix="/usr/local/ios/ffmpeg"
if [ ! -d "$ffmpeg_source_dir" ];
then
InstallFromCompressedFileFromURL "$url_cached" "$url_public" "$sha1" "$target_dir" "$app_prefix"
InstallFromCompressedFileFromURL "$url_cached" "$url_public" "$sha1" "$target_dir"
fi
ffmpeg_config_options=$(cat "${BASH_SOURCE%/*}/../shared/ffmpeg_config_options.txt")
@@ -44,7 +44,8 @@ build_ffmpeg_ios() {
sudo mkdir -p "$build_dir"
pushd "$build_dir"
sudo $ffmpeg_source_dir/configure $ffmpeg_config_options \
# shellcheck disable=SC2086
sudo "$ffmpeg_source_dir/configure" $ffmpeg_config_options \
--sysroot="$(xcrun --sdk "$target_sdk" --show-sdk-path)" \
--enable-cross-compile \
--enable-optimizations \

View File

@@ -86,7 +86,7 @@ elif [ "$os" == "macos" ] || [ "$os" == "macos-universal" ]; then
fix_relative_dependencies="${BASH_SOURCE%/*}/../macos/fix_relative_dependencies.sh"
xcode_major_version=$(xcodebuild -version | awk 'NR==1 {split($2, a, "."); print a[1]}')
if [ $xcode_major_version -ge 15 ]; then
if [ "$xcode_major_version" -ge 15 ]; then
# fix the error: duplicate symbol '_av_ac3_parse_header'
ffmpeg_config_options+=" --extra-ldflags=-Wl,-ld_classic"
fi

View File

@@ -36,16 +36,12 @@ sudo mkdir "$testSuiteLocal"
# Check which platform
if uname -a |grep -q Darwin; then
usersGroup="staff"
squishLicenseDir="/Users/qt"
elif uname -a |grep -q "el7"; then
usersGroup="qt"
squishLicenseDir="/root"
elif uname -a |grep -q "Ubuntu"; then
usersGroup="users"
squishLicenseDir="/home/qt"
else
usersGroup="users"
squishLicenseDir="/root"
fi
targetFileMount="$mountFolder"/"$compressedFolder"

View File

@@ -2,6 +2,8 @@
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
# Setups sbuild environment
tee ~/.sbuildrc << EOF
@@ -44,8 +46,8 @@ sudo sbuild-createchroot --include=eatmydata,ccache,gnupg,ca-certificates stable
echo "Create chroot for Ubuntu Jammy"
# First we need update the deboostrap scripts
mkdir -p $HOME/deboot
cd $HOME/deboot
mkdir -p "$HOME"/deboot
cd "$HOME"/deboot
# Orig url http://ftp.fi.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.134~bpo12+1.tar.gz
# we have to update the debootstrap so that sbuild-createroot will recognize jammy code name
wget http://ci-files01-hki.ci.qt.io/input/debian/debootstrap/debootstrap_1.0.134~bpo12+1.tar.gz
@@ -53,7 +55,7 @@ tar xzvf debootstrap_1.0.134~bpo12+1.tar.gz
cd debootstrap
sudo make install
cd
rm -rf $HOME/deboot
rm -rf "$HOME"/deboot
sudo sbuild-createchroot --include=gnupg,ca-certificates jammy /srv/chroot/jammy-arm64 http://ports.ubuntu.com/ubuntu-ports/
echo "Done creating chroot for Ubuntu Jammy"

View File

@@ -42,7 +42,7 @@
# This script installs python3
# shellcheck source=../unix/SetEnvVar.sh
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# Try with default

View File

@@ -42,7 +42,7 @@
# This script installs python3
# shellcheck source=../unix/SetEnvVar.sh
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# Try with default

View File

@@ -42,7 +42,7 @@
# This script installs python3
# shellcheck source=../unix/SetEnvVar.sh
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# Try with default

View File

@@ -42,7 +42,7 @@
# This script installs python3
# shellcheck source=../unix/SetEnvVar.sh
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# Try with default