Re: alsa-compile-script patches for supporting Debian and Ubuntu distro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From: Paul Menzel [mailto:paulepanter@xxxxxxxxxxxxxxxxxxxxx]
>Sent: Wednesday, November 03, 2010 4:37 PM
>To: alsa-user@xxxxxxxxxxxxxxxxxxxxx
>Subject: Re:  alsa-compile-script patches for supporting
>Debian and Ubuntu distro
>
>Am Mittwoch, den 03.11.2010, 10:07 +0200 schrieb Wanming.Zhang@xxxxxxxxx:
>> Sorry, the below is patch for support Debian and Ubuntu.
>>
>> $ cd alsa-driver
>> $ git diff --cached
>
>You can create a message from your last commit using
>
>	$ git format-patch -1 -s
>
>Take a look at the manual pages for more information.
>
>	$ git help format-patch
>

Thank you!
I reset my outlook.
And those is new patch (just change space to tab), I hope this is helpful.
I do not know, if I should remove the tail white space in alsa-compile.sh.

>From c0efc2760d7c972e43f9163433dd93f8018f7080 Mon Sep 17 00:00:00 2001
From: Zhang Wanming <wanming.zhang@xxxxxxxxx>
Date: Wed, 3 Nov 2010 04:56:57 -0400
Subject: [PATCH] Changed for supporting Debian and Ubuntu


Signed-off-by: Zhang Wanming <wanming.zhang@xxxxxxxxx>
---
 utils/alsa-compile.sh |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/utils/alsa-compile.sh b/utils/alsa-compile.sh
index 4f72d10..e2dba4a 100755
--- a/utils/alsa-compile.sh
+++ b/utils/alsa-compile.sh
@@ -329,6 +329,16 @@ is_rpm_installed() {
 	fi
 }
 
+# Echo "true" if deb installed, else "false"
+is_deb_installed() {
+    dpkg -l $1 2>&1 | grep -Eq '^ii'
+	if test "$?" = "0"; then
+		echo "true"
+	else
+		echo "false"
+	fi
+}
+
 # Install package
 # $1 is package name
 install_package() {
@@ -340,6 +350,14 @@ install_package() {
 	Fedora|RHEL)
 		test "$pkg" == "lsb" && pkg="redhat-lsb"
 		;;
+	Debian|Ubuntu)
+		test "$pkg" == "lsb" && pkg="lsb-release"
+		test "$pkg" == "git" && pkg="git-core"
+		test "$pkg" == "alsa-lib-devel" && pkg="libasound2-dev"
+		test "$pkg" == "gettext-tools" && pkg="gettext-base"
+		test "$pkg" == "gettext-devel" && pkg="gettext"
+		test "$pkg" == "ncurses-devel" && pkg="ncurses-bin"
+ 		;;
 	*)
 		echo >&2 "Cannot install $1 for unsupported distribution $distrib."
 		exit 1
@@ -352,6 +370,9 @@ install_package() {
 	Fedora|RHEL)
 		yum install -y $pkg
 		;;
+	Debian|Ubuntu)
+		apt-get install -y $pkg
+		;;
 	*)
 		echo >&2 "Cannot install $pkg for unsupported distribution $distrib."
 		exit 1
@@ -400,6 +421,12 @@ check_kernel_source() {
 			install_package $kernel_devel
 		fi
 		;;
+	Debian|Ubuntu)
+		local kernel_devel="linux-source-$(uname --kernel-release | sed 's/-.*$//')"
+		if test $(is_deb_installed $kernel_devel) = "false" ; then
+			install_package $kernel_devel
+		fi
+		;;
 	*)
 		echo >&2 "Cannot install kernel sources for unsupported distribution $distrib."
 		exit 1
-- 
1.7.1

>> diff --git a/utils/alsa-compile.sh b/utils/alsa-compile.sh index
>> 4f72d10..e2dba4a 100755
>> --- a/utils/alsa-compile.sh
>> +++ b/utils/alsa-compile.sh
>> @@ -329,6 +329,16 @@ is_rpm_installed() {
>>         fi
>>  }
>>
>> +# Echo "true" if deb installed, else "false"
>> +is_deb_installed() {
>> +    dpkg -l $1 2>&1 | grep -Eq '^ii'
>> +       if test "$?" = "0"; then
>> +               echo "true"
>> +       else
>> +               echo "false"
>> +       fi
>> +}
>> +
>>  # Install package
>>  # $1 is package name
>>  install_package() {
>> @@ -340,6 +350,14 @@ install_package() {
>>         Fedora|RHEL)
>>                 test "$pkg" == "lsb" && pkg="redhat-lsb"
>>                 ;;
>> +       Debian|Ubuntu)
>> +               test "$pkg" == "lsb" && pkg="lsb-release"
>> +               test "$pkg" == "git" && pkg="git-core"
>> +               test "$pkg" == "alsa-lib-devel" && pkg="libasound2-
>dev"
>> +        test "$pkg" == "gettext-tools" && pkg="gettext-base"
>> +        test "$pkg" == "gettext-devel" && pkg="gettext"
>> +        test "$pkg" == "ncurses-devel" && pkg="ncurses-bin"
>> +        ;;
>>         *)
>>                 echo >&2 "Cannot install $1 for unsupported
>distribution $distrib."
>>                 exit 1
>> @@ -352,6 +370,9 @@ install_package() {
>>         Fedora|RHEL)
>>                 yum install -y $pkg
>>                 ;;
>> +       Debian|Ubuntu)
>> +        apt-get install -y $pkg
>
>I would prefer `aptitude` over `apt-get` since that is the recommended
>package manager at least for Debian.
>
>	aptitude install -y $pkg
>
>> +        ;;
>>         *)
>>                 echo >&2 "Cannot install $pkg for unsupported
>distribution $distrib."
>>                 exit 1
>> @@ -400,6 +421,12 @@ check_kernel_source() {
>>                         install_package $kernel_devel
>>                 fi
>>                 ;;
>> +       Debian|Ubuntu)
>> +        local kernel_devel="linux-source-$(uname --kernel-release |
>sed 's/-.*$//')"
>> +        if test $(is_deb_installed $kernel_devel) = "false" ; then
>> +            install_package $kernel_devel
>> +        fi
>> +        ;;
>>         *)
>>                 echo >&2 "Cannot install kernel sources for
>unsupported distribution $distrib."
>>                 exit 1
>
>
>Thanks,
>
>Paul
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux