[Pkg-alsa-devel] Bug#246064: alsa-base: 'mv' fails when installing on new system

Rick Bradley Rick Bradley <rick@rickbradley.com>, 246064@bugs.debian.org
Mon, 26 Apr 2004 21:34:06 -0500


Package: alsa-base
Version: 1.0.4-2
Severity: important
Tags: sid patch

When installing this package on a system where it has never been
installed before, I see the message "Note: Moving to /etc/default/alsa", 
at which point the install errors out because the 'mv' executed in
postinst can't find an old config file to move.

A patch updating postinst to check whether a config file was actually
found appears below.  I have verified that this installs the package
cleanly on my system.

Rick Bradley (rick@rickbradley.com, rick@basesys.com)


--- postinst-orig	2004-04-26 21:24:06.000000000 -0500
+++ postinst	2004-04-26 21:23:22.000000000 -0500
@@ -10,8 +10,10 @@
 	elif [ -f /etc/alsa-base.conf ]; then
 	    filename="/etc/alsa-base.conf"
 	fi
-	printf "Note: Moving $filename to /etc/default/alsa\n"
-	mv $filename /etc/default/alsa
+	if [ -n "${filename}" ]; then
+	    printf "Note: Moving $filename to /etc/default/alsa\n"
+	    mv $filename /etc/default/alsa
+	fi
     fi
 fi
 

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (200, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.5
Locale: LANG=C, LC_CTYPE=C

Versions of packages alsa-base depends on:
ii  alsa-utils                   1.0.4-1     Advanced Linux Sound Architecture 
ii  debconf                      1.4.24      Debian configuration management sy
ii  debianutils                  2.8.1       Miscellaneous utilities specific t
ii  module-init-tools            3.0-pre10-2 tools for managing Linux kernel mo
ii  modutils                     2.4.26-1    Linux module utilities
ii  psmisc                       21.4-1      Utilities that use the proc filesy

-- debconf information:
  alsa-base/alsactl_store_on_shutdown: autosave always