]> git.proxmox.com Git - systemd.git/commitdiff
Fix bashism in kernel-install
authorMichael Biebl <biebl@debian.org>
Thu, 9 Jun 2022 19:31:53 +0000 (21:31 +0200)
committerMichael Biebl <biebl@debian.org>
Thu, 9 Jun 2022 19:31:53 +0000 (21:31 +0200)
debian/patches/series
debian/patches/shellcheck-clean-kernel-install-again.patch [new file with mode: 0644]

index 80f5d0d0372028950f7cf4a44c986572faa0a3e9..01e6c32e01c3ed89af3ce774f3a50605d2d52827 100644 (file)
@@ -2,6 +2,7 @@ Do-not-require-a-valid-version-when-parsing-sd-boot-loade.patch
 sha256-fix-compilation-on-efi-ia32.patch
 Move-homectl-and-userdbctl-to-bindir.patch
 meson-install-libsystemd-shared-into-rootpkglibdir.patch
+shellcheck-clean-kernel-install-again.patch
 debian/Use-Debian-specific-config-files.patch
 debian/Bring-tmpfiles.d-tmp.conf-in-line-with-Debian-defaul.patch
 debian/Make-run-lock-tmpfs-an-API-fs.patch
diff --git a/debian/patches/shellcheck-clean-kernel-install-again.patch b/debian/patches/shellcheck-clean-kernel-install-again.patch
new file mode 100644 (file)
index 0000000..c37266d
--- /dev/null
@@ -0,0 +1,46 @@
+From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
+Date: Sun, 22 May 2022 22:09:23 +0200
+Subject: shellcheck-clean kernel-install again
+
+(cherry picked from commit 35339eb88c72f30204589101765a0bca5424e253)
+---
+ src/kernel-install/kernel-install.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in
+index a41a56a..3da233e 100755
+--- a/src/kernel-install/kernel-install.in
++++ b/src/kernel-install/kernel-install.in
+@@ -115,6 +115,7 @@ fi
+ if [ -n "$install_conf" ]; then
+     [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Reading $install_conf…"
++    # shellcheck source=/dev/null
+     . "$install_conf"
+     # FIXME: This may override configuration in environment variables, e.g. $BOOT_ROOT.
+ fi
+@@ -133,6 +134,7 @@ fi
+ # generated one. If the user configured an explicit machine ID to use in
+ # /etc/machine-info to use for our purpose, we'll use that instead (for
+ # compatibility).
++# shellcheck source=/dev/null
+ if [ -z "$MACHINE_ID" ] && [ -r /etc/machine-info ] && . /etc/machine-info && MACHINE_ID="$KERNEL_INSTALL_MACHINE_ID"; then
+     [ -n "$MACHINE_ID" ] && [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
+         echo "machine-id $MACHINE_ID acquired from /etc/machine-info"
+@@ -160,6 +162,7 @@ if [ -z "$ENTRY_TOKEN" ]; then
+     # the IMAGE_ID= and ID= fields from /etc/os-release and finally the fixed
+     # string "Default"
+     ENTRY_TOKEN_SEARCH="$MACHINE_ID"
++    # shellcheck source=/dev/null
+     [ -r /etc/os-release ] && . /etc/os-release
+     [ -n "$IMAGE_ID" ] && ENTRY_TOKEN_SEARCH="$ENTRY_TOKEN_SEARCH $IMAGE_ID"
+     [ -n "$ID" ] && ENTRY_TOKEN_SEARCH="$ENTRY_TOKEN_SEARCH $ID"
+@@ -294,7 +297,7 @@ PLUGINS="$(
+ IFS="
+ "
+-[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo -e "Plugin files:\n$PLUGINS"
++[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && printf '%s\n' "Plugin files:" "$PLUGINS"
+ case "$COMMAND" in
+     add)