[debian-edu-commits] debian-edu/ 01/01: Use dpkg-maintscript-helper to remove obsolete conffiles.
Wolfgang Schweer
schweer-guest at moszumanska.debian.org
Fri Mar 3 23:55:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
schweer-guest pushed a commit to branch master
in repository debian-edu-config.
commit bc47134a8989f5ab388ea9135d0a6002d2ca109b
Author: Wolfgang Schweer <wschweer at arcor.de>
Date: Sat Mar 4 00:54:54 2017 +0100
Use dpkg-maintscript-helper to remove obsolete conffiles.
debian/debian-edu-config.postinst: Remove unneeded code.
Thanks to Andreas Beckmann for the hint. (Closes: #856682)
---
debian/changelog | 8 ++++++
debian/debian-edu-config.maintscript | 11 ++++++++
debian/debian-edu-config.postinst | 52 ------------------------------------
3 files changed, 19 insertions(+), 52 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index aaf24cf..60ea16d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debian-edu-config (1.924) UNRELEASED; urgency=medium
+
+ * Use dpkg-maintscript-helper to remove obsolete conffiles.
+ debian/debian-edu-config.postinst: Remove unneeded code.
+ Thanks to Andreas Beckmann for the hint. (Closes: #856682)
+
+ -- Wolfgang Schweer <wschweer at arcor.de> Sat, 04 Mar 2017 00:37:59 +0100
+
debian-edu-config (1.923) unstable; urgency=medium
[ Wolfgang Schweer ]
diff --git a/debian/debian-edu-config.maintscript b/debian/debian-edu-config.maintscript
index d5cdd7d..ff05fed 100644
--- a/debian/debian-edu-config.maintscript
+++ b/debian/debian-edu-config.maintscript
@@ -1,3 +1,14 @@
mv_conffile /etc/apache2/sites-available/debian-edu-default /etc/apache2/sites-available/debian-edu-default.conf 1.719
mv_conffile /etc/apache2/sites-available/debian-edu-ssl-default /etc/apache2/sites-available/debian-edu-ssl-default.conf 1.719
mv_conffile /etc/apache2/conf.d/debian-edu-config-doc /etc/apache2/conf-available/debian-edu-config-doc.conf 1.719
+rm_conffile /etc/cfengine/debian-edu/cf.pdns 1.811
+rm_conffile /etc/insserv.conf.d/debian-edu-config 1.811
+rm_conffile /etc/powerdns/pdns.d/pdns-debian-edu.conf 1.811
+rm_conffile /etc/cfengine/debian-edu/cf.kdm 1.906
+rm_conffile /etc/ldap/slapd-debian-edu.conf 1.911
+rm_conffile /etc/ldap/slapd-lenny_debian-edu.conf 1.911
+rm_conffile /etc/X11/Xsession.d/06debian-edu-iceweasel-ltsp 1.818+deb8u1
+rm_conffile /etc/apt/apt.conf.d/99-edu-prefer-iceweasel 1.818+deb8u1
+rm_conffile /etc/init.d/iceweasel-ldapconf 1.818+deb8u1
+rm_conffile /etc/cfengine/debian-edu/cf.iceweasel 1.818+deb8u1
+rm_conffile /usr/share/debian-edu-config/iceweacel-networked-prefs.js 1.818+deb8u1
diff --git a/debian/debian-edu-config.postinst b/debian/debian-edu-config.postinst
index b353fc6..c72c318 100644
--- a/debian/debian-edu-config.postinst
+++ b/debian/debian-edu-config.postinst
@@ -46,41 +46,6 @@ fi
# Enable debconf
. /usr/share/debconf/confmodule
-# Remove a no-longer used conffile. From
-# http://wiki.debian.org/DpkgConffileHandling
-rm_conffile() {
- PKGNAME="$1"
- CONFFILE="$2"
-
- [ -e "$CONFFILE" ] || return 0
-
- 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." 1>&2
- echo "Saving as $CONFFILE.dpkg-bak ..." 1>&2
- mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
- else
- echo "Removing obsolete conffile $CONFFILE ..." 1>&2
- rm -f "$CONFFILE"
- fi
-}
-
-# Move a conffile without triggering a dpkg question. From
-# http://wiki.debian.org/DpkgConffileHandling
-mv_conffile() {
- local OLDCONFFILE="$1"
- local NEWCONFFILE="$2"
-
- [ -e "$OLDCONFFILE" ] || return 0
-
- echo "Preserving user changes to $NEWCONFFILE ..."
- mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
- mv -f "$OLDCONFFILE" "$NEWCONFFILE"
-}
-
-
# Execute early, to get the state before changes activated by this
# package is done.
if [ -x /usr/bin/etckeeper ] ; then
@@ -162,21 +127,10 @@ fi
case "$1" in
configure)
- if dpkg --compare-versions "$2" le "1.811"; then
- rm_conffile debian-edu-config /etc/cfengine/debian-edu/cf.pdns
- rm_conffile debian-edu-config /etc/insserv.conf.d/debian-edu-config
- rm_conffile debian-edu-config /etc/powerdns/pdns.d/pdns-debian-edu.conf
- fi
-
if dpkg --compare-versions "$2" le "1.818+deb8u1" && [ -L /usr/bin/firefox-esr ] ; then
- rm_conffile debian-edu-config /etc/X11/Xsession.d/06debian-edu-iceweasel-ltsp
- rm_conffile debian-edu-config /etc/apt/apt.conf.d/99-edu-prefer-iceweasel
- rm_conffile debian-edu-config /etc/init.d/iceweasel-ldapconf
- rm_conffile debian-edu-config /etc/cfengine/debian-edu/cf.iceweasel
if [ -L /etc/iceweasel/pref/debian-edu-networked.js ] ; then
rm /etc/iceweasel/pref/debian-edu-networked.js
fi
- rm_conffile debian-edu-config /usr/share/debian-edu-config/iceweacel-networked-prefs.js
if [ -e /etc/iceweasel/pref/debian-edu-homepage-ldap.js ] ; then
rm /etc/iceweasel/pref/debian-edu-homepage-ldap.js
fi
@@ -202,17 +156,11 @@ configure)
fi
if dpkg --compare-versions "$2" le "1.906"; then
- rm_conffile debian-edu-config /etc/cfengine/debian-edu/cf.kdm
if [ -e /etc/insserv/overrides/kdm ] ; then
rm /etc/insserv/overrides/kdm
fi
fi
- if dpkg --compare-versions "$2" le "1.911"; then
- rm_conffile debian-edu-config /etc/ldap/slapd-debian-edu.conf
- rm_conffile debian-edu-config /etc/ldap/slapd-lenny_debian-edu.conf
- fi
-
# sssd refuses to read the file if it has any other mode
chmod 600 /etc/sssd/sssd-debian-edu.conf
chown root:root /etc/sssd/sssd-debian-edu.conf
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git
More information about the debian-edu-commits
mailing list