[Pkg-alsa-devel] [Debian ALSA CVS] debian/alsa-utils/debian (5 files)
David B Harris
dbharris-guest@quantz.debian.org
Fri, 27 Feb 2004 00:30:33 +0100
Date: Friday, February 27, 2004 @ 00:30:33
Author: dbharris-guest
Path: /cvsroot/pkg-alsa/debian/alsa-utils/debian
Added: patches/10_move_asound_state_to_var.dpatch postinst
Modified: changelog dirs patches/00list
Do everything that's required for moving /etc/asound.state to /var/lib/alsa/ - nobody was around when I did this, so I don't have any second opinions ... lemme know if it should be backed out :) I'll also be adding a versioned dependency to alsa-base so that when its postinst runs the alsactl it launches will get the state from the right place
--------------------------------------------+
changelog | 9 +++
dirs | 1
patches/00list | 1
patches/10_move_asound_state_to_var.dpatch | 64 +++++++++++++++++++++++++++
postinst | 21 ++++++++
5 files changed, 95 insertions(+), 1 deletion(-)
Index: debian/alsa-utils/debian/changelog
diff -u debian/alsa-utils/debian/changelog:1.8 debian/alsa-utils/debian/changelog:1.9
--- debian/alsa-utils/debian/changelog:1.8 Thu Feb 26 04:43:15 2004
+++ debian/alsa-utils/debian/changelog Fri Feb 27 00:30:33 2004
@@ -5,9 +5,16 @@
* David B. Harris:
- debian/control: Change my Uploaders: email address from my private
address to dbharris@debian.org
+ - alsaconf/alsaconf.in, alsactl/alsactl.{1,c} via
+ patches/10_move_asound_state_to_var.dpatch:
+ Move the default asound.state from /etc/ to /var/lib/alsa/
+ (Closes: #106244)
+ - debian/postinst: If /etc/asound.state exists, copy it to /var/lib/alsa.
+ alsa-base will require a versioned Depends: on this package so that
+ restarting ALSA in its postinst will get the state from the right place.
* Unreleased.
- -- David B. Harris <dbharris@debian.org> Wed, 25 Feb 2004 22:43:29 -0500
+ -- David B. Harris <dbharris@debian.org> Thu, 26 Feb 2004 18:29:43 -0500
alsa-utils (1.0.2-1) unstable; urgency=low
Index: debian/alsa-utils/debian/dirs
diff -u debian/alsa-utils/debian/dirs:1.1 debian/alsa-utils/debian/dirs:1.2
--- debian/alsa-utils/debian/dirs:1.1 Mon Feb 9 00:14:34 2004
+++ debian/alsa-utils/debian/dirs Fri Feb 27 00:30:33 2004
@@ -1,3 +1,4 @@
etc/alsa/0.9
usr/share/alsa-base
usr/sbin
+var/lib/alsa
Index: debian/alsa-utils/debian/patches/00list
diff -u debian/alsa-utils/debian/patches/00list:1.1 debian/alsa-utils/debian/patches/00list:1.2
--- debian/alsa-utils/debian/patches/00list:1.1 Mon Feb 9 00:14:34 2004
+++ debian/alsa-utils/debian/patches/00list Fri Feb 27 00:30:33 2004
@@ -1 +1,2 @@
+10_move_asound_state_to_var
90_debian_alsaconf
Index: debian/alsa-utils/debian/patches/10_move_asound_state_to_var.dpatch
diff -u /dev/null debian/alsa-utils/debian/patches/10_move_asound_state_to_var.dpatch:1.1
--- /dev/null Fri Feb 27 00:30:33 2004
+++ debian/alsa-utils/debian/patches/10_move_asound_state_to_var.dpatch Fri Feb 27 00:30:33 2004
@@ -0,0 +1,72 @@
+#! /bin/sh -e
+## 10_move_asound_state_to_var.dpatch by David B. Harris <dbharris@debian.org>
+##
+## 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/dbharris/source/debian/alsa-utils/alsaconf/alsaconf.in alsa-utils/alsaconf/alsaconf.in
+--- /home/dbharris/source/debian/alsa-utils/alsaconf/alsaconf.in 2003-12-05 08:13:00.000000000 -0500
++++ alsa-utils/alsaconf/alsaconf.in 2004-02-26 18:04:32.000000000 -0500
+@@ -638,8 +638,8 @@
+ aplay $TESTSOUND
+ fi
+ fi
+- if [ ! -r /etc/asound.state ]; then
+- echo "Saving the mixer setup used for this in /etc/asound.state."
++ if [ ! -r /var/lib/alsa/asound.state ]; then
++ echo "Saving the mixer setup used for this in /var/lib/alsa/asound.state."
+ /usr/sbin/alsactl store
+ fi
+ cat <<END
+diff -urNad /home/dbharris/source/debian/alsa-utils/alsactl/alsactl.1 alsa-utils/alsactl/alsactl.1
+--- /home/dbharris/source/debian/alsa-utils/alsactl/alsactl.1 2002-09-06 11:21:01.000000000 -0400
++++ alsa-utils/alsactl/alsactl.1 2004-02-26 18:04:59.000000000 -0500
+@@ -34,7 +34,7 @@
+
+ .TP
+ \fI-f, --file\fP
+-Select the configuration file to use. The default is /etc/asound.state
++Select the configuration file to use. The default is /var/lib/alsa/asound.state
+
+ .TP
+ \fI-F, --force\fP
+@@ -50,7 +50,7 @@
+ Print alsactl version number.
+
+ .SH FILES
+-\fI/etc/asound.state\fP (or whatever file you specify with the
++\fI/var/lib/alsa/asound.state\fP (or whatever file you specify with the
+ \fB-f\fP flag) is used to store current settings for your
+ soundcards. The settings include all the usual soundcard mixer
+ settings. More importantly, alsactl is
+diff -urNad /home/dbharris/source/debian/alsa-utils/alsactl/alsactl.c alsa-utils/alsactl/alsactl.c
+--- /home/dbharris/source/debian/alsa-utils/alsactl/alsactl.c 2003-06-20 14:13:28.000000000 -0400
++++ alsa-utils/alsactl/alsactl.c 2004-02-26 18:05:59.000000000 -0500
+@@ -29,7 +29,7 @@
+ #include <errno.h>
+ #include <alsa/asoundlib.h>
+
+-#define SYS_ASOUNDRC "/etc/asound.state"
++#define SYS_ASOUNDRC "/var/lib/alsa/asound.state"
+
+ int debugflag = 0;
+ int force_restore = 0;
Index: debian/alsa-utils/debian/postinst
diff -u /dev/null debian/alsa-utils/debian/postinst:1.1
--- /dev/null Fri Feb 27 00:30:33 2004
+++ debian/alsa-utils/debian/postinst Fri Feb 27 00:30:33 2004
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+ configure)
+ if [ -f /etc/asound.state ]; then
+ mv /etc/asound.state /var/lib/alsa/asound.state
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+exit 0