r111 - mdadm/trunk/debian
madduck at users.alioth.debian.org
madduck at users.alioth.debian.org
Sun Aug 20 12:08:05 UTC 2006
Author: madduck
Date: 2006-08-20 12:08:04 +0000 (Sun, 20 Aug 2006)
New Revision: 111
Modified:
mdadm/trunk/debian/mdadm.preinst
Log:
save mdadm v1 -Es output for upgrades
Modified: mdadm/trunk/debian/mdadm.preinst
===================================================================
--- mdadm/trunk/debian/mdadm.preinst 2006-08-14 15:43:09 UTC (rev 110)
+++ mdadm/trunk/debian/mdadm.preinst 2006-08-20 12:08:04 UTC (rev 111)
@@ -5,13 +5,28 @@
# $Id$
#
-# migrate old configuration from *way back then*
-DEBIANCONFIG=/etc/default/mdadm
-OLDCONFIG=/etc/mdadm/debian.conf
-if [ -s $OLDCONFIG ] && [ ! -f $DEBIANCONFIG ]; then
- mv $OLDCONFIG $DEBIANCONFIG
-fi
+case "$1" in
+ upgrade|install)
+
+ # migrate old configuration from *way back then*
+ DEBIANCONFIG=/etc/default/mdadm
+ OLDCONFIG=/etc/mdadm/debian.conf
+ if [ -s $OLDCONFIG ] && [ ! -f $DEBIANCONFIG ]; then
+ mv $OLDCONFIG $DEBIANCONFIG
+ fi
+
+ # save the v1 output of -Es just in case we need it for upgrades
+ MDADM="$(command -v mdadm 2>/dev/null)"
+ if [ -x "$MDADM" ] && dpkg --compare-versions "$2" lt 2; then
+ echo DEVICE partitions > /var/backups/mdadm-Es_v1.dump
+ $MDADM -Esc /var/backups/mdadm-Es_v1.dump >> /var/backups/mdadm-Es_v1.dump
+ fi
+ ;;
+
+ *) :;;
+esac
+
# See #369953
set +u
#DEBHELPER#
More information about the pkg-mdadm-commits
mailing list