Gentoo Archives: gentoo-commits

From: "Patrick McLean (chutzpah)" <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-sound/pulseaudio/files: pulseaudio.init.d-4
Date: Sun, 03 Aug 2008 18:03:49
Message-Id: E1KPhvn-0004Rk-4d@stork.gentoo.org
1 chutzpah 08/08/03 18:03:47
2
3 Added: pulseaudio.init.d-4
4 Log:
5 Make sure that the ebuild creates system.pa, modify the init script to use system.pa rather than default.pa and add a "needs" on consolekit if module-console-kit is requested in system.pa (bug #233789).
6 (Portage version: 2.2_rc6/cvs/Linux 2.6.26-gentoo x86_64)
7
8 Revision Changes Path
9 1.1 media-sound/pulseaudio/files/pulseaudio.init.d-4
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/pulseaudio/files/pulseaudio.init.d-4?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-sound/pulseaudio/files/pulseaudio.init.d-4?rev=1.1&content-type=text/plain
13
14 Index: pulseaudio.init.d-4
15 ===================================================================
16 #!/sbin/runscript
17 # Copyright 1999-2004 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/media-sound/pulseaudio/files/pulseaudio.init.d-4,v 1.1 2008/08/03 18:03:46 chutzpah Exp $
20
21 depend() {
22 need localmount
23 use net
24
25 local script="/etc/pulse/system.pa"
26
27 for opt in ${PA_OPTS}; do
28 case "$opt" in
29 --file=*) script="${opt#*=}" ;;
30 -F*) script="${opt#-F}" ;;
31 esac
32 done
33
34 config "$script"
35
36 local needs="$(get_options need)"
37 if [ -n "${needs}" ]; then
38 need ${needs}
39 return
40 fi
41
42 if egrep -q '^[[:space:]]*load-module[[:space:]]+module-console-kit' "$script"; then
43 needs="${needs} consolekit"
44 fi
45
46 #ifdef HAL
47 if egrep -q '^[[:space:]]*load-module[[:space:]]+module-hal-detect' "$script"; then
48 needs="${needs} hald"
49 fi
50 #endif
51
52 #ifdef AVAHI
53 if egrep -q '[[:space:]]*load-module[[:space:]]+module-zeroconf-publish' "$script"; then
54 needs="${needs} avahi-daemon"
55 fi
56 #endif
57
58 #ifdef BLUETOOTH
59 if egrep -q '[[:space:]]*load-module[[:space:]]+module-bt-proximity' "$script"; then
60 needs="${needs} bluetooth"
61 fi
62 #endif
63
64 #ifdef ALSA
65 if egrep -q '[[:space:]]*load-module[[:space:]]+module-alsa-(sink|source)' "$script" ||
66 egrep -q '[[:space:]]*load-module[[:space:]]+module-(hal-)?detect' "$script" ||
67 egrep -q '[[:space:]]*add-autoload-source[[:space:]]+(input|output)[[:space:]]+module-alsa-(sink|source)' "$script"; then
68 needs="${needs} alsasound"
69 fi
70 #endif
71
72 need "${needs}"
73 save_options need "${needs}"
74 }
75
76 start() {
77 ebegin "Starting pulseaudio"
78 PA_ALL_OPTS="${PA_OPTS} --fail=1 --daemonize=1 --system"
79 start-stop-daemon --start --exec /usr/bin/pulseaudio -- ${PA_ALL_OPTS}
80 eend $?
81 }
82
83 stop() {
84 ebegin "Stopping pulseaudio"
85 start-stop-daemon --stop --quiet --exec /usr/bin/pulseaudio --pidfile /var/run/pulse/pid
86 eend $?
87 }