All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] let alsaconf work on all distros
@ 2003-09-08 14:58 Thierry Vignaud
  2003-09-09 18:09 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Vignaud @ 2003-09-08 14:58 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

on mandrake, lspci is in /usr/bin, not /bin.

the following patch make alsaconf search for lspci location and
factorize binary location with lsmod btw:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: alsaconf.diff --]
[-- Type: text/x-patch, Size: 1615 bytes --]

--- ./alsaconf.tv	2003-09-08 16:33:13.000000000 +0200
+++ ./alsaconf	2003-09-08 16:44:03.000000000 +0200
@@ -36,11 +36,12 @@
   distribution="unknown"
 fi
 
-if [ -x /sbin/lsmod ]; then
-  lsmod=/sbin/lsmod
-else
-  lsmod=/bin/lsmod
-fi
+for prog in lspci lsmod; do
+	for path in /sbin /usr/sbin /bin /usr/bin;do
+		[[ -x $path/$prog ]] && eval $prog=$path/$prog
+	done
+done
+unset prog path
 
 usage() {
     echo "ALSA configurator version $version"
@@ -438,7 +439,7 @@
 /^[<literal space><literal tab>]*PCI: /{
 	gsub(/0x/, "");
 	gsub(/=/, ":");
-	x = sprintf ("/sbin/lspci -n | grep '"'Class 0401'"' | grep %s", $2);
+	x = sprintf ("'$lspci' -n | grep '"'Class 0401'"' | grep %s", $2);
 	if (system (x) == 0)
 		printf "%s %s\n", $2, driver >>"'"$FOUND"'"
 }
@@ -468,7 +469,7 @@
 #
 find_device_name () {
     if expr "$1" : '[0-9a-f][0-9a-f][0-9a-f][0-9a-f]:[0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
-	/sbin/lspci -d $1 | sed -e 's/^..:..\.. Multimedia audio controller: //g'
+	$lspci -d $1 | sed -e 's/^..:..\.. Multimedia audio controller: //g'
 	return
     elif expr "$1" : '[A-Z@][A-Z@][A-Z@][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' >/dev/null; then
 	cardname=`grep '^Card [0-9]\+ '\'$1':' $DUMP | head -n 1 | sed -e 's/^Card [0-9]\+ '\''.*:\(.*\)'\'' .*$/\1/'`
@@ -1026,7 +1027,7 @@
     # check for TP600E
     #
     if [ ${devs_found[0]} = cs46xx ]; then
-	if /sbin/lspci -nv | grep -q "Subsystem: 1014:1010"; then
+	if $lspci -nv | grep -q "Subsystem: 1014:1010"; then
 	    if $DIALOG --yesno "
  Looks like you having a Thinkpad 600E notebook.
  On this notebook, CS4236 driver should be used

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-09 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-08 14:58 [PATCH] let alsaconf work on all distros Thierry Vignaud
2003-09-09 18:09 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.