[xml/sgml-commit] r813 - in /packages/docbook-xml/trunk/debian: changelog docbook-xml.preinst

dleidert-guest at users.alioth.debian.org dleidert-guest at users.alioth.debian.org
Mon May 28 20:31:09 UTC 2007


Author: dleidert-guest
Date: Mon May 28 20:31:08 2007
New Revision: 813

URL: http://svn.debian.org/wsvn/debian-xml-sgml/?sc=1&rev=813
Log:
* debian/docbook-xml.preinst: Added some code to remove
  /etc/sgml/docbook-xml/3.1.7/dbgenent.ent automatically, if not touched
  (closes: #426058).


Modified:
    packages/docbook-xml/trunk/debian/changelog
    packages/docbook-xml/trunk/debian/docbook-xml.preinst

Modified: packages/docbook-xml/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/debian-xml-sgml/packages/docbook-xml/trunk/debian/changelog?rev=813&op=diff
==============================================================================
--- packages/docbook-xml/trunk/debian/changelog (original)
+++ packages/docbook-xml/trunk/debian/changelog Mon May 28 20:31:08 2007
@@ -3,6 +3,9 @@
   * NOT RELEASED YET
 
   [ Daniel Leidert ]
+  * debian/docbook-xml.preinst: Added some code to remove
+    /etc/sgml/docbook-xml/3.1.7/dbgenent.ent automatically, if not touched
+    (closes: #426058).
   * debian/watch: Added watch file.
 
  -- Daniel Leidert (dale) <daniel.leidert at wgdd.de>  Sat, 05 May 2007 00:34:24 +0200

Modified: packages/docbook-xml/trunk/debian/docbook-xml.preinst
URL: http://svn.debian.org/wsvn/debian-xml-sgml/packages/docbook-xml/trunk/debian/docbook-xml.preinst?rev=813&op=diff
==============================================================================
--- packages/docbook-xml/trunk/debian/docbook-xml.preinst (original)
+++ packages/docbook-xml/trunk/debian/docbook-xml.preinst Mon May 28 20:31:08 2007
@@ -1,6 +1,23 @@
 #!/bin/sh
 
 set -e
+
+rm_conffile() {
+	CONFFILE="$1"
+	
+	if [ -e "$CONFFILE" ]; then
+		md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+		old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
+		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
+}
 
 # converting a directory to symlinks during package upgrade doesn't work,
 # lets remove the junk in here by hand
@@ -9,6 +26,15 @@
     rm -r /usr/share/sgml/docbook/dtd/xml/[1-9]* || true
 fi
 
+# handle obsolete dbgenent.ent files, that are placed in /etc/sgml/docbook-xml
+# fixes bug #426058
+# 4.5: obsoletes 3.1.7
+if [ "$1" = remove ] || [ "$1" = upgrade ]; then
+	if dpkg --compare-versions "$2" lt "4.5"; then
+		rm_conffile "/etc/sgml/docbook-xml/3.1.7/dbgenent.ent"
+	fi
+fi
+
 # automatically generated debhelper commands
 #DEBHELPER#
 




More information about the debian-xml-sgml-commit mailing list