[Pkg-alsa-devel] [Debian ALSA CVS] debian/alsa-utils/debian/patches (1 file)
Thomas Hood
jdthood-guest@haydn.debian.org
Mon, 06 Sep 2004 15:50:16 -0600
Date: Monday, September 6, 2004 @ 15:50:16
Author: jdthood-guest
Path: /cvsroot/pkg-alsa/debian/alsa-utils/debian/patches
Added: 90_debian_alsaconf_notouch.dpatch
Add debian/patches/90_debian_alsaconf_notouch.dpatch which makes alsaconf not crate /etc/modprobe.conf if it didn't exist before
-----------------------------------+
90_debian_alsaconf_notouch.dpatch | 87 ++++++++++++++++++++++++++++++++++++
1 files changed, 87 insertions(+)
Index: debian/alsa-utils/debian/patches/90_debian_alsaconf_notouch.dpatch
diff -u /dev/null debian/alsa-utils/debian/patches/90_debian_alsaconf_notouch.dpatch:1.1
--- /dev/null Mon Sep 6 15:50:16 2004
+++ debian/alsa-utils/debian/patches/90_debian_alsaconf_notouch.dpatch Mon Sep 6 15:50:15 2004
@@ -0,0 +1,105 @@
+#! /bin/sh -e
+## 90_debian_alsaconf_notouch.dpatch by <jdthood@yahoo.co.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/jdthood/src/pkg-alsa/debian/alsa-utils/alsaconf/alsaconf.in alsa-utils/alsaconf/alsaconf.in
+--- /home/jdthood/src/pkg-alsa/debian/alsa-utils/alsaconf/alsaconf.in 2004-09-06 22:54:50.000000000 +0200
++++ alsa-utils/alsaconf/alsaconf.in 2004-09-06 23:01:48.000000000 +0200
+@@ -166,9 +166,6 @@
+ if [ -d /etc/modprobe.d ]; then
+ cfgout="/etc/modprobe.d/sound"
+ fi
+- if [ ! -r /etc/modprobe.conf ]; then
+- touch /etc/modprobe.conf
+- fi
+ cfgfile="/etc/modprobe.conf"
+ elif [ "$distribution" = "debian" ]; then
+ cfgfile="/etc/alsa/modutils/0.9"
+@@ -548,20 +545,6 @@
+ }
+
+ #
+-# make a backup of old config
+-backup_old_config () {
+- if cmp -s $1 $2; then
+- return
+- fi
+- if cp -f $1 $1.old; then
+- cp -f $2 $1
+- else
+- echo "ERROR! $1 could not be saved."
+- exit 1
+- fi
+-}
+-
+-#
+ # configure and try test sound
+ #
+ ac_config_card () {
+@@ -595,17 +578,26 @@
+ fi
+
+ if [ "$distribution" = "redhat" -o "$distribution" = "fedora" ] ; then
+- remove_ac_block < $cfgfile | remove_sndconfig_block | uniq > $TMP
++ if [ -r $cfgfile ] ; then
++ remove_ac_block < $cfgfile | remove_sndconfig_block | uniq > $TMP
++ else
++ rm -f $TMP
++ fi
+ else
+- remove_ac_block < $cfgfile | remove_y2_block | uniq > $TMP
++ if [ -r $cfgfile ] ; then
++ remove_ac_block < $cfgfile | remove_y2_block | uniq > $TMP
++ else
++ rm -f $TMP
++ fi
+ fi
+
+ if [ -n "$cfgout" ]; then
+ rm -f "$cfgout"
+- touch "$cfgout"
++ : > "$cfgout"
+ addcfg="$cfgout"
+ else
+ addcfg="$TMP"
++ touch "$TMP"
+ echo "$ACB
+ # --- ALSACONF verion $version ---" >> $addcfg
+ fi
+@@ -637,10 +629,12 @@
+ " >> $addcfg
+ fi
+
+- if [ -n "$cfgout" ]; then
+- backup_old_config $cfgfile $TMP
++ if [ -r $TMP ]; then
++ if [ ! -r $cfgfile ] || ! cmp -s $TMP $cfgfile ; then
++ cp -f $TMP $cfgfile
++ fi
+ else
+- backup_old_config $cfgfile $addcfg
++ [ -r $cfgfile ] && : > $cfgfile
+ fi
+
+ /sbin/depmod -a 2>/dev/null