]> git.proxmox.com Git - pve-installer.git/commitdiff
build: run shellcheck as part of `test` step
authorChristoph Heiss <c.heiss@proxmox.com>
Fri, 15 Mar 2024 10:23:45 +0000 (11:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 22 Mar 2024 10:38:50 +0000 (11:38 +0100)
Especially unconfigured.sh is worth checking consistently.

Running shellcheck also does not really have any notable impact on build
time, so no downside there either.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Makefile
debian/control
unconfigured.sh
xinitrc

index f0c361b96d60bda6ae215b5b8c47efd332c3cce5..af33e909494567a08f75394186bd050b4f51bedf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,13 @@ USR_BIN := proxmox-tui-installer
 COMPILED_BINS := \
        $(addprefix $(CARGO_COMPILEDIR)/,$(USR_BIN))
 
+SHELL_SCRIPTS := \
+       fake-start-stop-daemon \
+       policy-disable-rc.d \
+       spice-vdagent.sh \
+       unconfigured.sh \
+       xinitrc
+
 all:
 
 $(BUILDDIR):
@@ -36,18 +43,14 @@ $(BUILDDIR):
          banner/ \
          checktime \
          country.pl \
-         fake-start-stop-daemon \
          html/ \
          interfaces \
-         policy-disable-rc.d \
          proxinstall \
          proxmox-low-level-installer \
          proxmox-tui-installer/ \
          proxmox-installer-common/ \
-         spice-vdagent.sh \
          test/ \
-         unconfigured.sh \
-         xinitrc \
+         $(SHELL_SCRIPTS) \
          $@.tmp
        cp -a debian $@.tmp/
        mv $@.tmp $@
@@ -86,6 +89,7 @@ prepare-test-env: cd-info.test country.dat test.img
 
 .PHONY: test
 test: prepare-test-env
+       shellcheck $(SHELL_SCRIPTS)
        $(MAKE) -C test check
        $(CARGO) test --workspace $(CARGO_BUILD_ARGS)
 
index 9057f59467cc561e0a68e28594674ab70b91a5fb..3ca208b296beca5f5bc2d4562b7d98501c5ce6cb 100644 (file)
@@ -15,6 +15,7 @@ Build-Depends: cargo:native,
                libtest-mockmodule-perl,
                perl,
                rustc:native,
+               shellcheck,
 Standards-Version: 4.5.1
 Homepage: https://www.proxmox.com
 
index b921fc27908967708cdfb14e10e8430c418a2b4b..2b371f089fe3594a6acf2e3ea413e05fc324a4df 100755 (executable)
@@ -99,6 +99,8 @@ real_reboot() {
     exit 0 # shouldn't be reached, kernel will panic in that case
 }
 
+# reachable through the ERR trap
+# shellcheck disable=SC2317
 err_reboot() {
     printf "\nInstallation aborted - unable to continue (type exit or CTRL-D to reboot)\n"
     debugsh || true
@@ -242,4 +244,5 @@ killall5 -15
 real_reboot
 
 # never reached
+# shellcheck disable=SC2317
 exit 0
diff --git a/xinitrc b/xinitrc
index 789a2671bbfea9c3589d8868e7f4681657079cde..5125406aeb1d3bb1d033ccf8710cea1e06b3c547 100644 (file)
--- a/xinitrc
+++ b/xinitrc
@@ -1,3 +1,5 @@
+#!/bin/sh
+
 /usr/bin/xrdb -load /.Xdefaults
 /usr/bin/X11/xsetroot -solid grey
 openbox &