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

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



Author: dnusinow
Date: 2006-04-17 02:40:35 -0400 (Mon, 17 Apr 2006)
New Revision: 1829

Modified:
   trunk/debian/xorg/debian/changelog
   trunk/debian/xorg/debian/xserver-xorg.config.in
Log:
* Grab discover_video function from xserver-xorg.config.in from 6.9. The
  discover2 support was dropped solely in favor of discover1. This caused
  people with discover installed instead of discover1 to have an error
  returning 64 on their xserver-xorg postinstall. Thanks to Daniele
  Venzano for the bug report. Thanks to Steve Gran and Steve Langasek for
  tracking this down. (closes: #362891)

Modified: trunk/debian/xorg/debian/changelog
===================================================================
--- trunk/debian/xorg/debian/changelog	2006-04-17 06:00:14 UTC (rev 1828)
+++ trunk/debian/xorg/debian/changelog	2006-04-17 06:40:35 UTC (rev 1829)
@@ -2,8 +2,14 @@
 
   * Add more versioned conflicts (libmotif-dev, motif-clients, xslideshow,
     xtrkcad). Thanks Steve Langasek.
+  * Grab discover_video function from xserver-xorg.config.in from 6.9. The
+    discover2 support was dropped solely in favor of discover1. This caused
+    people with discover installed instead of discover1 to have an error
+    returning 64 on their xserver-xorg postinstall. Thanks to Daniele
+    Venzano for the bug report. Thanks to Steve Gran and Steve Langasek for
+    tracking this down. (closes: #362891)
 
- -- David Nusinow <dnusinow@debian.org>  Mon, 17 Apr 2006 00:13:35 -0400
+ -- David Nusinow <dnusinow@debian.org>  Mon, 17 Apr 2006 02:10:50 -0400
 
 xorg (1:7.0.13) unstable; urgency=low
 

Modified: trunk/debian/xorg/debian/xserver-xorg.config.in
===================================================================
--- trunk/debian/xorg/debian/xserver-xorg.config.in	2006-04-17 06:00:14 UTC (rev 1828)
+++ trunk/debian/xorg/debian/xserver-xorg.config.in	2006-04-17 06:40:35 UTC (rev 1829)
@@ -59,14 +59,43 @@
 }
 
 discover_video () {
-  if which discover >/dev/null 2>&1; then
-    # must be Discover 1.x
-    DISCOVERED_VIDEO=$(discover --disable-all --enable=pci \
-                                --format="%V %M\t%S\t%D\n" video 2>/dev/null)
+  # wrapper for discover command that can distinguish Discover 1.x and 2.x
+
+  # Ugh, Discover 1.x didn't exit with nonzero status if given an unrecongized option!
+  # Double ugh!  Discover is crashy.  People blame X when it crashes (but then,
+  # people blame X when *anything* crashes).
+  DISCOVER_ERRORFILE=$(tempfile)
+  if DISCOVER_TEST=$(discover --version 2>>"$DISCOVER_ERRORFILE"); then
+    if expr "$DISCOVER_TEST" : 'discover 2.*' > /dev/null 2>&1; then
+      # Discover 2.x
+      # XXX: this is sort of nasty
+      VENDOR_MODEL_FILE=$(tempfile)
+      SERVER_FILE=$(tempfile)
+      DRIVER_FILE=$(tempfile)
+
+      CMD="discover --type-summary display"
+      eval $CMD >>$VENDOR_MODEL_FILE || debug_report_status "$CMD" "$?"
+      CMD="discover --data-path=xfree86/server/name \
+                    --data-version=${SOURCE_VERSION%-*} display"
+      eval $CMD >>$SERVER_FILE || debug_report_status "$CMD" "$?"
+      CMD="discover --data-path=xfree86/server/device/driver \
+                    --data-version=${SOURCE_VERSION%-*} display"
+      eval $CMD >>$DRIVER_FILE || debug_report_status "$CMD" "$?"
+
+      DISCOVERED_VIDEO=$(paste $VENDOR_MODEL_FILE $SERVER_FILE $DRIVER_FILE)
+      rm -f $VENDOR_MODEL_FILE $SERVER_FILE $DRIVER_FILE
+    else
+      # must be Discover 1.x
+      DISCOVERED_VIDEO=$(discover --disable=serial,parallel,usb,ide,scsi \
+                                  --format="%V %M\t%S\t%D\n" video 2>/dev/null)
+    fi
     echo "$DISCOVERED_VIDEO"
   else
-    warn "discover not found; video autodetection not available"
+    warn "cannot use discover; failed with error message:" \
+         "$(cat "$DISCOVER_ERRORFILE")"
   fi
+  rm "$DISCOVER_ERRORFILE" || warn "discover error file never created, or" \
+                                   "already removed"
 }
 
 validate_string_db_input () {



Reply to: