summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2019-05-15 11:39:18 -0700
committerMatt Turner <mattst88@gentoo.org>2019-05-15 11:51:15 -0700
commit244cc8e97a0e43856f503046359b8bd8372dc34b (patch)
tree465323d0db1e127875ef2b65eea225fc6e98467c /x11-apps/xinit
parentx11-apps/xinit: Rename USE=minimal -> USE=twm (diff)
downloadgentoo-244cc8e97a0e43856f503046359b8bd8372dc34b.tar.gz
gentoo-244cc8e97a0e43856f503046359b8bd8372dc34b.tar.bz2
gentoo-244cc8e97a0e43856f503046359b8bd8372dc34b.zip
x11-apps/xinit: Don't use deprecated /etc/init.d/functions.sh
Closes: https://bugs.gentoo.org/504140 Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'x11-apps/xinit')
-rw-r--r--x11-apps/xinit/files/startDM.sh9
-rw-r--r--x11-apps/xinit/files/startDM.sh.130
-rw-r--r--x11-apps/xinit/xinit-1.4.0-r1.ebuild2
3 files changed, 38 insertions, 3 deletions
diff --git a/x11-apps/xinit/files/startDM.sh b/x11-apps/xinit/files/startDM.sh
index e2da6098d6a0..a4bf30e31ba7 100644
--- a/x11-apps/xinit/files/startDM.sh
+++ b/x11-apps/xinit/files/startDM.sh
@@ -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
index 000000000000..e2da6098d6a0
--- /dev/null
+++ b/x11-apps/xinit/files/startDM.sh.1
@@ -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
diff --git a/x11-apps/xinit/xinit-1.4.0-r1.ebuild b/x11-apps/xinit/xinit-1.4.0-r1.ebuild
index f8dedbb1ce77..be9e7a84a648 100644
--- a/x11-apps/xinit/xinit-1.4.0-r1.ebuild
+++ b/x11-apps/xinit/xinit-1.4.0-r1.ebuild
@@ -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