Fix indentation in shell scripts master
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 3 Oct 2024 15:03:49 +0000 (11:03 -0400)
committerKienan Stewart <kstewart@efficios.com>
Fri, 4 Oct 2024 12:33:50 +0000 (08:33 -0400)
There is currently a mix of tabs and spaces in shell scripts.  The most
common style appears to be 4 spaces, so convert everything to that.
Modify `.editorconfig` to try to enforce that style.

Change-Id: Ic2c9a051a2713cc97d071bf3581952ee16985aa3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
17 files changed:
.editorconfig
lava/kvm/generate_kvm_virsh.sh
scripts/babeltrace-benchmark/benchmark.sh
scripts/babeltrace/build.sh
scripts/binutils-gdb/build.sh
scripts/common/coverity.sh
scripts/common/print.sh
scripts/common/scan-build.sh
scripts/librseq/build.sh
scripts/liburcu/build.sh
scripts/lttng-tools/build.sh
scripts/lttng-tools/gerrit-depends-on.sh
scripts/lttng-tools/postbuild_clean_processes_coredumps.sh
scripts/lttng-tools/release.sh
scripts/lttng-ust/build.sh
scripts/packaging/test-run.sh
scripts/system-tests/checkout-modules.sh

index 316a6d9a3c97adfb9c247a2ca72e78a6b0480878..cf53910156b63835139c1fc37226bd09bd5f2df2 100644 (file)
@@ -19,3 +19,7 @@ indent_size = 2
 [*.py]
 indent_style = space
 indent_size = 4
+
+[*.sh]
+indent_style = space
+indent_size = 4
index 07cb91e012c97473d061e91e2551b64e96d7966d..e3bacd3113c3e242352d2cf47f5e64ab28bfe94c 100755 (executable)
@@ -23,18 +23,18 @@ virsh vol-create-as --pool default --name "${name}.raw" --capacity 2G --format r
 data_disk_path="$(virsh vol-path ${name}.raw --pool default)"
 sudo mkfs.ext4 "$data_disk_path"
 virt-install --print-xml \
-       --name "$name" \
-       --memory 2096\
-       --disk /var/lib/libvirt/images/ipxe.iso,device=cdrom \
-       --boot cdrom \
-       --disk "$data_disk_path,format=raw" \
-       --vcpus 2 \
-       --cpu host \
-       --serial pty \
-       --graphics none \
-       --autostart \
-       --network bridge=br0 \
-       --check path_in_use=off > "$tmp"
+    --name "$name" \
+    --memory 2096\
+    --disk /var/lib/libvirt/images/ipxe.iso,device=cdrom \
+    --boot cdrom \
+    --disk "$data_disk_path,format=raw" \
+    --vcpus 2 \
+    --cpu host \
+    --serial pty \
+    --graphics none \
+    --autostart \
+    --network bridge=br0 \
+    --check path_in_use=off > "$tmp"
 virsh define --validate "$tmp"
 virsh start "$name"
 rm -rf "$tmp"
index 9a3256b313ad4b0227520094e80a7eb31cd80f20..bb0d937f49894c1e32a79c84adf93ac7b9641e47 100755 (executable)
@@ -30,28 +30,28 @@ mkdir -p "$TMPDIR"
 export TMPDIR
 
 function checkout_scripts() {
-       git clone https://github.com/lttng/lttng-ci.git "$SCRIPT_DIR"
+    git clone https://github.com/lttng/lttng-ci.git "$SCRIPT_DIR"
 }
 
 function setup_env ()
 {
-       mkdir -p "$RESULTS_DIR"
-       virtualenv --python python3 "$VENV"
-       set +u
-        # shellcheck disable=SC1090
-       . "${VENV}/bin/activate"
-       set -u
-       pip install -r "$REQUIREMENT_PATH"
+    mkdir -p "$RESULTS_DIR"
+    virtualenv --python python3 "$VENV"
+    set +u
+    # shellcheck disable=SC1090
+    . "${VENV}/bin/activate"
+    set -u
+    pip install -r "$REQUIREMENT_PATH"
 }
 
 function run_jobs ()
 {
-       python "$SCRIPT_PATH" --generate-jobs --repo-path "$SRC_DIR"
+    python "$SCRIPT_PATH" --generate-jobs --repo-path "$SRC_DIR"
 }
 
 function generate_report ()
 {
-       python "$SCRIPT_PATH" --generate-report --repo-path "$SRC_DIR" --report-name "${RESULTS_DIR}/babeltrace-benchmark.pdf"
+    python "$SCRIPT_PATH" --generate-report --repo-path "$SRC_DIR" --report-name "${RESULTS_DIR}/babeltrace-benchmark.pdf"
 }
 
 checkout_scripts
