[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force SVN commit: rev 375 - trunk/debian



Author: branden
Date: 2003-08-07 16:59:48 -0500 (Thu, 07 Aug 2003)
New Revision: 375

Modified:
   trunk/debian/changelog
   trunk/debian/xserver-common.postinst.in
   trunk/debian/xserver-common.postrm.in
   trunk/debian/xserver-common.preinst.in
Log:
debian/xserver-common.{postinst,preinst}.in: use /var/lib/xfree86 for the
  checksum storage directory

debian/xserver-common.postrm.in:
  - on purge, remove the Xwrapper.config checksum file; remove
    Xwrapper.config as well, but only if it matches the stored checksum;
    remove checksum directory and parent directories of conffiles
    configuration files if possible
  - update copyright notice
  - set svn:keywords property to "Id" and add "$Id$" expando


Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	2003-08-07 18:22:26 UTC (rev 374)
+++ trunk/debian/changelog	2003-08-07 21:59:48 UTC (rev 375)
@@ -144,8 +144,8 @@
     - debian/xserver-common.config.in: stop asking the now-deleted questions
     - debian/xserver-common.preinst.in: when upgrading from xserver-common <<
       4.2.1-10, check value of xserver-common/manage_config_with_debconf; if
-      it is true; attempt to store md5sum of existing Xwrapper.config file;
-      unregister the now-deleted questions
+      it is true; attempt to store md5sum of existing Xwrapper.config file in
+      /var/lib/xfree86; unregister the now-deleted questions
     - debian/xserver-common.postinst.in: automatically update the
       Xwrapper.config file (based on the values of the debconf templates) if
       and only if:
@@ -155,13 +155,15 @@
         stored checksum (indicating that the file hasn't changed since we last
         touched it); and
       + the newly written file actually differs from the existing one
-    - debian/xserver-common.postrm.in: remove the /var/lib/xserver-common
-      directory and its contents on package purge
+    - debian/xserver-common.postrm.in: on purge, remove the Xwrapper.config
+      checksum file; remove Xwrapper.config as well, but only if it matches
+      the stored checksum; remove parent directories of conffiles and
+      configuration files if possible
     With luck, this new approach will meet with less anger and hatred from
     people who do not read fully-capitalized warnings within the files they
     are editing, let alone a manual page.
 
- -- Branden Robinson <branden@debian.org>  Wed,  6 Aug 2003 02:24:20 -0500
+ -- Branden Robinson <branden@debian.org>  Thu,  7 Aug 2003 16:16:50 -0500
 
 xfree86 (4.2.1-9) unstable; urgency=high
 

Modified: trunk/debian/xserver-common.postinst.in
==============================================================================
--- trunk/debian/xserver-common.postinst.in	2003-08-07 18:22:26 UTC (rev 374)
+++ trunk/debian/xserver-common.postinst.in	2003-08-07 21:59:48 UTC (rev 375)
@@ -15,7 +15,7 @@
 #INCLUDE_SHELL_LIB#
 
 XWRAPPER_CONFIG=/etc/X11/Xwrapper.config
-CHECKSUM_DIR="/var/lib/$THIS_PACKAGE"
+CHECKSUM_DIR=/var/lib/xfree86
 XWRAPPER_CONFIG_CHECKSUM="$CHECKSUM_DIR/$(basename "$XWRAPPER_CONFIG").md5sum"
 
 # source debconf library

Modified: trunk/debian/xserver-common.postrm.in
==============================================================================
--- trunk/debian/xserver-common.postrm.in	2003-08-07 18:22:26 UTC (rev 374)
+++ trunk/debian/xserver-common.postrm.in	2003-08-07 21:59:48 UTC (rev 375)
@@ -1,10 +1,12 @@
 #!/bin/sh
 # Debian xserver-common package post-removal script
-# Copyright 1998-2001 Branden Robinson.
+# Copyright 1998--2001, 2003 Branden Robinson.
 # Licensed under the GNU General Public License, version 2.  See the file
 # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
 # Acknowlegements to Stephen Early, Mark Eichin, and Manoj Srivastava.
 
+# $Id$
+
 set -e
 
 THIS_PACKAGE=xserver-common
@@ -12,6 +14,10 @@
 
 #INCLUDE_SHELL_LIB#
 
+XWRAPPER_CONFIG=/etc/X11/Xwrapper.config
+CHECKSUM_DIR=/var/lib/xfree86
+XWRAPPER_CONFIG_CHECKSUM="$CHECKSUM_DIR/$(basename "$XWRAPPER_CONFIG").md5sum"
+
 if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ]; then
   if [ -d /usr/X11R6/lib/X11/xserver.moved-by-preinst -a -L /usr/X11R6/lib/X11/xserver ]; then
     rm /usr/X11R6/lib/X11/xserver
@@ -19,16 +25,29 @@
   fi
 fi
 
-#DEBHELPER#
-
-exit 0
-
+# clean up non-conffile configuration files and related materials on purge
 if [ "$1" = "purge" ]; then
-  for DIR in /etc/X11/xserver "/var/lib/$THIS_PACKAGE"; do
-    if [ -d "$DIR" ]; then
-      rm -r "$DIR"
+  # remove Xwrapper.config if it was still managed by the package, and remove
+  # the checksum file in any case
+  if [ -e "$XWRAPPER_CONFIG_CHECKSUM" ]; then
+    if [ -e "$XWRAPPER_CONFIG" ]; then
+      if [ "$(md5sum "$XWRAPPER_CONFIG")" \
+           = "$(cat "$XWRAPPER_CONFIG_CHECKSUM")" ]; then
+        rm -f "$XWRAPPER_CONFIG"
+      fi
     fi
+    rm -f "$XWRAPPER_CONFIG_CHECKSUM"
+  fi
+
+  # we can take /etc/X11/xserver out of this list one day when dpkg fixes
+  # #112386
+  for DIR in /etc/X11/xserver /etc/X11 "$CHECKSUM_DIR"; do
+      rmdir "$DIR" 2> /dev/null || true
   done
 fi
 
+#DEBHELPER#
+
+exit 0
+
 # vim:set ai et sts=2 sw=2 tw=0:

Modified: trunk/debian/xserver-common.preinst.in
==============================================================================
--- trunk/debian/xserver-common.preinst.in	2003-08-07 18:22:26 UTC (rev 374)
+++ trunk/debian/xserver-common.preinst.in	2003-08-07 21:59:48 UTC (rev 375)
@@ -15,7 +15,7 @@
 #INCLUDE_SHELL_LIB#
 
 XWRAPPER_CONFIG=/etc/X11/Xwrapper.config
-CHECKSUM_DIR="/var/lib/$THIS_PACKAGE"
+CHECKSUM_DIR=/var/lib/xfree86
 XWRAPPER_CONFIG_CHECKSUM="$CHECKSUM_DIR/$(basename "$XWRAPPER_CONFIG").md5sum"
 
 if [ "$1" = "install" -o "$1" = "upgrade" ]; then



Reply to: