[RFC] Core Update 163: Abort update.sh in case an uninitialised variable is found

Message ID 9384fc32-2895-c585-ac06-d96ccc5668b7@ipfire.org
State Rejected
Headers show
Series [RFC] Core Update 163: Abort update.sh in case an uninitialised variable is found | expand

Commit Message

Peter Müller Dec. 3, 2021, 5:37 p.m. UTC
This should never happen anyways, but better be safe than sorry.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/rootfiles/core/163/update.sh | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Tremer Dec. 4, 2021, 12:46 p.m. UTC | #1
Why?

> On 3 Dec 2021, at 17:37, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> This should never happen anyways, but better be safe than sorry.
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/rootfiles/core/163/update.sh | 3 +++
> 1 file changed, 3 insertions(+)
> 
> diff --git a/config/rootfiles/core/163/update.sh b/config/rootfiles/core/163/update.sh
> index e51dbf0b3..c1f23f25e 100644
> --- a/config/rootfiles/core/163/update.sh
> +++ b/config/rootfiles/core/163/update.sh
> @@ -24,6 +24,9 @@
> . /opt/pakfire/lib/functions.sh
> /usr/local/bin/backupctrl exclude >/dev/null 2>&1
> 
> +# Abort in case of uninitialised variables
> +set -u
> +
> core=163
> 
> exit_with_error() {
> -- 
> 2.26.2

Patch

diff --git a/config/rootfiles/core/163/update.sh b/config/rootfiles/core/163/update.sh
index e51dbf0b3..c1f23f25e 100644
--- a/config/rootfiles/core/163/update.sh
+++ b/config/rootfiles/core/163/update.sh
@@ -24,6 +24,9 @@ 
 . /opt/pakfire/lib/functions.sh
 /usr/local/bin/backupctrl exclude >/dev/null 2>&1
 
+# Abort in case of uninitialised variables
+set -u
+
 core=163
 
 exit_with_error() {