From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 24D31B9898 for ; Fri, 15 Mar 2024 11:25:10 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0C60F1912A for ; Fri, 15 Mar 2024 11:24:40 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 15 Mar 2024 11:24:39 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1D3D945AE4 for ; Fri, 15 Mar 2024 11:24:39 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Fri, 15 Mar 2024 11:23:45 +0100 Message-ID: <20240315102345.458366-2-c.heiss@proxmox.com> X-Mailer: git-send-email 2.43.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [spice-vdagent.sh, unconfigured.sh, country.pl, proxmox.com] Subject: [pve-devel] [PATCH installer] build: run shellcheck as part of `test` step X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Mar 2024 10:25:10 -0000 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 --- Makefile | 14 +++++++++----- debian/control | 1 + unconfigured.sh | 3 +++ xinitrc | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f0c361b..af33e90 100644 --- 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) diff --git a/debian/control b/debian/control index 9057f59..3ca208b 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/unconfigured.sh b/unconfigured.sh index cf7de83..84b249c 100755 --- a/unconfigured.sh +++ b/unconfigured.sh @@ -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 789a267..5125406 100644 --- a/xinitrc +++ b/xinitrc @@ -1,3 +1,5 @@ +#!/bin/sh + /usr/bin/xrdb -load /.Xdefaults /usr/bin/X11/xsetroot -solid grey openbox & -- 2.43.1