[Debian-on-mobile-maintainers] Bug#1035655: /usr/bin/startplasmamobile: 22: [[: not found
Petter Reinholdtsen
pere at hungry.com
Mon Sep 2 09:00:54 BST 2024
Control: tags -1 + patch
And for the record, here is the commited fix:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 735ffe135bff8aeee656767a367301e9d2dc1783..9325d627f9837e5f9d1ba1499b8503a83fc6dcf2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,3 +6,15 @@ include:
file:
- /gitlab-templates/reuse-lint.yml
- /gitlab-templates/linux-qt6.yml
+
+posix-script-compliance:
+ image:
+ name: debian:latest
+ entrypoint: [""]
+ stage: build
+ script:
+ - apt-get update
+ - apt-get -y install shellcheck
+ - shellcheck -x -s sh bin/startplasmamobile.in
+ - shellcheck -x -s sh bin/startplasmamobile.in
+ - shellcheck -x --exclude=1091 -s sh bin/startplasmamobile-dev.sh.cmake # ignore error from file not existing (given by cmake)
diff --git a/bin/startplasmamobile-dev.sh.cmake b/bin/startplasmamobile-dev.sh.cmake
index 5011ed10bb26ca65b9895435b27ab2b00e883966..ee1c25f87d942b99feb020f9e17a6e674dd0e116 100755
--- a/bin/startplasmamobile-dev.sh.cmake
+++ b/bin/startplasmamobile-dev.sh.cmake
@@ -3,17 +3,17 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
-source @CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dev-prefix.sh
+. "@CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dev-prefix.sh"
# This is a bit of a hack done because systemd starts in pam, and we only set our dev paths after all that is complete
# This copies everything into a transient runtime directory that systemd reads and reloads the units
-if [ ! -z "$XDG_RUNTIME_DIR" ]; then
+if [ -n "$XDG_RUNTIME_DIR" ]; then
mkdir -p "$XDG_RUNTIME_DIR/systemd/user.control"
- command cp -r @KDE_INSTALL_FULL_SYSTEMDUSERUNITDIR@/* $XDG_RUNTIME_DIR/systemd/user.control
+ cp -r @KDE_INSTALL_FULL_SYSTEMDUSERUNITDIR@/* "$XDG_RUNTIME_DIR"/systemd/user.control
systemctl --user daemon-reload
fi
-startplasmamobile$@
+startplasmamobile "$@"
diff --git a/bin/startplasmamobile.in b/bin/startplasmamobile.in
index f2154683c1f2d3a21a88e18ade769a49247e172a..12af661af010f947a40604c5314dae3550049725 100755
--- a/bin/startplasmamobile.in
+++ b/bin/startplasmamobile.in
@@ -18,7 +18,7 @@ export PLASMA_INTEGRATION_USE_PORTAL=1
export PLASMA_PLATFORM=phone:handset
# if coredumpd knows about the dumps, make sure drkonqi catches them
-if [[ $(cat /proc/sys/kernel/core_pattern) =~ /systemd-coredump ]]
+if grep -q '/systemd-coredump' /proc/sys/kernel/core_pattern
then
export KDE_COREDUMP_NOTIFY=1
fi
--
Happy hacking
Petter Reinholdtsen
More information about the Debian-on-mobile-maintainers
mailing list