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

X Strike Force X.Org X11 SVN commit: r1789 - trunk/debian/xorg/debian



Author: dnusinow
Date: 2006-04-14 01:39:31 -0400 (Fri, 14 Apr 2006)
New Revision: 1789

Modified:
   trunk/debian/xorg/debian/changelog
   trunk/debian/xorg/debian/xserver-xorg.preinst.in
Log:
  the xserver-xorg preinst. Properly handle the migration itself as well by
  using better variables in the mv command. Thanks Justin Pryzby.
  (closes: #331690)
* Similarly separate the md5sum for the server symlink from the roster. Also
  handle the case where the server symlink md5sum is removed but the symlink
  itself is in place. Here we just remake the md5sum using that symlink
  silently.

Modified: trunk/debian/xorg/debian/changelog
===================================================================
--- trunk/debian/xorg/debian/changelog	2006-04-14 03:54:25 UTC (rev 1788)
+++ trunk/debian/xorg/debian/changelog	2006-04-14 05:39:31 UTC (rev 1789)
@@ -33,9 +33,15 @@
   * Have xserver-xorg depend on xbase-clients
   * Ensure that config file md5sum gets migrated from /var/lib/xfree86 to
     /var/libx11. To do so, separate the test for it from the roster file in
-    the xserver-xorg preinst.
+    the xserver-xorg preinst. Properly handle the migration itself as well by
+    using better variables in the mv command. Thanks Justin Pryzby.
+    (closes: #331690)
+  * Similarly separate the md5sum for the server symlink from the roster. Also
+    handle the case where the server symlink md5sum is removed but the symlink
+    itself is in place. Here we just remake the md5sum using that symlink
+    silently.
 
- -- David Nusinow <dnusinow@debian.org>  Thu, 13 Apr 2006 23:50:33 -0400
+ -- David Nusinow <dnusinow@debian.org>  Fri, 14 Apr 2006 01:38:14 -0400
 
 xorg (1:7.0.10) unstable; urgency=low
 

Modified: trunk/debian/xorg/debian/xserver-xorg.preinst.in
===================================================================
--- trunk/debian/xorg/debian/xserver-xorg.preinst.in	2006-04-14 03:54:25 UTC (rev 1788)
+++ trunk/debian/xorg/debian/xserver-xorg.preinst.in	2006-04-14 05:39:31 UTC (rev 1789)
@@ -41,13 +41,21 @@
     fi
   done
 
+  # If this checksum got removed on upgrade for some reason, re-add it
+  if ! [ -e "$SERVER_SYMLINK_CHECKSUM" ]; then
+    message "Server symlink checksum doesn't exist. We need to make it"
+    if [ -L "$SERVER_SYMLINK" ] ; then
+      message "Re-adding lost server symlink checksum"
+      readlink "$SERVER_SYMLINK" | md5sum > "$SERVER_SYMLINK_CHECKSUM"
+    fi
+  fi
+
   # the transition from /var/lib/xfree86 to /var/lib/x11 occurred in
-  # 7.0.0-0ubuntu1
+  # 7.0.0-0ubuntu1 and 1:7.0.0
   if [ -n "$UPGRADE" ] && \
-     dpkg --compare-versions "$2" lt "1:7.0.11"; then
+     dpkg --compare-versions "$2" lt "1:7.0.12"; then
     if [ -e "/var/lib/xfree86" ]; then
-      if [ -e "/var/lib/xfree86/$SERVER_SYMLINK_ROSTER_BASE" ] && \
-         [ -e "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE" ]; then
+      if [ -e "/var/lib/xfree86/$SERVER_SYMLINK_ROSTER_BASE" ]; then
         if fgrep -qx "$THIS_PACKAGE" \
            "/var/lib/xfree86/$SERVER_SYMLINK_ROSTER_BASE"; then
           # construct temporary roster file with our package name removed, ignoring
@@ -66,18 +74,23 @@
             # no; remove both the original and our temporary copy
             rm -f "/var/lib/xfree86/$SERVER_SYMLINK_ROSTER_BASE" \
                   "/var/lib/xfree86/$SERVER_SYMLINK_ROSTER_BASE.dpkg-tmp"
-
-            # migrate the checksum if it doesn't exist
-            if [ -e "$SERVER_SYMLINK_CHECKSUM" ]; then
-              rm "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE"
-            else
-              mv "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE" \
-                 "$SERVER_SYMLINK_CHECKSUM"
-            fi
           fi
         fi
       fi
 
+      if [ -e "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE" ]; then
+        # migrate the checksum if it doesn't exist
+        if [ -e "$SERVER_SYMLINK_CHECKSUM" ]; then
+          message "Removing obsolete server symlink in /var/lib/xfree86"
+          rm "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE"
+        else
+          message "Migrating server symlink"
+          mv "/var/lib/xfree86/$SERVER_SYMLINK_CHECKSUM_BASE" \
+             "$CONFIG_AUX_DIR"
+        fi
+      fi
+
+
       if [ -e "/var/lib/xfree86/$XORGCONFIG_ROSTER_BASE" ]; then \
         if fgrep -qx "$THIS_PACKAGE" \
            "/var/lib/xfree86/$XORGCONFIG_ROSTER_BASE"; then
@@ -107,7 +120,8 @@
           rm "/var/lib/xfree86/$XORGCONFIG_CHECKSUM_BASE"
         else
           mv "/var/lib/xfree86/$XORGCONFIG_CHECKSUM_BASE" \
-             "$XORGCONFIG_CHECKSUM"
+             "$CONFIG_AUX_DIR" || \
+                error "Could not move the xorg.conf.md5sum for some reason"
         fi
       fi
 



Reply to: