From c984fcfc86547368107d6d3cd5caa3d40f221372 Mon Sep 17 00:00:00 2001 From: maxice8 <30738253+maxice8@users.noreply.github.com> Date: Fri, 22 Jun 2018 18:54:22 -0300 Subject: [PATCH] cdm: add POSIX SH compat patch (#246) --- srcpkgs/cdm/patches/fix-bashisms.patch | 18 ++++++++++++++++++ srcpkgs/cdm/template | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/cdm/patches/fix-bashisms.patch diff --git a/srcpkgs/cdm/patches/fix-bashisms.patch b/srcpkgs/cdm/patches/fix-bashisms.patch new file mode 100644 index 00000000000..a81f665c948 --- /dev/null +++ b/srcpkgs/cdm/patches/fix-bashisms.patch @@ -0,0 +1,18 @@ +Source: maxice8 +Upstream: to be upstreamed +Reason: fixes running it with POSIX shells + +--- src/profile.sh ++++ src/profile.sh +@@ -1,8 +1,8 @@ + # To avoid potential situation where cdm(1) crashes on every TTY, here we + # default to execute cdm(1) on tty1 only, and leave other TTYs untouched. +-if [[ "$(tty)" == '/dev/tty1' ]]; then +- [[ -n "$CDM_SPAWN" ]] && return ++if [ "$(tty)" = '/dev/tty1' ]; then ++ [ -n "$CDM_SPAWN" ] && return + # Avoid executing cdm(1) when X11 has already been started. +- [[ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ]] && exec cdm ++ [ -z "$DISPLAY$SSH_TTY$(pgrep xinit)" ] && exec cdm + fi + diff --git a/srcpkgs/cdm/template b/srcpkgs/cdm/template index 6caa024c47b..5d409f36376 100644 --- a/srcpkgs/cdm/template +++ b/srcpkgs/cdm/template @@ -1,7 +1,7 @@ # Template file for 'cdm' pkgname=cdm version=0.7 -revision=1 +revision=2 short_desc="Console Display Manager" maintainer="Andrea Brancaleoni " depends="dialog xinit kbd xdpyinfo"