[Pkg-bluetooth-commits] r1123 - in /packages/bluez/trunk/debian: bluez-alsa.preinst bluez.postinst bluez.preinst
iwamatsu at users.alioth.debian.org
iwamatsu at users.alioth.debian.org
Wed Aug 24 02:36:23 UTC 2011
Author: iwamatsu
Date: Wed Aug 24 02:36:23 2011
New Revision: 1123
URL: http://svn.debian.org/wsvn/pkg-bluetooth/?sc=1&rev=1123
Log:
Use dpkg-maintscript-helper to handle conffiles
Modified:
packages/bluez/trunk/debian/bluez-alsa.preinst
packages/bluez/trunk/debian/bluez.postinst
packages/bluez/trunk/debian/bluez.preinst
Modified: packages/bluez/trunk/debian/bluez-alsa.preinst
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/bluez-alsa.preinst?rev=1123&op=diff
==============================================================================
--- packages/bluez/trunk/debian/bluez-alsa.preinst (original)
+++ packages/bluez/trunk/debian/bluez-alsa.preinst Wed Aug 24 02:36:23 2011
@@ -1,30 +1,12 @@
#!/bin/sh
set -e
-# snippet from http://wiki.debian.org/DpkgConffileHandling
-
-# Remove a no-longer used conffile
-rm_conffile() {
- PKGNAME="$1"
- CONFFILE="$2"
- if [ -e "$CONFFILE" ]; then
- md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
- old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
- if [ "$md5sum" != "$old_md5sum" ]; then
- echo "Obsolete conffile $CONFFILE has been modified by you."
- echo "Saving as $CONFFILE.dpkg-bak ..."
- mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
- else
- echo "Removing obsolete conffile $CONFFILE ..."
- rm -f "$CONFFILE"
- fi
- fi
-}
case "$1" in
install|upgrade)
- if dpkg --compare-versions "$2" le "3.24-1+b1"; then
- rm_conffile bluez-audio "/etc/bluetooth/audio.service"
+ if dpkg-maintscript-helper supports rm_conffile; then
+ dpkg-maintscript-helper \
+ rm_conffile /etc/bluetooth/audio.service 3.24-1+b1 bluez-audio -- "$@"
fi
esac
Modified: packages/bluez/trunk/debian/bluez.postinst
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/bluez.postinst?rev=1123&op=diff
==============================================================================
--- packages/bluez/trunk/debian/bluez.postinst (original)
+++ packages/bluez/trunk/debian/bluez.postinst Wed Aug 24 02:36:23 2011
@@ -1,19 +1,6 @@
#!/bin/sh
-# snippet from http://www.dpkg.org/dpkg/ConffileHandling
set -e
-
-# Move a conffile without triggering a dpkg question
-mv_conffile() {
- OLDCONFFILE="$1"
- NEWCONFFILE="$2"
-
- if [ -e "$OLDCONFFILE" ]; then
- echo "Preserving user changes to $NEWCONFFILE ..."
- mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
- mv -f "$OLDCONFFILE" "$NEWCONFFILE"
- fi
-}
case "$1" in
configure)
Modified: packages/bluez/trunk/debian/bluez.preinst
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/bluez.preinst?rev=1123&op=diff
==============================================================================
--- packages/bluez/trunk/debian/bluez.preinst (original)
+++ packages/bluez/trunk/debian/bluez.preinst Wed Aug 24 02:36:23 2011
@@ -2,63 +2,28 @@
set -e
-# snippet from http://www.dpkg.org/dpkg/ConffileHandling
-
-# Prepare to move a conffile without triggering a dpkg question
-prep_mv_conffile() {
- CONFFILE="$1"
-
- if [ -e "$CONFFILE" ]; then
- md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
- old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
- if [ "$md5sum" = "$old_md5sum" ]; then
- rm -f "$CONFFILE"
- fi
- fi
-}
-
-# Remove a no-longer used conffile
-rm_conffile() {
- PKGNAME="$1"
- CONFFILE="$2"
- if [ -e "$CONFFILE" ]; then
- md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
- old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
- if [ "$md5sum" != "$old_md5sum" ]; then
- echo "Obsolete conffile $CONFFILE has been modified by you."
- echo "Saving as $CONFFILE.dpkg-bak ..."
- mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
- else
- echo "Removing obsolete conffile $CONFFILE ..."
- rm -f "$CONFFILE"
- fi
- fi
-}
-
case "$1" in
install|upgrade)
- if dpkg --compare-versions "$2" le "3.7-1"; then
- prep_mv_conffile "/etc/dbus-1/system.d/bluez-hcid.conf"
- fi
- if dpkg --compare-versions "$2" le "3.30-1"; then
- rm_conffile bluez-utils "/etc/bluetooth/network.service"
- rm_conffile bluez-utils "/etc/bluetooth/serial.service"
- rm_conffile bluez-utils "/etc/bluetooth/input.service"
- fi
-
- # now that modprobe whines remove this old conffile, will be
- # http://bugs.debian.org/523050
- base="/etc/modprobe.d/bluez"
- rm_conffile bluez "$base"
- if [ -e "$base.dpkg-bak" ]; then
- if [ -e "$base.conf" ]; then
- echo "$base.conf exists, not touching"
- else
- echo "Moving $base.dpkg-bak to $base.conf"
- mv -f "$base.dpkg-bak" "$base.conf"
- fi
- fi
+ if dpkg-maintscript-helper supports rm_conffile; then
+ for conffile in \
+ "/etc/bluetooth/network.service" \
+ "/etc/bluetooth/serial.service" \
+ "/etc/bluetooth/input.service"; do
+ dpkg-maintscript-helper \
+ rm_conffile "${conffile}" 3.30-1 bluez-utils -- "$@"
+ done
+ dpkg-maintscript-helper rm_conffile \
+ /etc/dbus-1/system.d/bluez-hcid.conf 3.7-1 bluez-utils -- "$@"
+ fi
+
+ if dpkg-maintscript-helper supports mv_conffile; then
+ dpkg-maintscript-helper mv_conffile \
+ /etc/dbus-1/system.d/bluetooth.conf 3.7-1 bluez -- "$@"
+
+ dpkg-maintscript-helper mv_conffile \
+ /etc/modprobe.d/bluez /etc/modprobe.d/bluez.conf 4.42-1 bluez -- "$@"
+ fi
esac
#DEBHELPER#
More information about the Pkg-bluetooth-commits
mailing list