Skip to content
Snippets Groups Projects
Commit 3740a22f authored by Denis Pynkin's avatar Denis Pynkin
Browse files

Fix bashisms in kernel-install scripts


Remove negotiation from `-z` to test for non-emptiness instead of
previously added version reversing those tests logic.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent bf489fe1
Branches apertis/v2023dev3 apertis/v2023pre apertis/v2024dev0
Tags apertis/247.3-7+apertis1
No related merge requests found
...@@ -2,7 +2,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com> ...@@ -2,7 +2,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Thu, 14 Feb 2019 00:04:13 +0300 Date: Thu, 14 Feb 2019 00:04:13 +0300
Subject: Remove bashisms from the UEFI entries generator Subject: Remove bashisms from the UEFI entries generator
- Use [ not [[ and -n to test for non-emptiness - Use [ not [[ and -z to test for non-emptiness
- Use shell lists instead of arrays - Use shell lists instead of arrays
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
...@@ -29,7 +29,7 @@ index d096745..9e1b910 100644 ...@@ -29,7 +29,7 @@ index d096745..9e1b910 100644
+INITRD_OPTIONS_START="4" +INITRD_OPTIONS_START="4"
-if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then -if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
+if ! [ -n $KERNEL_INSTALL_MACHINE_ID ]; then +if [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then
exit 0 exit 0
fi fi
...@@ -55,7 +55,7 @@ index d096745..9e1b910 100644 ...@@ -55,7 +55,7 @@ index d096745..9e1b910 100644
fi fi
-if ! [[ $KERNEL_IMAGE ]]; then -if ! [[ $KERNEL_IMAGE ]]; then
+if ! [ -z "$KERNEL_IMAGE" ]; then +if [ -z "$KERNEL_IMAGE" ]; then
exit 1 exit 1
fi fi
...@@ -68,7 +68,7 @@ index d096745..9e1b910 100644 ...@@ -68,7 +68,7 @@ index d096745..9e1b910 100644
fi fi
-if ! [[ $PRETTY_NAME ]]; then -if ! [[ $PRETTY_NAME ]]; then
+if ! [ -z "$PRETTY_NAME" ]; then +if [ -z "$PRETTY_NAME" ]; then
PRETTY_NAME="Linux $KERNEL_VERSION" PRETTY_NAME="Linux $KERNEL_VERSION"
fi fi
......
...@@ -18,7 +18,7 @@ index 3850eac..2b026da 100644 ...@@ -18,7 +18,7 @@ index 3850eac..2b026da 100644
+++ b/src/kernel-install/50-depmod.install +++ b/src/kernel-install/50-depmod.install
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-#!/usr/bin/env bash -#!/usr/bin/env bash
+#!//bin/sh +#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
......
...@@ -3,7 +3,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com> ...@@ -3,7 +3,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Mon, 26 Apr 2021 23:00:48 +0300 Date: Mon, 26 Apr 2021 23:00:48 +0300
Subject: Remove bashisms from the entry directory plugin Subject: Remove bashisms from the entry directory plugin
- Use [ not [[ and -n to test for non-emptiness - Use [ not [[ and -z to test for non-emptiness
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
--- ---
...@@ -25,7 +25,7 @@ index 21c09fa..e2fc396 100644 ...@@ -25,7 +25,7 @@ index 21c09fa..e2fc396 100644
INITRD_OPTIONS_START="5" INITRD_OPTIONS_START="5"
-if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then -if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
+if ! [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then +if [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then
exit 0 exit 0
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment