Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
52884c8
Fixed broken comment after autoformatting
larsewi Sep 2, 2025
f819af9
shellcheck.yml: added workflow to lint shell scripts
larsewi Sep 1, 2025
c97db55
functions: fixed shellcheck issues
larsewi Sep 2, 2025
3af8218
compile-options: fixed shellcheck issues
larsewi Sep 2, 2025
e2cd391
build-environment-check: fixed shellcheck issues
larsewi Sep 2, 2025
b4af172
clean-results: fixed shellcheck issues
larsewi Sep 2, 2025
b55f26b
compile: fixed shellcheck issues
larsewi Sep 2, 2025
482189c
detect-environment: fixed shellcheck issues
larsewi Sep 2, 2025
b3112a2
install-dependencies: fixed shellcheck issues
larsewi Sep 2, 2025
759e525
package: fixed shellcheck issues
larsewi Sep 2, 2025
9be4d61
package-msi: fixed shellcheck issues
larsewi Sep 2, 2025
c57f94b
prepare-results: fixed shellcheck issues
larsewi Sep 2, 2025
2f67cfc
prepare-testmachine: fixed shellcheck issues
larsewi Sep 2, 2025
e624078
produce-debug-symbols: fixed shellcheck issues
larsewi Sep 2, 2025
198caee
test: fixed shellcheck issues
larsewi Sep 2, 2025
22c5bba
test-chroot: fixed shellcheck issues
larsewi Sep 2, 2025
11f5161
test-on-testmachine: fixed shellcheck issues
larsewi Sep 2, 2025
92ac5d0
transfer-to-buildmachine: fixed shellcheck issues
larsewi Sep 3, 2025
80ec5db
transfer-to-windowsmachine: fixed shellcheck issues
larsewi Sep 3, 2025
5e3d8e9
test-on-thismachine: fixed shellcheck issues
larsewi Sep 3, 2025
7c79234
test-on-windows: fixed shellcheck issues
larsewi Sep 3, 2025
c7ae103
transfer-results: fixed shellcheck issues
larsewi Sep 3, 2025
a539fa4
transfer-to-testmachine: fixed shellcheck issues
larsewi Sep 3, 2025
75968eb
unpack-tarballs: fixed shellcheck issues
larsewi Sep 3, 2025
c24a3f9
compile-options: documented & refactored script
larsewi Sep 3, 2025
c8b0f28
compile-option: Remove auto detect role code
larsewi Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: shellcheck

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt install shellcheck
- name: Lint sources with shellcheck
run: |
# Recursively find all shell scripts in the build-scripts directory with a shebang
grep -Erl '^(#!/(bin|usr/bin)/(env )?(sh|bash))' build-scripts/ | while read -r file; do
shellcheck --external-sources --source-path=build-scripts "$file"
done
4 changes: 1 addition & 3 deletions build-scripts/bootstrap-tarballs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ run_and_print_on_failure ./configure
echo "$(basename "$0"): Debug: Running make dist on masterfiles repository..."
run_and_print_on_failure make dist # source tarball
echo "$(basename "$0"): Debug: Running make tar-package on masterfiles repository..."
run_and_print_on_failure make tar-package # package tarball (containing all
# files as if they were installed
# under "prefix".)
run_and_print_on_failure make tar-package # package tarball (containing all files as if they were installed under "prefix".)
mv cfengine-masterfiles*.tar.gz "$BASEDIR"/output/tarballs/
echo "$(basename "$0"): Debug: Running make distclean on masterfiles repository..."
run_and_print_on_failure make distclean
Expand Down
10 changes: 5 additions & 5 deletions build-scripts/build-environment-check
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

. $(dirname "$0")/functions
. "$(dirname "$0")"/functions
. detect-environment
. compile-options

Expand Down Expand Up @@ -45,17 +45,17 @@ DEP_LIST="$DEP_LIST rsync gcc make sudo wget"

RET=0
for unwanted in $UNWANTED_DEPS; do
if query_pkg $unwanted; then
echo "ERROR Found unwanted package:" $unwanted
if query_pkg "$unwanted"; then
echo "ERROR Found unwanted package: $unwanted"
RET=1
fi
done

for dep in $DEP_LIST; do
if query_pkg $dep; then
if query_pkg "$dep"; then
true
else
echo "ERROR Missing system package:" $dep
echo "ERROR Missing system package: $dep"
RET=1
fi
done
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/clean-results
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -ex

. $(dirname "$0")/functions
. "$(dirname "$0")"/functions
. version

# This script is designed to clean up old directories, specifically keeping the
Expand Down
16 changes: 8 additions & 8 deletions build-scripts/compile
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ nova)
esac

echo "$(basename "$0"): Debug: Running make in core repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/core -k
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/core -k
echo "$(basename "$0"): Debug: Running make install in core repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/core install DESTDIR="$BASEDIR"/cfengine/dist
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/core install DESTDIR="$BASEDIR"/cfengine/dist

if [ "$NOVA" = yes ]; then
echo "$(basename "$0"): Debug: Running make in enterprise repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/enterprise -k
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/enterprise -k
echo "$(basename "$0"): Debug: Running make install in enterprise repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/enterprise install DESTDIR="$BASEDIR"/cfengine/dist
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/enterprise install DESTDIR="$BASEDIR"/cfengine/dist
if [ "$ROLE" = hub ]; then
echo "$(basename "$0"): Debug: Running make in nova repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/nova -k
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/nova -k
echo "$(basename "$0"): Debug: Running make install in nova repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/nova install DESTDIR="$BASEDIR"/cfengine/dist
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/nova install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make install in masterfiles repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
fi
else
echo "$(basename "$0"): Debug: Running make install in masterfiles repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
run_and_print_on_failure "$MAKE" -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
fi
Loading
Loading