Hi, again.
2011/8/10 Nobuhiro Iwamatsu <[email protected]>:
>> 0004-use-dpkg-maintscript-helper-to-handle-conffiles-remo.patch:
>> use dpkg-maintscript-helper to handle conffiles, remove init script
>>
>> Remove custom {rm|mv}_conffile handling and use dpkg-maintscript-helper
>> and remove the init script, now handled by udev
>
> Sorry, I do not check this yet.
I applied without init script patch and bluez.bluetooth.default patch.
These is necessary yet.
And I add tiny fix.
I attached new patch.
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
Index: bluez-alsa.preinst
===================================================================
--- bluez-alsa.preinst (リビジョン 1121)
+++ bluez-alsa.preinst (作業コピー)
@@ -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
Index: bluez.postinst
===================================================================
--- bluez.postinst (リビジョン 1108)
+++ bluez.postinst (作業コピー)
@@ -1,20 +1,7 @@
#!/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)
if [ -e /etc/init.d/bluez-utils ]; then
Index: bluez.preinst
===================================================================
--- bluez.preinst (リビジョン 1121)
+++ bluez.preinst (作業コピー)
@@ -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