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
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Thu, 14 Feb 2019 00:04:13 +0300
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
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
......@@ -29,7 +29,7 @@ index d096745..9e1b910 100644
+INITRD_OPTIONS_START="4"
-if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
+if ! [ -n $KERNEL_INSTALL_MACHINE_ID ]; then
+if [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then
exit 0
fi
......@@ -55,7 +55,7 @@ index d096745..9e1b910 100644
fi
-if ! [[ $KERNEL_IMAGE ]]; then
+if ! [ -z "$KERNEL_IMAGE" ]; then
+if [ -z "$KERNEL_IMAGE" ]; then
exit 1
fi
......@@ -68,7 +68,7 @@ index d096745..9e1b910 100644
fi
-if ! [[ $PRETTY_NAME ]]; then
+if ! [ -z "$PRETTY_NAME" ]; then
+if [ -z "$PRETTY_NAME" ]; then
PRETTY_NAME="Linux $KERNEL_VERSION"
fi
......
......@@ -18,7 +18,7 @@ index 3850eac..2b026da 100644
+++ b/src/kernel-install/50-depmod.install
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!//bin/sh
+#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
......
......@@ -3,7 +3,7 @@ From: Denis Pynkin <denis.pynkin@collabora.com>
Date: Mon, 26 Apr 2021 23:00:48 +0300
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>
---
......@@ -25,7 +25,7 @@ index 21c09fa..e2fc396 100644
INITRD_OPTIONS_START="5"
-if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
+if ! [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then
+if [ -z "$KERNEL_INSTALL_MACHINE_ID" ]; then
exit 0
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