index 7b7318e7cbb7fdee65f7a2c5cd13aa8395d6080c..4ce38ac7294e909fd6ee3eceae04997747d1b10d 100755 (executable)
@@ -154,7 +154,7 @@ exit_status=0
 # Use bear to generate compile_commands.json when enabled
 BEAR=""
 if [ "$BABELTRACE_GEN_COMPILE_COMMANDS" = "yes" ]; then
-       BEAR="bear"
+    BEAR="bear"
 fi
 
 # Create tmp directory
index 3d7c561a477f60e75105289a7c2f9ca803a8fe5a..951314c79640a49fec86e518ef0cdf4051fcd38d 100755 (executable)
@@ -212,8 +212,8 @@ export CC="cc"
 export CXX="c++"
 
 if use_ccache; then
-       CC="ccache $CC"
-       CXX="ccache $CXX"
+    CC="ccache $CC"
+    CXX="ccache $CXX"
 fi
 
 # To make GDB find libcc1.so
@@ -244,7 +244,7 @@ print_os || true
 print_tooling || true
 
 if use_ccache; then
-       ccache -c
+    ccache -c
 fi
 
 # This job has been seen generating cores in /tmp, filling and and causing
index 21e76aba68f0312303cacf1867b732601d33c7b0..0bcc84b0842fbf23cc733ca85959232356d60df9 100755 (executable)
@@ -86,7 +86,7 @@ lttng-ust)
 esac
 
 if [ -d "$WORKSPACE/src/linux" ]; then
-       export KERNELDIR="$WORKSPACE/src/linux"
+    export KERNELDIR="$WORKSPACE/src/linux"
 fi
 
 # Enter the source directory
index b45b2b9560c2ef3e8696e990a43ba49508809d0c..a0bcc574bcdc3c41e478a3267cd187abcefb83cc 100755 (executable)
@@ -9,7 +9,7 @@ COLOR_BLUE='\033[0;34m'
 COLOR_NONE='\033[0m' # No Color
 
 print_blue() {
-       echo -e "${COLOR_BLUE}$1${COLOR_NONE}"
+    echo -e "${COLOR_BLUE}$1${COLOR_NONE}"
 }
 
 print_hardware() {
@@ -41,7 +41,7 @@ print_os() {
         echo "Version: $(head -n1 /etc/release)"
     elif command -v sw_vers >/dev/null 2>&1; then
         # For MacOS
-       echo "Version: $(sw_vers -productName) $(sw_vers -productVersion)"
+        echo "Version: $(sw_vers -productName) $(sw_vers -productVersion)"
     fi
 
     echo -n "Kernel: "
@@ -96,7 +96,7 @@ print_tooling() {
 
     if command -v cmake >/dev/null 2>&1; then
         print_blue "cmake version"
-       cmake --version
+        cmake --version
     fi
 
     print_blue "automake version"
@@ -146,17 +146,17 @@ print_tooling() {
 
     if command -v asciidoc >/dev/null 2>&1; then
         print_blue "asciidoc version"
-       asciidoc --version
+        asciidoc --version
     fi
 
     if command -v xmlto >/dev/null 2>&1; then
         print_blue "xmlto version"
-       xmlto --version
+        xmlto --version
     fi
 
     if command -v openssl >/dev/null 2>&1; then
         print_blue "openssl version"
-       openssl version
+        openssl version
     fi
 
     if command -v pkg-config >/dev/null 2>&1; then
@@ -170,7 +170,7 @@ print_tooling() {
         print_pkgconfig_mod libdw
         print_pkgconfig_mod libelf
         print_pkgconfig_mod libxml-2.0
-       print_pkgconfig_mod msgpack
+        print_pkgconfig_mod msgpack
         print_pkgconfig_mod popt
         print_pkgconfig_mod uuid
         print_pkgconfig_mod zlib
index 478fff1f5045b7d37728ec324621e7bb12f709ea..1dd980cd8c3834de9925e74b659d294e808f62e6 100755 (executable)
@@ -88,7 +88,7 @@ lttng-ust)
 esac
 
 if [ -d "$WORKSPACE/src/linux" ]; then
-       export KERNELDIR="$WORKSPACE/src/linux"
+    export KERNELDIR="$WORKSPACE/src/linux"
 fi
 
 # Enter the source directory
index 5a10c2e7a522cdcc033ee007c021772433a0a7b3..693c3337f3355c32e419aeb104f5cbb87eb60ee9 100755 (executable)
@@ -127,7 +127,7 @@ exit_status=0
 # Use bear to generate compile_commands.json when enabled
 BEAR=""
 if [ "$LIBRSEQ_GEN_COMPILE_COMMANDS" = "yes" ]; then
-       BEAR="bear"
+    BEAR="bear"
 fi
 
 # Create tmp directory
@@ -162,7 +162,7 @@ clang-*)
     ;;
 *)
     if [ "x$cc" != "x" ]; then
-           export CC="$cc"
+        export CC="$cc"
     fi
     ;;
 esac
index 40f3469457520d373ecc8108e154158f70c16ceb..a82325553dd007541a40566754cca190a183da66 100755 (executable)
@@ -149,7 +149,7 @@ exit_status=0
 # Use bear to generate compile_commands.json when enabled
 BEAR=""
 if [ "$USERSPACE_RCU_GEN_COMPILE_COMMANDS" = "yes" ]; then
-       BEAR="bear"
+    BEAR="bear"
 fi
 
 # Create tmp directory
@@ -180,7 +180,7 @@ clang-*)
     ;;
 *)
     if [ "x$cc" != "x" ]; then
-           export CC="$cc"
+        export CC="$cc"
     fi
     ;;
 esac
index 41b1fb763614c2c5111ef6650c8256f10259c382..b5198e2c2a971a68fe071a0dc54f263bafb79a74 100755 (executable)
@@ -182,7 +182,7 @@ exit_status=0
 # Use bear to generate compile_commands.json when enabled
 BEAR=""
 if [ "$LTTNG_TOOLS_GEN_COMPILE_COMMANDS" = "yes" ]; then
-       BEAR="bear"
+    BEAR="bear"
 fi
 
 # Create tmp directory
@@ -232,7 +232,7 @@ clang-*)
     ;;
 *)
     if [ "x$cc" != "x" ]; then
-           export CC="$cc"
+        export CC="$cc"
     fi
     ;;
 esac
@@ -267,9 +267,9 @@ cygwin|cygwin64|msys32|msys64)
     if command -v $PYTHON2 >/dev/null 2>&1; then
         P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
         DEPS_PYTHON2="$WORKSPACE/deps/build/$LIBDIR/python$P2_VERSION/site-packages"
-       if [ "$LIBDIR" != "$LIBDIR_ARCH" ]; then
+        if [ "$LIBDIR" != "$LIBDIR_ARCH" ]; then
             DEPS_PYTHON2="$DEPS_PYTHON2:$WORKSPACE/deps/build/$LIBDIR_ARCH/python$P2_VERSION/site-packages"
-       fi
+        fi
     fi
 
     P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))')
index 5b55c82672f2edc8838914f919a1e676aa8bc12f..f61f53bba766cbd084e5f1455489dc6e6685ae05 100755 (executable)
@@ -88,39 +88,39 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do
             # the change id. We could also be clever and require that the
             # "branch name" be included in the `Depends-on` clause.
             local_query="${gerrit_url}/changes/?q=change:${gerrit_id}+branch:${GERRIT_BRANCH}${gerrit_query}"
-           default_branch="${GERRIT_BRANCH}"
+            default_branch="${GERRIT_BRANCH}"
             ;;
         *)
             local_query="${gerrit_url}/changes/?q=change:${gerrit_id}${gerrit_query}"
-           default_branch="master"
+            default_branch="master"
             ;;
     esac
 
     json_doc=$(curl "$local_query" | tail -n+2)
     count=$(jq -r '. | length' <<< "$json_doc")
     if [ "$count" != "1" ]; then
-           echo "Expected an array of size 1 got $count"
-           exit 1
+        echo "Expected an array of size 1 got $count"
+        exit 1
     fi
 
     ref=$(jq -r "$gerrit_json_query" <<< "$json_doc")
     change_status=$(jq -r "$gerrit_json_query_status" <<< "$json_doc")
     if [ "$change_status" == "MERGED" ]; then
-           # When the change we depends on is merged use master as the ref.
-           # This is not ideal CI time wise since we do not reuse artifacts.
-           # This solve a tricky situation where we actually want to use master
-           # instead of the change available on gerrit. Intermediary changes
-           # present in master could have an impact on the change under test.
-           echo "Depends-on change is MERGED. Defaulting to ${default_branch}"
-           ref="refs/heads/$default_branch"
+        # When the change we depends on is merged use master as the ref.
+        # This is not ideal CI time wise since we do not reuse artifacts.
+        # This solve a tricky situation where we actually want to use master
+        # instead of the change available on gerrit. Intermediary changes
+        # present in master could have an impact on the change under test.
+        echo "Depends-on change is MERGED. Defaulting to ${default_branch}"
+        ref="refs/heads/$default_branch"
     elif [ "$change_status" == "ABANDONED" ]; then
