Skip to contentSkip to conversation

alsa-info.sh: Use pgrep -f to match against command line; fix misspellings

PATCH In review [email protected] 2 participants 2 messages Feb 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-info.sh: Use pgrep -f to match against command line; fix misspellings

Hi,

The current alsa-info.sh script fails to report running pulseaudio/esd/artsd instances due to missing -f passed to pgrep. The attached patch resolves said issue and corrects trivial misspellings.

Thanks,
Dan

From ca6a34e23fde331631ca38b4410e5d70267ba4d1 Mon Sep 17 00:00:00 2001
From: Daniel T Chen <[email protected]>
Date: Thu, 19 Feb 2009 02:16:32 -0500
Subject: [PATCH] Use pgrep -f to match against command line; fix misspellings

---
 utils/alsa-info.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
utils/alsa-info.sh +6 -6
index dc8bacc..64845ff 100755
@@ -387,21 +387,21 @@ echo "!!Sound Servers on this system" >> $FILE
 echo "!!----------------------------" >> $FILE
 echo "" >> $FILE
 if [[ -n $PAINST ]];then
-[[ `pgrep $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
+[[ `pgrep -f $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
 echo "Pulseaudio:" >> $FILE
 echo "      Installed - Yes ($PAINST)" >> $FILE
 echo "      Running - $PARUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ESDINST ]];then
-[[ `pgrep $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
+[[ `pgrep -f $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
 echo "ESound Daemon:" >> $FILE
 echo "      Installed - Yes ($ESDINST)" >> $FILE
 echo "      Running - $ESDRUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ARTSINST ]];then
-[[ `pgrep $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
+[[ `pgrep -f $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
 echo "aRts:" >> $FILE
 echo "      Installed - Yes ($ARTSINST)" >> $FILE
 echo "      Running - $ARTSRUNNING" >> $FILE
@@ -424,7 +424,7 @@ echo "" >> $FILE
 cat $TEMPDIR/lspci.tmp >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
-echo "!!Advanced information - PCI Vendor/Device/Susbsystem ID's" >> $FILE
+echo "!!Advanced information - PCI Vendor/Device/Subsystem ID's" >> $FILE
 echo "!!--------------------------------------------------------" >> $FILE
 echo "" >> $FILE
 lspci -vvn |grep -A1 040[1-3] >> $FILE
@@ -704,7 +704,7 @@ then
 	if [[ -n $NOUPLOAD ]]; then
 		mv $FILE $NFILE || exit 1
 		if [[ -n $PBERROR ]]; then
-			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
+			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
 		else
 			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
 		fi
@@ -721,7 +721,7 @@ clear
 if [[ -n $NOUPLOAD ]]; then
 	mv $FILE $NFILE || exit 1
 	if [[ -n $PBERROR ]]; then
-		echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
+		echo "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
 		echo ""
 		echo "Your ALSA information can be seen by looking in $NFILE"
 		echo ""
Signature · 1 line
1.6.0.4

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

At Wed, 18 Feb 2009 23:42:24 -0800 (PST),

Quoted 7 lines · [email protected] wrote:

Hi,

The current alsa-info.sh script fails to report running pulseaudio/esd/artsd instances due to missing -f passed to pgrep. The attached patch resolves said issue and corrects trivial misspellings.

Thanks for the patch.

This problem was checked and discussed already together with some other guys, and found out even -f doesn't work for some procps versions. So, it can't be applied as is.

Now I applied the (long pending) patch from David Henningsson to fix the pgrep issue, and fixed typos you pointed out manually, then did lots of clean-up works. Please check it out.

Takashi

Quoted 81 lines

Thanks,
Dan

[2 0001-Use-pgrep-f-to-match-against-command-line-fix-miss.patch <text/x-diff (base64)>] From ca6a34e23fde331631ca38b4410e5d70267ba4d1 Mon Sep 17 00:00:00 2001
From: Daniel T Chen <[email protected]>
Date: Thu, 19 Feb 2009 02:16:32 -0500
Subject: [PATCH] Use pgrep -f to match against command line; fix misspellings

---
 utils/alsa-info.sh |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
utils/alsa-info.sh +6 -6
index dc8bacc..64845ff 100755
@@ -387,21 +387,21 @@ echo "!!Sound Servers on this system" >> $FILE
 echo "!!----------------------------" >> $FILE
 echo "" >> $FILE
 if [[ -n $PAINST ]];then
-[[ `pgrep $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
+[[ `pgrep -f $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
 echo "Pulseaudio:" >> $FILE
 echo "      Installed - Yes ($PAINST)" >> $FILE
 echo "      Running - $PARUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ESDINST ]];then
-[[ `pgrep $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
+[[ `pgrep -f $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
 echo "ESound Daemon:" >> $FILE
 echo "      Installed - Yes ($ESDINST)" >> $FILE
 echo "      Running - $ESDRUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ARTSINST ]];then
-[[ `pgrep $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
+[[ `pgrep -f $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
 echo "aRts:" >> $FILE
 echo "      Installed - Yes ($ARTSINST)" >> $FILE
 echo "      Running - $ARTSRUNNING" >> $FILE
@@ -424,7 +424,7 @@ echo "" >> $FILE
 cat $TEMPDIR/lspci.tmp >> $FILE
 echo "" >> $FILE
 echo "" >> $FILE
-echo "!!Advanced information - PCI Vendor/Device/Susbsystem ID's" >> $FILE
+echo "!!Advanced information - PCI Vendor/Device/Subsystem ID's" >> $FILE
 echo "!!--------------------------------------------------------" >> $FILE
 echo "" >> $FILE
 lspci -vvn |grep -A1 040[1-3] >> $FILE
@@ -704,7 +704,7 @@ then
 	if [[ -n $NOUPLOAD ]]; then
 		mv $FILE $NFILE || exit 1
 		if [[ -n $PBERROR ]]; then
-			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
+			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
 		else
 			dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $NFILE" 10 100
 		fi
@@ -721,7 +721,7 @@ clear
 if [[ -n $NOUPLOAD ]]; then
 	mv $FILE $NFILE || exit 1
 	if [[ -n $PBERROR ]]; then
-		echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
+		echo "An error occurred while contacting the $WWWSERVICE. Your information was NOT automatically uploaded."
 		echo ""
 		echo "Your ALSA information can be seen by looking in $NFILE"
 		echo ""
Signature · 7 lines
1.6.0.4

[3  <text/plain; us-ascii (7bit)>]
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel