From aada13f0fe1f676c274d2bf84d711205eda2e9f1ad2c34f5c224172263939c0b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 12 Aug 2010 09:58:14 +0000 Subject: [PATCH] minor fixes for setup-pulseaudio script OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=54 --- pulseaudio.changes | 3 ++- pulseaudio.spec | 7 +++++-- setup-pulseaudio | 14 ++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pulseaudio.changes b/pulseaudio.changes index 8170b28..eabfc1e 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Thu Aug 12 09:55:04 CEST 2010 - tiwai@suse.de -- add /etc/profile.d/pulseaudio.* to file list as ghost +- minor fixes for setup-pulseaudio (bnc#623837) + also added /etc/profile.d/pulseaudio.* to file list as ghost ------------------------------------------------------------------- Tue Jul 20 18:41:58 CEST 2010 - tiwai@suse.de diff --git a/pulseaudio.spec b/pulseaudio.spec index a641f5b..3da4261 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -394,6 +394,9 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/*.a %find_lang %{name} install %SOURCE2 $RPM_BUILD_ROOT%{_bindir} chmod 755 $RPM_BUILD_ROOT%{_bindir}/setup-pulseaudio +mkdir -p $RPM_BUILD_ROOT/etc/profile.d +touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.sh +touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.csh mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/gdm/.pulse cp $RPM_SOURCE_DIR/default.pa-for-gdm $RPM_BUILD_ROOT%{_localstatedir}/lib/gdm/.pulse/default.pa ln -s esdcompat $RPM_BUILD_ROOT%{_bindir}/esd @@ -434,8 +437,8 @@ groupadd -r pulse-access &>/dev/null || : %{_bindir}/pulseaudio %{_bindir}/setup-pulseaudio # created by setup-pulseaudio script -%ghost %attr(644,root,root) /etc/profile.d/pulseaudio.sh -%ghost %attr(644,root,root) /etc/profile.d/pulseaudio.csh +%ghost /etc/profile.d/pulseaudio.sh +%ghost /etc/profile.d/pulseaudio.csh %dir %{_libdir}/pulse-%{drvver}/ %dir %{_libdir}/pulse-%{drvver}/modules/ %{_libdir}/libpulsecore-%{drvver}.so diff --git a/setup-pulseaudio b/setup-pulseaudio index ff5c908..04c7e0b 100644 --- a/setup-pulseaudio +++ b/setup-pulseaudio @@ -31,13 +31,13 @@ CPROFNAME=/etc/profile.d/pulseaudio.csh set_variable () { if test -f $PROFNAME && grep -q "export $1"= $PROFNAME; then - sed -ie "s|export $1=.*|export $1=$2|g" $PROFNAME + sed -i -e "s|export $1=.*|export $1=$2|g" $PROFNAME else echo "export $1=$2" >> $PROFNAME fi if test -f $CPROFNAME && grep -q "setenv $1 " $CPROFNAME; then - sed -ie "s|setenv $1 .*|setenv $1 $2|g" $CPROFNAME + sed -i -e "s|setenv $1 .*|setenv $1 $2|g" $CPROFNAME else echo "setenv $1 $2" >> $CPROFNAME fi @@ -46,11 +46,11 @@ set_variable () { delete_variable () { if test -f $PROFNAME && grep -q "export $1"= $PROFNAME; then - sed -ie "/export $1=.*/d" $PROFNAME + sed -i -e "/export $1=.*/d" $PROFNAME fi if test -f $CPROFNAME && grep -q "setenv $1 " $CPROFNAME; then - sed -ie "/setenv $1 .*/d" $CPROFNAME + sed -i -e "/setenv $1 .*/d" $CPROFNAME fi } @@ -251,8 +251,10 @@ case $1 in disable_speechd ;; --status) - STATUS=`grep PULSEAUDIO_ENABLE /etc/sysconfig/sound | cut -f2 -d= | cut -f2 -d\"` - if [ "x$STATUS" = "xyes" ]; then + if [ -f /etc/sysconfig/sound ]; then + . /etc/sysconfig/sound + fi + if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then echo "enabled" else echo "disabled"