x11-apps/xinit: Don't use deprecated /etc/init.d/functions.sh
authorMatt Turner <mattst88@gentoo.org>
Wed, 15 May 2019 18:39:18 +0000 (11:39 -0700)
committerMatt Turner <mattst88@gentoo.org>
Wed, 15 May 2019 18:51:15 +0000 (11:51 -0700)
Closes: https://bugs.gentoo.org/504140
Signed-off-by: Matt Turner <mattst88@gentoo.org>
x11-apps/xinit/files/startDM.sh
x11-apps/xinit/files/startDM.sh.1 [new file with mode: 0644]
x11-apps/xinit/xinit-1.4.0-r1.ebuild

index e2da6098d6a0ce9431ba99d97792b8b29f53f540..a4bf30e31ba74238e5fb82da5279ef11dc76da0c 100644 (file)
@@ -1,12 +1,17 @@
 #!/bin/sh
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License, v2
 
 # We need to source /etc/profile for stuff like $LANG to work
 # bug #10190.
 . /etc/profile
 
-. /etc/init.d/functions.sh
+. /lib/rc/sh/functions.sh
+
+# Bail out early if on a non-OpenRC system:
+if [ ! -d /run/openrc ]; then
+       eerror "$0 should only be used on OpenRC systems"
+fi
 
 # baselayout-1 compat
 if ! type get_options >/dev/null 2>/dev/null ; then
diff --git a/x11-apps/xinit/files/startDM.sh.1 b/x11-apps/xinit/files/startDM.sh.1
new file mode 100644 (file)
index 0000000..e2da609
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+# We need to source /etc/profile for stuff like $LANG to work
+# bug #10190.
+. /etc/profile
+
+. /etc/init.d/functions.sh
+
+# baselayout-1 compat
+if ! type get_options >/dev/null 2>/dev/null ; then
+       [ -r "${svclib}"/sh/rc-services.sh ] && . "${svclib}"/sh/rc-services.sh
+fi
+
+# Great new Gnome2 feature, AA
+# We enable this by default
+export GDK_USE_XFT=1
+
+export RC_SVCNAME=xdm
+EXEC="$(get_options service)"
+NAME="$(get_options name)"
+PIDFILE="$(get_options pidfile)"
+START_STOP_ARGS="$(get_options start_stop_args)"
+
+start-stop-daemon --start --exec ${EXEC} \
+${NAME:+--name} ${NAME} ${PIDFILE:+--pidfile} ${PIDFILE} ${START_STOP_ARGS} || \
+eerror "ERROR: could not start the Display Manager"
+
+# vim:ts=4
index f8dedbb1ce77f5ba39062e396c8d6f26757f7a44..be9e7a84a648bccedfeec3b2130ba82cbff5d002 100644 (file)
@@ -42,7 +42,7 @@ src_install() {
        xorg-2_src_install
 
        exeinto /etc/X11
-       doexe "${FILESDIR}"/chooser.sh "${FILESDIR}"/startDM.sh
+       doexe "${FILESDIR}"/chooser.sh "${FILESDIR}"/startDM.sh.1
        exeinto /etc/X11/Sessions
        doexe "${FILESDIR}"/Xsession
        exeinto /etc/X11/xinit