From 3740a22f49be361458f5709281dbaa3d33e1701d Mon Sep 17 00:00:00 2001 From: Denis Pynkin <denis.pynkin@collabora.com> Date: Sun, 2 May 2021 22:04:04 +0300 Subject: [PATCH] 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: Denis Pynkin <denis.pynkin@collabora.com> --- .../Remove-bashisms-from-the-UEFI-entries-generator.patch | 8 ++++---- .../apertis/Remove-bashisms-from-the-depmod-wrapper.patch | 2 +- .../Remove-bashisms-from-the-entry-directory-plugin.patch | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/patches/apertis/Remove-bashisms-from-the-UEFI-entries-generator.patch b/debian/patches/apertis/Remove-bashisms-from-the-UEFI-entries-generator.patch index 22e76906..24aa50c4 100644 --- a/debian/patches/apertis/Remove-bashisms-from-the-UEFI-entries-generator.patch +++ b/debian/patches/apertis/Remove-bashisms-from-the-UEFI-entries-generator.patch @@ -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 diff --git a/debian/patches/apertis/Remove-bashisms-from-the-depmod-wrapper.patch b/debian/patches/apertis/Remove-bashisms-from-the-depmod-wrapper.patch index 7827e531..20b77a86 100644 --- a/debian/patches/apertis/Remove-bashisms-from-the-depmod-wrapper.patch +++ b/debian/patches/apertis/Remove-bashisms-from-the-depmod-wrapper.patch @@ -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 diff --git a/debian/patches/apertis/Remove-bashisms-from-the-entry-directory-plugin.patch b/debian/patches/apertis/Remove-bashisms-from-the-entry-directory-plugin.patch index 0f229ec6..00c46583 100644 --- a/debian/patches/apertis/Remove-bashisms-from-the-entry-directory-plugin.patch +++ b/debian/patches/apertis/Remove-bashisms-from-the-entry-directory-plugin.patch @@ -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 -- GitLab