minor fixes for setup-pulseaudio script

OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=54
This commit is contained in:
Takashi Iwai 2010-08-12 09:58:14 +00:00 committed by Git OBS Bridge
parent 99f1b46071
commit aada13f0fe
3 changed files with 15 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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"