From 88e0972a3ca381f8eb43981cf9ea719619f30527 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Thu, 16 Jan 2020 10:31:49 -0500 Subject: [PATCH 1/3] Fix a potential 'globbing' issue Caught by ShellCheck Signed-off-by: Daniel F. Dickinson --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9e78728..19e3d79 100755 --- a/build.sh +++ b/build.sh @@ -252,7 +252,7 @@ for EXPORT_DIR in ${EXPORT_DIRS}; do fi done -if [ -x ${BASE_DIR}/postrun.sh ]; then +if [ -x "${BASE_DIR}"/postrun.sh ]; then log "Begin postrun.sh" cd "${BASE_DIR}" ./postrun.sh From 9efaea5036c4362f2ba9381de44bb46c1d48bd2e Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Thu, 16 Jan 2020 10:34:16 -0500 Subject: [PATCH 2/3] Enable syntax highlighting/linting for scriptlets Various editors depend on the shebang line to determine what language to use for syntax highlighting and/or linting. Therefore add one. It is ignored when sourcing and the scriplets are not executable so the shebang will never be used. Signed-off-by: Daniel F. Dickinson --- scripts/common | 2 ++ scripts/dependencies_check | 2 ++ stage2/EXPORT_IMAGE | 2 ++ stage2/EXPORT_NOOBS | 3 +++ stage4/EXPORT_IMAGE | 2 ++ stage4/EXPORT_NOOBS | 3 +++ stage5/EXPORT_IMAGE | 2 ++ stage5/EXPORT_NOOBS | 3 +++ 8 files changed, 19 insertions(+) diff --git a/scripts/common b/scripts/common index e2048d9..aa52c89 100644 --- a/scripts/common +++ b/scripts/common @@ -1,3 +1,5 @@ +#!/bin/bash + log (){ date +"[%T] $*" | tee -a "${LOG_FILE}" } diff --git a/scripts/dependencies_check b/scripts/dependencies_check index 375512b..25490cd 100644 --- a/scripts/dependencies_check +++ b/scripts/dependencies_check @@ -1,3 +1,5 @@ +#!/bin/bash + # dependencies_check # $@ Dependency files to check # diff --git a/stage2/EXPORT_IMAGE b/stage2/EXPORT_IMAGE index aa8f936..8b1a5ad 100644 --- a/stage2/EXPORT_IMAGE +++ b/stage2/EXPORT_IMAGE @@ -1,3 +1,5 @@ +#!/bin/bash + IMG_SUFFIX="-lite" if [ "${USE_QEMU}" = "1" ]; then export IMG_SUFFIX="${IMG_SUFFIX}-qemu" diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS index 136cc77..ba185ac 100644 --- a/stage2/EXPORT_NOOBS +++ b/stage2/EXPORT_NOOBS @@ -1,2 +1,5 @@ +#!/bin/bash + +# shellcheck disable=SC2034 NOOBS_NAME="Raspbian Lite" NOOBS_DESCRIPTION="A port of Debian with no desktop environment" diff --git a/stage4/EXPORT_IMAGE b/stage4/EXPORT_IMAGE index 79ec11a..fd5c802 100644 --- a/stage4/EXPORT_IMAGE +++ b/stage4/EXPORT_IMAGE @@ -1,3 +1,5 @@ +#!/bin/bash + IMG_SUFFIX="" if [ "${USE_QEMU}" = "1" ]; then export IMG_SUFFIX="${IMG_SUFFIX}-qemu" diff --git a/stage4/EXPORT_NOOBS b/stage4/EXPORT_NOOBS index 2ef6d7b..cf580a6 100644 --- a/stage4/EXPORT_NOOBS +++ b/stage4/EXPORT_NOOBS @@ -1,2 +1,5 @@ +#!/bin/bash + +# shellcheck disable=SC2034 NOOBS_NAME="Raspbian" NOOBS_DESCRIPTION="A port of Debian with the Raspberry Pi Desktop" diff --git a/stage5/EXPORT_IMAGE b/stage5/EXPORT_IMAGE index a81a844..9c207a5 100644 --- a/stage5/EXPORT_IMAGE +++ b/stage5/EXPORT_IMAGE @@ -1,3 +1,5 @@ +#!/bin/bash + IMG_SUFFIX="-full" if [ "${USE_QEMU}" = "1" ]; then export IMG_SUFFIX="${IMG_SUFFIX}-qemu" diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS index cb10203..ab44793 100644 --- a/stage5/EXPORT_NOOBS +++ b/stage5/EXPORT_NOOBS @@ -1,2 +1,5 @@ +#!/bin/bash + +# shellcheck disable=SC2034 NOOBS_NAME="Raspbian Full" NOOBS_DESCRIPTION="A port of Debian with desktop and recommended applications" From 9c205b4fc8060951bebeb934c3325f1afb220297 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Thu, 16 Jan 2020 10:46:52 -0500 Subject: [PATCH 3/3] Fix yamllint complaints for docker-compose.yml While it work it was not technically valid YAML. Make the YAML valid. Signed-off-by: Daniel F. Dickinson --- docker-compose.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f733860..071a785 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,4 @@ +--- version: '2' services: @@ -5,6 +6,6 @@ services: restart: unless-stopped image: sameersbn/apt-cacher-ng:latest ports: - - "3142:3142" + - "3142:3142" volumes: - - ./apt-cacher-ng:/var/cache/apt-cacher-ng + - ./apt-cacher-ng:/var/cache/apt-cacher-ng