-           # We have a situation where the "HEAD" commit for feature branch are
-           # not merged and abandoned. Default to the master branch and hope
-           # for the best. This is far from ideal but we need might also need
-           # to find a better way to handle feature branch here. In the
-           # meantime use master for such cases.
-           echo "Depends-on change is ABANDONED. Defaulting to ${default_branch}"
-           ref="refs/heads/${default_branch}"
+        # We have a situation where the "HEAD" commit for feature branch are
+        # not merged and abandoned. Default to the master branch and hope
+        # for the best. This is far from ideal but we need might also need
+        # to find a better way to handle feature branch here. In the
+        # meantime use master for such cases.
+        echo "Depends-on change is ABANDONED. Defaulting to ${default_branch}"
+        ref="refs/heads/${default_branch}"
     fi
 
     # The build.sh script from userspace-rcu expects the source to be located in
@@ -128,7 +128,7 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do
     if [ "$project" = "userspace-rcu" ]; then
         clone_directory="liburcu"
     else
-       clone_directory="$project"
+        clone_directory="$project"
     fi
 
     clone_directory="$WORKSPACE/src/$clone_directory"
index 2f56e8ca332d455e97b0f69ddb9696666a391c1a..bc62b1ae9ab1bf66fd8f3e626494f886bb8233ef 100755 (executable)
@@ -57,12 +57,12 @@ while read -r core_file; do
     # Make sure the coredump is finished using fuser
     while fuser "$core_file"; do
         sleep 1
-       sleep_count+=1
+        sleep_count+=1
 
-       # Skip the core file if it takes more than 30 seconds
-       if [ "$sleep_count" -ge 30 ]; then
-               continue
-       fi
+        # Skip the core file if it takes more than 30 seconds
+        if [ "$sleep_count" -ge 30 ]; then
+            continue
+        fi
     done
 
     # Print a full backtrace of all threads
index 430ab4e59259cf763a27c7112737d9b6c441a3d0..3268e496ab2b59a73c66047537ea2a90635beb9e 100644 (file)
@@ -113,7 +113,7 @@ export TMPDIR="$tmpdir"
 # the trace reader in its test suite or that we move to only supporting
 # babeltrace2
 if [ -x "$DEPS_BIN/babeltrace2" ]; then
-       ln -s "$DEPS_BIN/babeltrace2" "$DEPS_BIN/babeltrace"
+    ln -s "$DEPS_BIN/babeltrace2" "$DEPS_BIN/babeltrace"
 fi
 
 # When using babeltrace2 make sure that it finds its plugins and
index 26672ca084d4367ab9a98eef3a5680f4193c2282..8f6164a50065de037b07188a8b9c872f26393c34 100755 (executable)
@@ -139,7 +139,7 @@ exit_status=0
 # Use bear to generate compile_commands.json when enabled
 BEAR=""
 if [ "$LTTNG_UST_GEN_COMPILE_COMMANDS" = "yes" ]; then
-       BEAR="bear"
+    BEAR="bear"
 fi
 
 # Create tmp directory
@@ -170,7 +170,7 @@ clang-*)
     ;;
 *)
     if [ "x$cc" != "x" ]; then
-           export CC="$cc"
+        export CC="$cc"
     fi
     ;;
 esac
@@ -246,7 +246,7 @@ agents)
 
     # Explicitly add '--enable-java-agent-log4j2', it's not part of '-all' in stable 2.12/2.13
     if verlt "$PACKAGE_VERSION" "2.14"; then
-           CONF_OPTS+=("--enable-java-agent-log4j2")
+        CONF_OPTS+=("--enable-java-agent-log4j2")
     fi
     ;;
 
index 25d432ef7b94ebae713a7178f56bc6604edbcf91..e0cc66d135cb6cdda8a9547eceecd76129c4bd09 100755 (executable)
@@ -10,7 +10,7 @@ lttng stop
 
 count=$(lttng view | wc -l)
 if [ $count -lt "100" ]; then
-       false
+    false
 fi
 
 
index 9a8442b28d9ce8e7b14363fac240c96ec866dd0c..a0394679687005ad6e52d9ea9f6821aa77492b32 100755 (executable)
@@ -18,5 +18,5 @@
 set -exu
 
 git clone "$LTTNG_MODULES_REPO" src/lttng-modules && \
-       cd src/lttng-modules && \
-       git reset --hard "$LTTNG_MODULES_COMMIT_ID"
+    cd src/lttng-modules && \
+    git reset --hard "$LTTNG_MODULES_COMMIT_ID"
This page took 0.033438 seconds and 4 git commands to generate.