bin: Add POSIX shell linter and ensure scripts are compliant

This commit is contained in:
Devin Lin 2024-02-05 17:47:31 +00:00
parent fffcd04aeb
commit 7b310c8076
3 changed files with 17 additions and 5 deletions

View file

@ -6,3 +6,15 @@ include:
file: file:
- /gitlab-templates/reuse-lint.yml - /gitlab-templates/reuse-lint.yml
- /gitlab-templates/linux-qt6.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)

View file

@ -3,17 +3,17 @@
# #
# SPDX-License-Identifier: GPL-2.0-or-later # 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 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 # 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" 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 systemctl --user daemon-reload
fi fi
startplasmamobile$@ startplasmamobile "$@"

View file

@ -18,7 +18,7 @@ export PLASMA_INTEGRATION_USE_PORTAL=1
export PLASMA_PLATFORM=phone:handset export PLASMA_PLATFORM=phone:handset
# if coredumpd knows about the dumps, make sure drkonqi catches them # 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 then
export KDE_COREDUMP_NOTIFY=1 export KDE_COREDUMP_NOTIFY=1
fi fi