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

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



Author: branden
Date: 2003-08-19 21:57:05 -0500 (Tue, 19 Aug 2003)
New Revision: 410

Modified:
   trunk/debian/xserver-xfree86.preinst.in
Log:
debian/xserver-xfree86.preinst.in: migration-from-debconf-"management"
  logic fixes:
  - remove redundant test for existence of X server symlink
  - base migration of existing X server symlink on the value of
    shared/default-x-server being the same as the package being upgraded,
    and the server symlink actually pointing to the server executable
    provided by the package; do not pay any attention to the value of
    shared/clobber_x-server_symlink
  - store the target of the X server symlink in a variable since we
    reference it more than once
  - don't show the user messages telling him we're not doing anything


Modified: trunk/debian/xserver-xfree86.preinst.in
===================================================================
--- trunk/debian/xserver-xfree86.preinst.in	2003-08-20 02:53:09 UTC (rev 409)
+++ trunk/debian/xserver-xfree86.preinst.in	2003-08-20 02:57:05 UTC (rev 410)
@@ -21,6 +21,7 @@
 CHECKSUM_DIR=/var/lib/xfree86
 SERVER_SYMLINK_CHECKSUM="$CHECKSUM_DIR/$(basename "$SERVER_SYMLINK").md5sum"
 XF86CONFIG_CHECKSUM="$CHECKSUM_DIR/$(basename "$XF86CONFIG").md5sum"
+THIS_SERVER=/usr/bin/X11/XFree86
 
 if [ "$1" = "install" -o "$1" = "upgrade" ]; then
   # if upgrading from < 4.2.1-10, migrate X server symlink and XF86Config-4
@@ -41,11 +42,14 @@
           # first, migrate the X server symlink
           if [ -e "$SERVER_SYMLINK" ]; then
             # attempt to pre-seed the md5sum file based on the current content
-            # of the file
-            db_get shared/clobber_x-server_symlink
-            if [ "$RET" = "true" ]; then
-              # if the config file doesn't even exist, don't bother
-              if [ -e "$SERVER_SYMLINK" ]; then
+            # of the file; first, is this package selected as the one
+            # containing the default X server?
+            db_get shared/default-x-server
+            if [ "$RET" = "$THIS_PACKAGE" ]; then
+              # next, does the symlink point to the server executable provided
+              # by this package?
+              CURRENT_SYMLINK_TARGET=$(readlink "$SERVER_SYMLINK")
+              if [ "$CURRENT_SYMLINK_TARGET" = "$THIS_SERVER" ]; then
                 # people were letting debconf "manage" the config file even
                 # though they complained when it did so, so store a backup to
                 # keep people quiet
@@ -53,12 +57,9 @@
                         "by debconf; backup stored in" \
                         "$SERVER_SYMLINK.dpkg-old and MD5 checksum stored in" \
                         "$SERVER_SYMLINK_CHECKSUM."
-                readlink "$SERVER_SYMLINK" | md5sum > "$SERVER_SYMLINK_CHECKSUM"
-                ln -s "$(readlink "$SERVER_SYMLINK")" "$SERVER_SYMLINK.dpkg-old"
+                echo "$CURRENT_SYMLINK_TARGET" | md5sum > "$SERVER_SYMLINK_CHECKSUM"
+                ln -s "$CURRENT_SYMLINK_TARGET" "$SERVER_SYMLINK.dpkg-old"
               fi
-            else
-              message "Note: not storing MD5 checksum of $SERVER_SYMLINK;" \
-                      "file not under management of debconf."
             fi
           fi
 
@@ -79,9 +80,6 @@
                 md5sum "$XF86CONFIG" > "$XF86CONFIG_CHECKSUM"
                 cp "$XF86CONFIG" "$XF86CONFIG.dpkg-old"
               fi
-            else
-              message "Note: not storing MD5 checksum of $XF86CONFIG; file" \
-                      "not under management of debconf."
             fi
           fi
 



Reply to: