OBS User autobuild 2009-11-02 15:09:36 +00:00 committed by Git OBS Bridge
parent 1f50d2c672
commit 5f9567af59
2 changed files with 20 additions and 39 deletions

View File

@ -1,9 +1,3 @@
-------------------------------------------------------------------
Thu Oct 29 09:33:55 UTC 2009 - lnussel@suse.de
- clean up and fix setup-pulseaudio to not corrupt /etc/environment
(bnc#547384)
-------------------------------------------------------------------
Tue Oct 6 19:10:19 UTC 2009 - sreeves@novell.com

View File

@ -5,13 +5,12 @@ LIST_OF_OSS_APPS="aumix sox"
show_help() {
echo "setup-pulseaudio [ --enable | --disable | --status ]"
echo ""
echo "Modifies configuration files of some applications for PulseAudio"
echo "Sets up PulseAudio configuration for all sound-based applications"
echo " --enable Enables PulseAudio"
echo " --disable Disables PulseAudio"
echo " --status Shows activation state (disabled or enabled) for PulseAudio"
echo ""
echo "You need to be root for this command to succeed"
echo "You may need to re-login for changes to take effect"
exit
}
@ -49,28 +48,27 @@ enable_libao() {
enable_mplayer() {
echo "Enabling PulseAudio for mplayer..."
# Maybe it would be better to just add a alias mplayer=mplayer -ao pulse to /etc/environment?
if test -f /etc/mplayer/mplayer.conf; then
if grep -q '^ao=' /etc/mplayer/mplayer.conf; then
perl -pi -e "s|^ao=.*|ao=pulse|g;" /etc/pulse/client.conf
if grep "ao=pulse" /etc/mplayer/mplayer.conf; then
echo "Default driver is pulse already in /etc/mplayer/mplayer.conf"
else
echo ""
fi
else
echo "ao=pulse" >> /etc/mplayer/mplayer.conf
fi
fi
# FIXME: mplayerplug-in uses $HOME/.mplayer/mplayerplug-in.conf
}
enable_openal() {
# nothing to do here. openal-soft is patched to prefer pulse but
# it won't autostart the daemon.
return 0
echo "Enabling PulseAudio for openal..."
# FIXME: openal uses ~/.openalrc
echo ""
}
enable_oss() {
# this is broken. /etc/environment must only contain environment
# variables. It's not a shell script
return 0
echo "Enabling PulseAudio for OSS..."
for app in $LIST_OF_OSS_APPS; do
if grep "alias $app=padsp $app" /etc/environment; then
@ -92,10 +90,6 @@ enable_sdl() {
}
enable_timidity() {
# this is broken. /etc/environment must only contain environment
# variables. It's not a shell script
return 0
echo "Enabling PulseAudio for Timidity..."
# Use esound output for timidity
if grep "alias timidity=timidity -Oe" /etc/environment; then
@ -106,9 +100,9 @@ enable_timidity() {
}
enable_xine() {
#echo "Enabling PulseAudio for Xine..."
echo "Enabling PulseAudio for Xine..."
# FIXME: xine uses $HOME/.xine/config
return 0
echo ""
}
enable_autospawn() {
@ -126,30 +120,27 @@ disable_alsa() {
}
disable_libao() {
if test -f /etc/libao.conf; then
echo "Disabling PulseAudio for libao..."
if test -f /etc/libao.conf; then
perl -pi -e "s|default_driver=pulse||g;" /etc/libao.conf
fi
}
disable_mplayer() {
if test -f /etc/mplayer/mplayer.conf; then
echo "Disabling PulseAudio for mplayer..."
if test -f /etc/mplayer/mplayer.conf; then
perl -pi -e "s|ao=pulse||g;" /etc/mplayer/mplayer.conf
fi
}
disable_openal() {
# nothing to do here. openal-soft is patched to prefer pulse but
# it won't autostart the daemon.
return 0
echo "Disabling PulseAudio for openal..."
# FIXME: openal uses ~/.openalrc
echo ""
}
disable_oss() {
# this is broken. /etc/environment must only contain environment
# variables. It's not a shell script
return 0
echo "Disabling PulseAudio for OSS..."
for app in $LIST_OF_OSS_APPS; do
perl -pi -e "s|alias $app=padsp $app||g;" /etc/environment
done
@ -163,18 +154,14 @@ disable_sdl() {
}
disable_timidity() {
# this is broken. /etc/environment must only contain environment
# variables. It's not a shell script
return 0
echo "Disabling PulseAudio for Timidity..."
perl -pi -e "s|alias timidity=timidity -Oe||g;" /etc/environment
}
disable_xine() {
#echo "Disabling PulseAudio for Xine..."
echo "Disabling PulseAudio for Xine..."
# FIXME: xine uses $HOME/.xine/config
return 0
echo ""
}
disable_autospawn() {