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

X Strike Force XFree86 SVN commit: r1746 - in trunk/debian: . local



Author: branden
Date: 2004-08-23 09:50:25 -0500 (Mon, 23 Aug 2004)
New Revision: 1746

Modified:
   trunk/debian/CHANGESETS
   trunk/debian/changelog
   trunk/debian/local/dexconf
   trunk/debian/local/dexconf.1
   trunk/debian/xserver-xfree86.postinst.in
Log:
Overhaul dexconf.
+ Drop support for XFree86 3.x X server format.
+ Drop support for -f, --format and -s, --stdout options.
+ Use exec and open file descriptor 4 for output, instead of repetitiously
  redirecting standard output to a file explicitly all the time.  We can't
  use fd 3 since debconf uses it.
+ Use here documents a little more, and printf a little less.
+ Put blank lines between XF86Config-4 sections so that the file is easier
  to read.
+ Overwrite the destination file instead of "mv"ing or "cp"ing it; this
  way it is never unlinked.  (The maintainer scripts implement enough
  paranoia already.)
+ Tidy up shell style.
+ Modernize dexconf(1) manual page to undocument obsolete options, replace
  the "FUTURE DIRECTIONS" section with "HISTORY", correct and update
  "DIAGNOSTICS" section, provide more cross-references, and put a newline
  at the end of every sentence in the document source (per the GNU Roff
  texinfo documentation).
+ Use -o instead of -s and redirection when invoking dexconf from
  xserver-xfree86's postinst script, since the -s option is no longer
  supported.
+ WARNING: xserver-xfree86{,-dbg} 4.3.0.dfsg.1-[56] are not compatible with
  this version of xserver-common, or planned future versions, due to the
  above-mentioned removal of dexconf's -s option.  At the same time,
  saying xserver-common 4.3.0.dfsg.1-7 conflicts: xserver-xfree86
  (<< 4.3.0.dfsg.1-7) and xserver-xfree86-dbg (<< 4.3.0.dfsg.1-7) is
  excessive because 4.3.0.dfsg.1-4 and earlier will work.  I have heard
  that stating such a conflict can make things difficult for apt's
  problem resolver (or even impossible, if in conjunction with enough
  other versioned dependency or conflicts), so the risk seems greater than
  the reward.  It's too bad we don't have a way to conflict on ranges that
  aren't bounded on either zero or infinity.  Given that 4.3.0.dfsg.1-[56]
  have never appeared even in sarge, I'm making this judgement call.  Any
  bugs about this will be closed with this changelog entry included,
  unless you can rebut my premises; i.e., "I am Jason Gunthorpe and I
  declare that apt can eat a stack of versioned conflicts like this for
  breakfast and still see the One True Upgrade Path!", or "You silly
  person, of *course* dpkg and apt accept 'Conflicts: (4.3.0.dfsg.1-4 <<)
  xserver-xfree86 (<< 4.3.0.dfsg.1-7)'!"


Modified: trunk/debian/CHANGESETS
===================================================================
--- trunk/debian/CHANGESETS	2004-08-22 04:46:19 UTC (rev 1745)
+++ trunk/debian/CHANGESETS	2004-08-23 14:50:25 UTC (rev 1746)
@@ -394,4 +394,45 @@
 xrestop package and utility.
     1745
 
+Overhaul dexconf.
++ Drop support for XFree86 3.x X server format.
++ Drop support for -f, --format and -s, --stdout options.
++ Use exec and open file descriptor 4 for output, instead of repetitiously
+  redirecting standard output to a file explicitly all the time.  We can't
+  use fd 3 since debconf uses it.
++ Use here documents a little more, and printf a little less.
++ Put blank lines between XF86Config-4 sections so that the file is easier
+  to read.
++ Overwrite the destination file instead of "mv"ing or "cp"ing it; this
+  way it is never unlinked.  (The maintainer scripts implement enough
+  paranoia already.)
++ Tidy up shell style.
++ Modernize dexconf(1) manual page to undocument obsolete options, replace
+  the "FUTURE DIRECTIONS" section with "HISTORY", correct and update
+  "DIAGNOSTICS" section, provide more cross-references, and put a newline
+  at the end of every sentence in the document source (per the GNU Roff
+  texinfo documentation).
++ Use -o instead of -s and redirection when invoking dexconf from
+  xserver-xfree86's postinst script, since the -s option is no longer
+  supported.
++ WARNING: xserver-xfree86{,-dbg} 4.3.0.dfsg.1-[56] are not compatible with
+  this version of xserver-common, or planned future versions, due to the
+  above-mentioned removal of dexconf's -s option.  At the same time,
+  saying xserver-common 4.3.0.dfsg.1-7 conflicts: xserver-xfree86
+  (<< 4.3.0.dfsg.1-7) and xserver-xfree86-dbg (<< 4.3.0.dfsg.1-7) is
+  excessive because 4.3.0.dfsg.1-4 and earlier will work.  I have heard
+  that stating such a conflict can make things difficult for apt's
+  problem resolver (or even impossible, if in conjunction with enough
+  other versioned dependency or conflicts), so the risk seems greater than
+  the reward.  It's too bad we don't have a way to conflict on ranges that
+  aren't bounded on either zero or infinity.  Given that 4.3.0.dfsg.1-[56]
+  have never appeared even in sarge, I'm making this judgement call.  Any
+  bugs about this will be closed with this changelog entry included,
+  unless you can rebut my premises; i.e., "I am Jason Gunthorpe and I
+  declare that apt can eat a stack of versioned conflicts like this for
+  breakfast and still see the One True Upgrade Path!", or "You silly
+  person, of *course* dpkg and apt accept 'Conflicts: (4.3.0.dfsg.1-4 <<)
+  xserver-xfree86 (<< 4.3.0.dfsg.1-7)'!"
+    1746
+
 vim:set ai et sts=4 sw=4 tw=80:

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-08-22 04:46:19 UTC (rev 1745)
+++ trunk/debian/changelog	2004-08-23 14:50:25 UTC (rev 1746)
@@ -302,6 +302,46 @@
     the procps utilities (he says it actually isn't).  Also add description of
     xrestop package and utility.
 
+  * Overhaul dexconf.
+    + Drop support for XFree86 3.x X server format.
+    + Drop support for -f, --format and -s, --stdout options.
+    + Use exec and open file descriptor 4 for output, instead of repetitiously
+      redirecting standard output to a file explicitly all the time.  We can't
+      use fd 3 since debconf uses it.
+    + Use here documents a little more, and printf a little less.
+    + Put blank lines between XF86Config-4 sections so that the file is easier
+      to read.
+    + Overwrite the destination file instead of "mv"ing or "cp"ing it; this
+      way it is never unlinked.  (The maintainer scripts implement enough
+      paranoia already.)
+    + Tidy up shell style.
+    + Modernize dexconf(1) manual page to undocument obsolete options, replace
+      the "FUTURE DIRECTIONS" section with "HISTORY", correct and update
+      "DIAGNOSTICS" section, provide more cross-references, and put a newline
+      at the end of every sentence in the document source (per the GNU Roff
+      texinfo documentation).
+    + Use -o instead of -s and redirection when invoking dexconf from
+      xserver-xfree86's postinst script, since the -s option is no longer
+      supported.
+    + WARNING: xserver-xfree86{,-dbg} 4.3.0.dfsg.1-[56] are not compatible with
+      this version of xserver-common, or planned future versions, due to the
+      above-mentioned removal of dexconf's -s option.  At the same time,
+      saying xserver-common 4.3.0.dfsg.1-7 conflicts: xserver-xfree86
+      (<< 4.3.0.dfsg.1-7) and xserver-xfree86-dbg (<< 4.3.0.dfsg.1-7) is
+      excessive because 4.3.0.dfsg.1-4 and earlier will work.  I have heard
+      that stating such a conflict can make things difficult for apt's
+      problem resolver (or even impossible, if in conjunction with enough
+      other versioned dependency or conflicts), so the risk seems greater than
+      the reward.  It's too bad we don't have a way to conflict on ranges that
+      aren't bounded on either zero or infinity.  Given that 4.3.0.dfsg.1-[56]
+      have never appeared even in sarge, I'm making this judgement call.  Any
+      bugs about this will be closed with this changelog entry included,
+      unless you can rebut my premises; i.e., "I am Jason Gunthorpe and I
+      declare that apt can eat a stack of versioned conflicts like this for
+      breakfast and still see the One True Upgrade Path!", or "You silly
+      person, of *course* dpkg and apt accept 'Conflicts: (4.3.0.dfsg.1-4 <<)
+      xserver-xfree86 (<< 4.3.0.dfsg.1-7)'!"
+
   Changes by Fabio M. Di Nitto and Branden Robinson:
 
   * Support building only the parts of the source tree needed by
@@ -343,7 +383,7 @@
     autodetection would cause the script to think it had detected one X server
     or XFree86 video driver instead ($(echo "" | wc -l) is "1", not "0").
 
- -- Branden Robinson <branden@debian.org>  Sat, 21 Aug 2004 23:44:33 -0500
+ -- Branden Robinson <branden@debian.org>  Mon, 23 Aug 2004 02:02:15 -0500
 
 xfree86 (4.3.0.dfsg.1-6) unstable; urgency=low
 

Modified: trunk/debian/local/dexconf
===================================================================
--- trunk/debian/local/dexconf	2004-08-22 04:46:19 UTC (rev 1745)
+++ trunk/debian/local/dexconf	2004-08-23 14:50:25 UTC (rev 1746)
@@ -1,12 +1,15 @@
 #!/bin/sh
 
-# dexconf: Debian X Configurator
+# $Id$
+
+# dexconf: Debian X server configuration file writer
 #
-# This tool is a backend which uses debconf database values.
+# This tool is a backend which uses debconf database values.  It writes an
+# XFree86 X server configuration file based on the information in the database.
 #
 # Author: Branden Robinson
 
-# Copyright 2000--2003 Progeny Linux Systems, Inc.
+# Copyright 2000--2004 Progeny Linux Systems, Inc.
 #
 # This is free software; you may redistribute it and/or modify
 # it under the terms of the GNU General Public License as
@@ -23,8 +26,6 @@
 # not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA 02111-1307 USA
 
-# $Id$
-
 set -e
 
 # source debconf library
@@ -32,24 +33,21 @@
 
 # display a usage message
 usage () {
-  cat << EOF
+  cat <<EOF
 Usage: $PROGNAME [OPTION ...]
   write an XFree86 X server configuration file based on debconf database values
 Options:
-  -f FORMAT, --format=FORMAT         write file in XFree86 FORMAT style (3 or 4)
   -h, --help                                 display this usage message and exit
   -o FILE, --output=FILE                        write configuration file to FILE
-  -s, --stdout                       write configuration file to standard output
 This help message is intended only as a quick reference.  For a description of
 the usage of $PROGNAME, see the $PROGNAME(1) manual page.
 EOF
-  :;
 }
 
 # the error-out function
 bomb () {
-  echo "$PROGNAME: $*" | fold -s -w "${COLUMNS:-80}" >&2
-  exit 1;
+  echo "$PROGNAME: error: $*" | fold -s -w "${COLUMNS:-80}" >&2
+  exit 1
 }
 
 # wrapper around db_get to ensure that the info we try to retrieve exists; it
@@ -57,22 +55,27 @@
 fetch () {
   db_get "$1" || true
   if [ -z "$RET" ]; then
-    ERRMSG="cannot generate configuration file; $1 not set.  Aborting.  Reconfigure the X server with \"dpkg-reconfigure"
+    ERRMSG="cannot generate configuration file; $1 not set.  Aborting."
+    ERRMSG="$ERRMSG  Reconfigure the X server with \"dpkg-reconfigure"
     if [ -n "$XSERVERPKG" ]; then
       ERRMSG="$ERRMSG $XSERVERPKG"
     fi
     ERRMSG="$ERRMSG\" to correct this problem."
     bomb "$ERRMSG"
-  fi;
+  fi
 }
 
+# convert a debconf comma-delimited list to a shell whitespace-delimited list
+list_convert () {
+  echo $(IFS=", "; set -- $RET; while [ $# -gt 0 ]; do echo \"$1\"; shift; done)
+}
+
 PROGNAME=${0##*/}
 SHOWHELP=
 EARLYEXIT=
-STDOUT=
 
-GETOPT_OUTPUT=$(getopt --options f:ho:s \
-                       --longoptions format:,help,output:,stdout \
+GETOPT_OUTPUT=$(getopt --options ho: \
+                       --longoptions help,output: \
                        -n "$PROGNAME" -- "$@")
 
 if [ $? -ne 0 ]; then
@@ -83,12 +86,15 @@
 
 while :; do
     case "$1" in
-        -f|--format) FORMAT="$2"; shift ;;
+        -f|--format)
+          bomb "This option, and XFree86 3.x output, are no longer supported."
+          ;;
         -h|--help) SHOWHELP=yes EARLYEXIT=yes ;;
         -o|--output) XF86CONFIG="$2"; shift ;;
-        -s|--stdout) STDOUT=yes ;;
         --) shift; break ;;
-        *) bomb "error while parsing options; use \"$PROGNAME --help\" for help" ;;
+        *)
+          bomb "unrecognized option \"$1\"; use \"$PROGNAME --help\" for help"
+          ;;
     esac
     shift
 done
@@ -103,36 +109,36 @@
 
 DEXCONFTMPDIR=
 
-trap 'rm -rf "$DEXCONFTMPDIR"; \
+trap 'if [ -e "$DEXCONFTMPDIR/backup" ] && [ -n "$XF86CONFIG" ]; then \
+        cat "$DEXCONFTMPDIR/backup" >"$XF86CONFIG"; \
       fi; \
-      bomb "received signal; aborting."' HUP INT QUIT TERM
+      rm -rf "$DEXCONFTMPDIR"; \
+      bomb "received signal; aborting"' HUP INT QUIT TERM
 
-# which file and format are we using?
+# Ensure we know how to write a configuation file for the X server in use.
 fetch shared/default-x-server
 XSERVERPKG="$RET"
 case "$XSERVERPKG" in
-  xserver-3dlabs|xserver-8514|xserver-agx|xserver-fbdev|xserver-i128|xserver-mach32|xserver-mach64|xserver-mach8|xserver-mono|xserver-p9000|xserver-s3|xserver-s3v|xserver-svga|xserver-tga|xserver-vga16|xserver-w32)
-    : ${FORMAT:=3}
-    : ${XF86CONFIG:=/etc/X11/XF86Config}
-    ;;
   xserver-xfree86|xserver-xfree86-dbg)
-    : ${FORMAT:=4}
     : ${XF86CONFIG:=/etc/X11/XF86Config-4}
     ;;
   *)
-    bomb "this program does not know how to configure the \"$XSERVERPKG\" X server."
+    bomb "this program does not know how to configure the \"$XSERVERPKG\" X" \
+      "server"
 esac
 
-# setup temp dir
+# Set up a temporary directory for the files we'll be writing.
 TDIR_PARENT="${TMPDIR:-/tmp}"
 TDIR="${TMPDIR:-/tmp}/dexconf-tmp-$$"
 
 if [ ! -d "$TDIR_PARENT" ]; then
-  bomb "cannot create temporary work directory; \"$TDIR_PARENT\" does not exist or is not a directory."
+  bomb "cannot create temporary work directory; \"$TDIR_PARENT\" does not" \
+    "exist or is not a directory"
 fi
 
 if [ ! -w "$TDIR_PARENT" ]; then
-  bomb "cannot create temporary work directory in \"$TDIR_PARENT\"; directory not writable."
+  bomb "cannot create temporary work directory in \"$TDIR_PARENT\"; directory" \
+    "not writable"
 fi
 
 rm -rf "$TDIR"
@@ -140,58 +146,31 @@
 if mkdir -m 0700 "$TDIR"; then
   DEXCONFTMPDIR="$TDIR"
 else
-  bomb "creation of temporary work directory \"$TDIR\" failed."
+  bomb "creation of temporary work directory \"$TDIR\" failed"
 fi
 
-# Format 3:
-#        Files         File pathnames
-#        Module        Dynamic module loading
-#        ServerFlags   Server flags                          NOT USED BY DEXCONF
-#        Keyboard      Keyboard configuration
-#        Pointer       Pointer configuration
-#        Monitor       Monitor description
-#        Device        Graphics device description
-#        Screen        Screen configuration
-#        XInput        Extended input device configuration   NOT USED BY DEXCONF
+# XF86Config-4 sections:
+#   Files          File pathnames
+#   ServerFlags    Server flags                      NOT USED BY DEXCONF
+#   Module         Dynamic module loading
+#   InputDevice    Input device description
+#   Device         Graphics device description
+#   VideoAdaptor   Xv video adaptor description      NOT USED BY DEXCONF
+#   Monitor        Monitor description
+#   Modes          Video modes descriptions          NOT USED BY DEXCONF
+#   Screen         Screen configuration
+#   ServerLayout   Overall layout
+#   DRI            DRI-specific configuration
+#   Vendor         Vendor-specific configuration     NOT USED BY DEXCONF
 
-# Format 4:
-#           Files          File pathnames
-#           ServerFlags    Server flags                      NOT USED BY DEXCONF
-#           Module         Dynamic module loading
-#           InputDevice    Input device description
-#           Device         Graphics device description
-#           VideoAdaptor   Xv video adaptor description      NOT USED BY DEXCONF
-#           Monitor        Monitor description
-#           Modes          Video modes descriptions          NOT USED BY DEXCONF
-#           Screen         Screen configuration
-#           ServerLayout   Overall layout
-#           DRI            DRI-specific configuration
-#           Vendor         Vendor-specific configuration     NOT USED BY DEXCONF
-
 ### HEADER
 
-if [ "$FORMAT" = "3" ]; then
-  cat > "$DEXCONFTMPDIR/Header" << SECTION
-### BEGIN DEBCONF SECTION
-# XF86Config (XFree86 X Window System server configuration file)
-#
-# This file was generated by dexconf, the Debian X Configuration tool, using
-# values from the debconf database.
-#
-# Edit this file with caution, and see the XF86Config-v3 manual page.
-# (Type "man XF86Config-v3" at the shell prompt.)
-#
-# If you want your changes to this file preserved by dexconf, only make changes
-# before the "### BEGIN DEBCONF SECTION" line above, and/or after the
-# "### END DEBCONF SECTION" line below.
-#
-# To change things within the debconf section, run the command:
-#   dpkg-reconfigure $XSERVERPKG
-# as root.  Also see "How do I add custom sections to a dexconf-generated
-# XF86Config file?" in /usr/share/doc/xfree86-common/FAQ.gz.
-SECTION
-else
-  cat > "$DEXCONFTMPDIR/Header" << SECTION
+# Because debconf hijacks standard output and its confmodule uses file
+# descriptor 3 for its own purposes, we will write our output to file descriptor
+# 4 instead of standard output.
+
+exec 4>"$DEXCONFTMPDIR/Header"
+cat >&4 <<SECTION
 # XF86Config-4 (XFree86 X Window System server configuration file)
 #
 # This file was generated by dexconf, the Debian X Configuration tool, using
@@ -208,17 +187,16 @@
 # again, run the following commands as root:
 #
 #   cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.custom
-#   md5sum /etc/X11/XF86Config-4 > /var/lib/xfree86/XF86Config-4.md5sum
+#   md5sum /etc/X11/XF86Config-4 >/var/lib/xfree86/XF86Config-4.md5sum
 #   dpkg-reconfigure $XSERVERPKG
 SECTION
-fi
 
 ### FILES
 
-if [ "$FORMAT" = "3" ]; then
-  fetch shared/xfree86v3/config/write_files_section
-  if [ "$RET" = "true" ]; then
-    cat > "$DEXCONFTMPDIR/Files" << SECTION
+fetch xserver-xfree86/config/write_files_section
+if [ "$RET" = "true" ]; then
+  exec 4>"$DEXCONFTMPDIR/Files"
+  cat >&4 <<SECTION
 Section "Files"
 	FontPath	"unix/:7100"			# local font server
 	# if the local font server has problems, we can fall back on these
@@ -233,97 +211,38 @@
 	FontPath	"/usr/lib/X11/fonts/75dpi"
 EndSection
 SECTION
-  fi
-else
-  fetch xserver-xfree86/config/write_files_section
-  if [ "$RET" = "true" ]; then
-    cat > "$DEXCONFTMPDIR/Files" << SECTION
-Section "Files"
-	FontPath	"unix/:7100"			# local font server
-	# if the local font server has problems, we can fall back on these
-	FontPath	"/usr/lib/X11/fonts/misc"
-	FontPath	"/usr/lib/X11/fonts/cyrillic"
-	FontPath	"/usr/lib/X11/fonts/100dpi/:unscaled"
-	FontPath	"/usr/lib/X11/fonts/75dpi/:unscaled"
-	FontPath	"/usr/lib/X11/fonts/Type1"
-	FontPath	"/usr/lib/X11/fonts/CID"
-	FontPath	"/usr/lib/X11/fonts/Speedo"
-	FontPath	"/usr/lib/X11/fonts/100dpi"
-	FontPath	"/usr/lib/X11/fonts/75dpi"
-EndSection
-SECTION
-  fi
 fi
 
 ### MODULE
 
-if [ "$FORMAT" = "3" ]; then
-  # module list may be null
-  db_get shared/xfree86v3/config/modules || true
-  if [ -n "$RET" ]; then
-    # debconf doesn't return the list in the format we need
-    MODULES=$( echo $(IFS=", "; set -- $RET; while [ $# -gt 0 ]; do echo $1; shift; done) )
-    printf "Section \"Module\"\n" > "$DEXCONFTMPDIR/Module"
-    for MODULE in $MODULES; do
-      printf "\tLoad\t\"$MODULE.so\"\n" >> "$DEXCONFTMPDIR/Module"
-    done
-    printf "EndSection\n" >> "$DEXCONFTMPDIR/Module"
-  fi
-else
-  # module list may be null
-  db_get xserver-xfree86/config/modules || true
-  if [ -n "$RET" ]; then
-    # debconf doesn't return the list in the format we need
-    MODULES=$( echo $(IFS=", "; set -- $RET; while [ $# -gt 0 ]; do echo $1; shift; done) )
-    printf "Section \"Module\"\n" > "$DEXCONFTMPDIR/Module"
-    for MODULE in $MODULES; do
-      printf "\tLoad\t\"$MODULE\"\n" >> "$DEXCONFTMPDIR/Module"
-    done
-    printf "EndSection\n" >> "$DEXCONFTMPDIR/Module"
-  fi
+# The module list is permitted to be null.
+db_get xserver-xfree86/config/modules || true
+if [ -n "$RET" ]; then
+  MODULES=$(list_convert "$RET")
+  exec 4>"$DEXCONFTMPDIR/Module"
+  printf "Section \"Module\"\n" >&4
+  for MODULE in $MODULES; do
+    printf "\tLoad\t\"$MODULE\"\n" >&4
+  done
+  printf "EndSection\n" >&4
 fi
 
 ### KEYBOARD / INPUTDEVICE
 
-if [ "$FORMAT" = "3" ]; then
-  fetch shared/xfree86v3/config/inputdevice/keyboard/rules
-  XKB_RULES="$RET"
-  fetch shared/xfree86v3/config/inputdevice/keyboard/model
-  XKB_MODEL="$RET"
-  fetch shared/xfree86v3/config/inputdevice/keyboard/layout
-  XKB_LAYOUT="$RET"
-  # XkbVariant and XkbOptions are permitted to be null
-  db_get shared/xfree86v3/config/inputdevice/keyboard/variant
-  XKB_VARIANT="$RET"
-  db_get shared/xfree86v3/config/inputdevice/keyboard/options
-  XKB_OPTIONS="$RET"
-  cat > "$DEXCONFTMPDIR/InputDeviceKeyboard" << SECTION
-Section "Keyboard"
-	Protocol	"Standard"
-	XkbRules	"$XKB_RULES"
-	XkbModel	"$XKB_MODEL"
-	XkbLayout	"$XKB_LAYOUT"
-SECTION
-  if [ -n "$XKB_VARIANT" ]; then
-    printf "\tXkbVariant\t\"$XKB_VARIANT\"\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
-  fi
-  if [ -n "$XKB_OPTIONS" ]; then
-    printf "\tXkbOptions\t\"$XKB_OPTIONS\"\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
-else
-  fetch xserver-xfree86/config/inputdevice/keyboard/rules
-  XKB_RULES="$RET"
-  fetch xserver-xfree86/config/inputdevice/keyboard/model
-  XKB_MODEL="$RET"
-  fetch xserver-xfree86/config/inputdevice/keyboard/layout
-  XKB_LAYOUT="$RET"
-  # XkbVariant and XkbOptions are permitted to be null
-  db_get xserver-xfree86/config/inputdevice/keyboard/variant
-  XKB_VARIANT="$RET"
-  db_get xserver-xfree86/config/inputdevice/keyboard/options
-  XKB_OPTIONS="$RET"
-  cat > "$DEXCONFTMPDIR/InputDeviceKeyboard" << SECTION
+fetch xserver-xfree86/config/inputdevice/keyboard/rules
+XKB_RULES="$RET"
+fetch xserver-xfree86/config/inputdevice/keyboard/model
+XKB_MODEL="$RET"
+fetch xserver-xfree86/config/inputdevice/keyboard/layout
+XKB_LAYOUT="$RET"
+# XkbVariant and XkbOptions are permitted to be null.
+db_get xserver-xfree86/config/inputdevice/keyboard/variant
+XKB_VARIANT="$RET"
+db_get xserver-xfree86/config/inputdevice/keyboard/options
+XKB_OPTIONS="$RET"
+
+exec 4>"$DEXCONFTMPDIR/InputDeviceKeyboard"
+cat >&4 <<SECTION
 Section "InputDevice"
 	Identifier	"Generic Keyboard"
 	Driver		"keyboard"
@@ -332,488 +251,215 @@
 	Option		"XkbModel"	"$XKB_MODEL"
 	Option		"XkbLayout"	"$XKB_LAYOUT"
 SECTION
-  if [ -n "$XKB_VARIANT" ]; then
-    printf "\tOption\t\t\"XkbVariant\"\t\"$XKB_VARIANT\"\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
-  fi
-  if [ -n "$XKB_OPTIONS" ]; then
-    printf "\tOption\t\t\"XkbOptions\"\t\"$XKB_OPTIONS\"\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/InputDeviceKeyboard"
+if [ -n "$XKB_VARIANT" ]; then
+  printf "\tOption\t\t\"XkbVariant\"\t\"$XKB_VARIANT\"\n" >&4
 fi
+if [ -n "$XKB_OPTIONS" ]; then
+  printf "\tOption\t\t\"XkbOptions\"\t\"$XKB_OPTIONS\"\n" >&4
+fi
+printf "EndSection\n" >&4
 
 ### MOUSE / INPUTDEVICE
 
 DO_EMULATE3BUTTONS=
 DO_ZAXISMAPPING=
 
-if [ "$FORMAT" = "3" ]; then
-  fetch shared/xfree86v3/config/inputdevice/mouse/port
-  MOUSE_PORT="$RET"
-  fetch shared/xfree86v3/config/inputdevice/mouse/protocol
-  MOUSE_PROTOCOL="$RET"
-  fetch shared/xfree86v3/config/inputdevice/mouse/emulate3buttons
-  if [ "$RET" = "true" ]; then
-    DO_EMULATE3BUTTONS=true
-  fi
-  fetch shared/xfree86v3/config/inputdevice/mouse/zaxismapping
-  if [ "$RET" = "true" ]; then
-    DO_ZAXISMAPPING=true
-  fi
-  printf "Section \"Pointer\"\n" > "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tDevice\t\t\"$MOUSE_PORT\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tProtocol\t\"$MOUSE_PROTOCOL\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  if [ -n "$DO_EMULATE3BUTTONS" ]; then
-    printf "\tEmulate3Buttons\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  fi
-  if [ -n "$DO_ZAXISMAPPING" ]; then
-    printf "\tZAxisMapping\t4 5\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-else # $FORMAT == 4
-  fetch xserver-xfree86/config/inputdevice/mouse/port
-  MOUSE_PORT="$RET"
-  fetch xserver-xfree86/config/inputdevice/mouse/protocol
-  MOUSE_PROTOCOL="$RET"
-  fetch xserver-xfree86/config/inputdevice/mouse/emulate3buttons
-  if [ "$RET" = "true" ]; then
-    DO_EMULATE3BUTTONS=true
-  fi
-  fetch xserver-xfree86/config/inputdevice/mouse/zaxismapping
-  if [ "$RET" = "true" ]; then
-    DO_ZAXISMAPPING=true
-  fi
+fetch xserver-xfree86/config/inputdevice/mouse/port
+MOUSE_PORT="$RET"
+fetch xserver-xfree86/config/inputdevice/mouse/protocol
+MOUSE_PROTOCOL="$RET"
+fetch xserver-xfree86/config/inputdevice/mouse/emulate3buttons
+if [ "$RET" = "true" ]; then
+  DO_EMULATE3BUTTONS=true
+fi
+fetch xserver-xfree86/config/inputdevice/mouse/zaxismapping
+if [ "$RET" = "true" ]; then
+  DO_ZAXISMAPPING=true
+fi
 
-  printf "Section \"InputDevice\"\n" > "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tIdentifier\t\"Configured Mouse\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tDriver\t\t\"mouse\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tOption\t\t\"CorePointer\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tOption\t\t\"Device\"\t\t\"$MOUSE_PORT\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  printf "\tOption\t\t\"Protocol\"\t\t\"$MOUSE_PROTOCOL\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
+exec 4>"$DEXCONFTMPDIR/InputDeviceMouse"
+cat >&4 <<SECTION
+Section "InputDevice"
+	Identifier	"Configured Mouse"
+	Driver		"mouse"
+	Option		"CorePointer"
+	Option		"Device"		"$MOUSE_PORT"
+	Option		"Protocol"		"$MOUSE_PROTOCOL"
+SECTION
+if [ -n "$DO_EMULATE3BUTTONS" ]; then
+  printf "\tOption\t\t\"Emulate3Buttons\"\t\"true\"\n" >&4
+fi
+if [ -n "$DO_ZAXISMAPPING" ]; then
+  printf "\tOption\t\t\"ZAxisMapping\"\t\t\"4 5\"\n" >&4
+fi
+printf "EndSection\n" >&4
+
+# Only write this stanza -- designed for USB pointers -- if the Configured
+# Mouse isn't USB.  This isn't a problem even on systems without
+# CONFIG_INPUT_MOUSEDEV, because this is not the core pointer, and failure to
+# open it is not harmful.
+#
+# Also don't write this stanza if the Configured Mouse is the GPM repeater.
+# We have no way of knowing what device GPM is repeating for, and it might be
+# a USB mouse.
+if [ "$MOUSE_PORT" != "/dev/input/mice" ] \
+  && "$MOUSE_PORT" != "/dev/gpmdata" ]; then
+  cat >&4 <<SECTION
+Section "InputDevice"
+	Identifier	"Generic Mouse"
+	Driver		"mouse"
+	Option		"SendCoreEvents"	"true"
+	Option		"Device"		"/dev/input/mice"
+	Option		"Protocol"		"ImPS/2"
+SECTION
   if [ -n "$DO_EMULATE3BUTTONS" ]; then
-    printf "\tOption\t\t\"Emulate3Buttons\"\t\"true\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
+    printf "\tOption\t\t\"Emulate3Buttons\"\t\"true\"\n" >&4
   fi
   if [ -n "$DO_ZAXISMAPPING" ]; then
-    printf "\tOption\t\t\"ZAxisMapping\"\t\t\"4 5\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
+    printf "\tOption\t\t\"ZAxisMapping\"\t\t\"4 5\"\n" >&4
   fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-
-  # Only write this stanza -- designed for USB pointers -- if the Configured
-  # Mouse isn't USB.  This isn't a problem even on systems without
-  # CONFIG_INPUT_MOUSEDEV, because this is not the core pointer, and failure to
-  # open it is not harmful.
-  #
-  # Also don't write this stanza if the Configured Mouse is the GPM repeater.
-  # We have no way of knowing what device GPM is repeating for, and it might be
-  # a USB mouse.
-  if [ "$MOUSE_PORT" != "/dev/input/mice" -a "$MOUSE_PORT" != "/dev/gpmdata" ]; then
-    printf "\nSection \"InputDevice\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    printf "\tIdentifier\t\"Generic Mouse\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    printf "\tDriver\t\t\"mouse\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    printf "\tOption\t\t\"SendCoreEvents\"\t\"true\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    printf "\tOption\t\t\"Device\"\t\t\"/dev/input/mice\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    printf "\tOption\t\t\"Protocol\"\t\t\"ImPS/2\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    if [ -n "$DO_EMULATE3BUTTONS" ]; then
-      printf "\tOption\t\t\"Emulate3Buttons\"\t\"true\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    fi
-    if [ -n "$DO_ZAXISMAPPING" ]; then
-      printf "\tOption\t\t\"ZAxisMapping\"\t\t\"4 5\"\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-    fi
-    printf "EndSection\n" >> "$DEXCONFTMPDIR/InputDeviceMouse"
-  fi
+  printf "EndSection\n" >&4
 fi
 
 ### DEVICE
 
-if [ "$FORMAT" = "3" ]; then
-  fetch shared/xfree86v3/config/device/vendor
-  DEVICE_VENDOR="$RET"
-  fetch shared/xfree86v3/config/device/model
-  DEVICE_MODEL="$RET"
-  DEVICE_IDENTIFIER="$DEVICE_VENDOR $DEVICE_MODEL"
-  # VideoRam is permitted to be null
-  db_get shared/xfree86v3/config/device/video_ram
-  DEVICE_VIDEO_RAM="$RET"
-  printf "Section \"Device\"\n" > "$DEXCONFTMPDIR/Device"
-  printf "\tIdentifier\t\"$DEVICE_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Device"
-  printf "\tVendorName\t\"$DEVICE_VENDOR\"\n" >> "$DEXCONFTMPDIR/Device"
-  printf "\tBoardName\t\"$DEVICE_MODEL\"\n" >> "$DEXCONFTMPDIR/Device"
-  if [ -n "$DEVICE_VIDEO_RAM" ]; then
-     printf "\tVideoRam\t$DEVICE_VIDEO_RAM\n" >> "$DEXCONFTMPDIR/Device"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/Device"
-else # $FORMAT == 4
-  fetch xserver-xfree86/config/device/identifier
-  DEVICE_IDENTIFIER="$RET"
-  fetch xserver-xfree86/config/device/driver
-  DEVICE_DRIVER="$RET"
-  # BusID, VideoRam, and UseFBDev are permitted to be null
-  db_get xserver-xfree86/config/device/bus_id
-  DEVICE_BUSID="$RET"
-  db_get xserver-xfree86/config/device/video_ram
-  DEVICE_VIDEO_RAM="$RET"
-  db_get xserver-xfree86/config/device/use_fbdev
-  DEVICE_USE_FBDEV="$RET"
-  printf "Section \"Device\"\n" > "$DEXCONFTMPDIR/Device"
-  printf "\tIdentifier\t\"$DEVICE_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Device"
-  printf "\tDriver\t\t\"$DEVICE_DRIVER\"\n" >> "$DEXCONFTMPDIR/Device"
-  if [ -n "$DEVICE_BUSID" ]; then
-    printf "\tBusID\t\t\"$DEVICE_BUSID\"\n" >> "$DEXCONFTMPDIR/Device"
-  fi
-  if [ -n "$DEVICE_VIDEO_RAM" ]; then
-     printf "\tVideoRam\t$DEVICE_VIDEO_RAM\n" >> "$DEXCONFTMPDIR/Device"
-  fi
-  if [ "$DEVICE_USE_FBDEV" = "true" ]; then
-    printf "\tOption\t\t\"UseFBDev\"\t\t\"$DEVICE_USE_FBDEV\"\n" >> "$DEXCONFTMPDIR/Device"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/Device"
+fetch xserver-xfree86/config/device/identifier
+DEVICE_IDENTIFIER="$RET"
+fetch xserver-xfree86/config/device/driver
+DEVICE_DRIVER="$RET"
+# BusID, VideoRam, and UseFBDev are permitted to be null.
+db_get xserver-xfree86/config/device/bus_id
+DEVICE_BUSID="$RET"
+db_get xserver-xfree86/config/device/video_ram
+DEVICE_VIDEO_RAM="$RET"
+db_get xserver-xfree86/config/device/use_fbdev
+DEVICE_USE_FBDEV="$RET"
+exec 4>"$DEXCONFTMPDIR/Device"
+cat >&4 <<SECTION
+Section "Device"
+	Identifier	"$DEVICE_IDENTIFIER"
+	Driver		"$DEVICE_DRIVER"
+SECTION
+if [ -n "$DEVICE_BUSID" ]; then
+  printf "\tBusID\t\t\"$DEVICE_BUSID\"\n" >&4
 fi
+if [ -n "$DEVICE_VIDEO_RAM" ]; then
+   printf "\tVideoRam\t$DEVICE_VIDEO_RAM\n" >&4
+fi
+if [ "$DEVICE_USE_FBDEV" = "true" ]; then
+  printf "\tOption\t\t\"UseFBDev\"\t\t\"$DEVICE_USE_FBDEV\"\n" >&4
+fi
+printf "EndSection\n" >&4
 
 ### MONITOR
 
-if [ "$FORMAT" = "3" ]; then
-  fetch shared/xfree86v3/config/monitor/vendor
-  MONITOR_VENDOR="$RET"
-  fetch shared/xfree86v3/config/monitor/model
-  MONITOR_MODEL="$RET"
-  MONITOR_IDENTIFIER="$MONITOR_VENDOR $MONITOR_MODEL"
-  fetch shared/xfree86v3/config/monitor/horiz-sync
-  MONITOR_HORIZ_SYNC="$RET"
-  fetch shared/xfree86v3/config/monitor/vert-refresh
-  MONITOR_VERT_REFRESH="$RET"
-  cat > "$DEXCONFTMPDIR/Monitor" << SECTION
+fetch xserver-xfree86/config/monitor/identifier
+MONITOR_IDENTIFIER="$RET"
+fetch xserver-xfree86/config/monitor/horiz-sync
+MONITOR_HORIZ_SYNC="$RET"
+fetch xserver-xfree86/config/monitor/vert-refresh
+MONITOR_VERT_REFRESH="$RET"
+exec 4>"$DEXCONFTMPDIR/Monitor"
+cat >&4 <<SECTION
 Section "Monitor"
 	Identifier	"$MONITOR_IDENTIFIER"
-	VendorName	"$MONITOR_VENDOR"
-	ModelName	"$MONITOR_MODEL"
 	HorizSync	$MONITOR_HORIZ_SYNC
 	VertRefresh	$MONITOR_VERT_REFRESH
-# 640x350 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "640x350"    31.5  640  672  736  832    350  382  385  445 +hsync -vsync
-
-# 640x400 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "640x400"    31.5  640  672  736  832    400  401  404  445 -hsync +vsync
-
-# 720x400 @ 85Hz (VESA) hsync: 37.9kHz
-ModeLine "720x400"    35.5  720  756  828  936    400  401  404  446 -hsync +vsync
-
-# 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
-ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
-
-# 640x480 @ 72Hz (VESA) hsync: 37.9kHz
-ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
-
-# 640x480 @ 75Hz (VESA) hsync: 37.5kHz
-ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
-
-# 640x480 @ 85Hz (VESA) hsync: 43.3kHz
-ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
-
-# 800x600 @ 56Hz (VESA) hsync: 35.2kHz
-ModeLine "800x600"    36.0  800  824  896 1024    600  601  603  625 +hsync +vsync
-
-# 800x600 @ 60Hz (VESA) hsync: 37.9kHz
-ModeLine "800x600"    40.0  800  840  968 1056    600  601  605  628 +hsync +vsync
-
-# 800x600 @ 72Hz (VESA) hsync: 48.1kHz
-ModeLine "800x600"    50.0  800  856  976 1040    600  637  643  666 +hsync +vsync
-
-# 800x600 @ 75Hz (VESA) hsync: 46.9kHz
-ModeLine "800x600"    49.5  800  816  896 1056    600  601  604  625 +hsync +vsync
-
-# 800x600 @ 85Hz (VESA) hsync: 53.7kHz
-ModeLine "800x600"    56.3  800  832  896 1048    600  601  604  631 +hsync +vsync
-
-# 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz
-ModeLine "1024x768"   44.9 1024 1032 1208 1264    768  768  776  817 +hsync +vsync Interlace
-
-# 1024x768 @ 60Hz (VESA) hsync: 48.4kHz
-ModeLine "1024x768"   65.0 1024 1048 1184 1344    768  771  777  806 -hsync -vsync
-
-# 1024x768 @ 70Hz (VESA) hsync: 56.5kHz
-ModeLine "1024x768"   75.0 1024 1048 1184 1328    768  771  777  806 -hsync -vsync
-
-# 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
-ModeLine "1024x768"   78.8 1024 1040 1136 1312    768  769  772  800 +hsync +vsync
-
-# 1024x768 @ 85Hz (VESA) hsync: 68.7kHz
-ModeLine "1024x768"   94.5 1024 1072 1168 1376    768  769  772  808 +hsync +vsync
-
-# 1152x864 @ 75Hz (VESA) hsync: 67.5kHz
-ModeLine "1152x864"  108.0 1152 1216 1344 1600    864  865  868  900 +hsync +vsync
-
-# 1280x960 @ 60Hz (VESA) hsync: 60.0kHz
-ModeLine "1280x960"  108.0 1280 1376 1488 1800    960  961  964 1000 +hsync +vsync
-
-# 1280x960 @ 85Hz (VESA) hsync: 85.9kHz
-ModeLine "1280x960"  148.5 1280 1344 1504 1728    960  961  964 1011 +hsync +vsync
-
-# 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz
-ModeLine "1280x1024" 108.0 1280 1328 1440 1688   1024 1025 1028 1066 +hsync +vsync
-
-# 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz
-ModeLine "1280x1024" 135.0 1280 1296 1440 1688   1024 1025 1028 1066 +hsync +vsync
-
-# 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz
-ModeLine "1280x1024" 157.5 1280 1344 1504 1728   1024 1025 1028 1072 +hsync +vsync
-
-# 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz
-ModeLine "1600x1200" 162.0 1600 1664 1856 2160   1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz
-ModeLine "1600x1200" 175.5 1600 1664 1856 2160   1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz
-ModeLine "1600x1200" 189.0 1600 1664 1856 2160   1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz
-ModeLine "1600x1200" 202.5 1600 1664 1856 2160   1200 1201 1204 1250 +hsync +vsync
-
-# 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz
-ModeLine "1600x1200" 229.5 1600 1664 1856 2160   1200 1201 1204 1250 +hsync +vsync
-
-# 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz
-ModeLine "1792x1344" 204.8 1792 1920 2120 2448   1344 1345 1348 1394 -hsync +vsync
-
-# 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz
-ModeLine "1792x1344" 261.0 1792 1888 2104 2456   1344 1345 1348 1417 -hsync +vsync
-
-# 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz
-ModeLine "1856x1392" 218.3 1856 1952 2176 2528   1392 1393 1396 1439 -hsync +vsync
-
-# 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz
-ModeLine "1856x1392" 288.0 1856 1984 2208 2560   1392 1393 1396 1500 -hsync +vsync
-
-# 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz
-ModeLine "1920x1440" 234.0 1920 2048 2256 2600   1440 1441 1444 1500 -hsync +vsync
-
-# 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz
-ModeLine "1920x1440" 297.0 1920 2064 2288 2640   1440 1441 1444 1500 -hsync +vsync
-
-# 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz
-ModeLine "832x624" 57.284 832  864  928 1152  624  625  628  667 -Hsync -Vsync
-
-# 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz
-ModeLine "1152x768"   64.995 1152 1178 1314 1472  768  771  777  806 +hsync +vsync
-
-# 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz
-ModeLine "1400x1050" 122.0 1400 1488 1640 1880   1050 1052 1064 1082 +hsync +vsync
-
-# 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz
-ModeLine "1400x1050" 155.8 1400 1464 1784 1912   1050 1052 1064 1090 +hsync +vsync
-
-# 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz
-Modeline "1600x1024" 106.910 1600 1620 1640 1670 1024 1027 1030 1067 -hsync -vsync
-
-# 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz
-Modeline "1920x1440" 341.35  1920 2072 2288 2656  1440 1441 1444 1512 -hsync +vsync
-
-# 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz
-Modeline "2048x1536" 266.95  2048 2200 2424 2800  1536 1537 1540 1589 -hsync +vsync
-
-# 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz
-Modeline "2048x1536" 340.48  2048 2216 2440 2832  1536 1537 1540 1603 -hsync +vsync
-
-# 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz
-Modeline "2048x1536" 388.04  2048 2216 2440 2832  1536 1537 1540 1612 -hsync +vsync
+	Option		"DPMS"
 EndSection
 SECTION
-else # $FORMAT == 4
-  fetch xserver-xfree86/config/monitor/identifier
-  MONITOR_IDENTIFIER="$RET"
-  fetch xserver-xfree86/config/monitor/horiz-sync
-  MONITOR_HORIZ_SYNC="$RET"
-  fetch xserver-xfree86/config/monitor/vert-refresh
-  MONITOR_VERT_REFRESH="$RET"
-  printf "Section \"Monitor\"\n" > "$DEXCONFTMPDIR/Monitor"
-  printf "\tIdentifier\t\"$MONITOR_IDENTIFIER\"\n">> "$DEXCONFTMPDIR/Monitor"
-  printf "\tHorizSync\t$MONITOR_HORIZ_SYNC\n" >> "$DEXCONFTMPDIR/Monitor"
-  printf "\tVertRefresh\t$MONITOR_VERT_REFRESH\n" >> "$DEXCONFTMPDIR/Monitor"
-  printf "\tOption\t\t\"DPMS\"\n" >> "$DEXCONFTMPDIR/Monitor"
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/Monitor"
-fi
 
 ### SCREEN
 
-if [ "$FORMAT" = "3" ]; then
-  # mode list may be null
-  db_get shared/xfree86v3/config/display/modes
-  if [ -n "$RET" ]; then
-    # debconf doesn't return the list in the format we need
-    DISPLAY_MODES=$( echo $(IFS=", "; set -- $RET; while [ $# -gt 0 ]; do echo \"$1\"; shift; done) )
-  fi
-  fetch shared/xfree86v3/config/display/default_bpp
-  DISPLAY_DEFAULT_BPP="$RET"
-  for OLDDRIVER in Accel SVGA; do
-    printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    printf "\tDriver\t\t\t\"$OLDDRIVER\"\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    printf "\tDevice\t\t\t\"$DEVICE_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    printf "\tMonitor\t\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    printf "\tDefaultColorDepth\t$DISPLAY_DEFAULT_BPP\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    for BPP in 8 15 16 24 32; do
-      printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-      printf "\t\tDepth\t\t$BPP\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-      if [ -n "$DISPLAY_MODES" ]; then
-        printf "\t\tModes\t\t$DISPLAY_MODES\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-      fi
-      printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-    done
-    printf "EndSection\n" >> "$DEXCONFTMPDIR/Screen$OLDDRIVER"
-  done
-  # write out section for FBDev
-  printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/ScreenFBDev"
-  printf "\tDriver\t\t\t\"FBDev\"\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-  printf "\tMonitor\t\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-  printf "\tDefaultColorDepth\t$DISPLAY_DEFAULT_BPP\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-  for BPP in 8 15 16 24 32; do
-    printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-    printf "\t\tDepth\t\t$BPP\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-    printf "\t\tModes\t\t\"default\"\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-    printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-  done
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/ScreenFBDev"
-  # write out section for Mono
-  printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/ScreenMono"
-  printf "\tDriver\t\t\t\"Mono\"\n" >> "$DEXCONFTMPDIR/ScreenMono"
-  printf "\tMonitor\t\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/ScreenMono"
-  printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/ScreenMono"
-  printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/ScreenMono"
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/ScreenMono"
-  # write out section for VGA2
-  printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/ScreenVGA2"
-  printf "\tDriver\t\t\t\"VGA2\"\n" >> "$DEXCONFTMPDIR/ScreenVGA2"
-  printf "\tMonitor\t\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/ScreenVGA2"
-  printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/ScreenVGA2"
-  printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/ScreenVGA2"
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/ScreenVGA2"
-  # write out section for VGA16
-  printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/ScreenVGA16"
-  printf "\tDriver\t\t\t\"VGA16\"\n" >> "$DEXCONFTMPDIR/ScreenVGA16"
-  printf "\tMonitor\t\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/ScreenVGA16"
-  printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/ScreenVGA16"
-  printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/ScreenVGA16"
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/ScreenVGA16"
-else # $FORMAT == 4
-  # mode list may be null
-  db_get xserver-xfree86/config/display/modes
-  if [ -n "$RET" ]; then
-    # debconf doesn't return the list in the format we need
-    DISPLAY_MODES=$( echo $(IFS=", "; set -- $RET; while [ $# -gt 0 ]; do echo \"$1\"; shift; done) )
-  fi
-  fetch xserver-xfree86/config/display/default_depth
-  DISPLAY_DEFAULT_DEPTH="$RET"
-  printf "Section \"Screen\"\n" > "$DEXCONFTMPDIR/Screen"
-  printf "\tIdentifier\t\"Default Screen\"\n" >> "$DEXCONFTMPDIR/Screen"
-  printf "\tDevice\t\t\"$DEVICE_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Screen"
-  printf "\tMonitor\t\t\"$MONITOR_IDENTIFIER\"\n" >> "$DEXCONFTMPDIR/Screen"
-  printf "\tDefaultDepth\t$DISPLAY_DEFAULT_DEPTH\n" >> "$DEXCONFTMPDIR/Screen"
-  for DEPTH in 1 4 8 15 16 24; do
-    printf "\tSubSection \"Display\"\n" >> "$DEXCONFTMPDIR/Screen"
-    printf "\t\tDepth\t\t$DEPTH\n" >> "$DEXCONFTMPDIR/Screen"
-    if [ -n "$DISPLAY_MODES" ]; then
-      printf "\t\tModes\t\t$DISPLAY_MODES\n" >> "$DEXCONFTMPDIR/Screen"
-    fi
-    printf "\tEndSubSection\n" >> "$DEXCONFTMPDIR/Screen"
-  done
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/Screen"
+# The mode list is permitted to be null.
+db_get xserver-xfree86/config/display/modes
+if [ -n "$RET" ]; then
+  DISPLAY_MODES=$(list_convert "$RET")
 fi
+fetch xserver-xfree86/config/display/default_depth
+DISPLAY_DEFAULT_DEPTH="$RET"
+exec 4>"$DEXCONFTMPDIR/Screen"
+cat >&4 <<SECTION
+Section "Screen"
+	Identifier	"Default Screen"
+	Device		"$DEVICE_IDENTIFIER"
+	Monitor		"$MONITOR_IDENTIFIER"
+	DefaultDepth	$DISPLAY_DEFAULT_DEPTH
+SECTION
+for DEPTH in 1 4 8 15 16 24; do
+  printf "\tSubSection \"Display\"\n" >&4
+  printf "\t\tDepth\t\t$DEPTH\n" >&4
+  if [ -n "$DISPLAY_MODES" ]; then
+    printf "\t\tModes\t\t$DISPLAY_MODES\n" >&4
+  fi
+  printf "\tEndSubSection\n" >&4
+done
+printf "EndSection\n" >&4
 
 ### SERVERLAYOUT
 
-if [ "$FORMAT" = "4" ]; then
-  cat > "$DEXCONFTMPDIR/ServerLayout" << SECTION
+exec 4>"$DEXCONFTMPDIR/ServerLayout"
+cat >&4 <<SECTION
 Section "ServerLayout"
 	Identifier	"Default Layout"
 	Screen		"Default Screen"
 	InputDevice	"Generic Keyboard"
 	InputDevice	"Configured Mouse"
 SECTION
-  if [ "$MOUSE_PORT" != "/dev/input/mice" -a "$MOUSE_PORT" != "/dev/gpmdata" ]; then
-    printf "\tInputDevice\t\"Generic Mouse\"\n" >> "$DEXCONFTMPDIR/ServerLayout"
-  fi
-  printf "EndSection\n" >> "$DEXCONFTMPDIR/ServerLayout"
+if [ "$MOUSE_PORT" != "/dev/input/mice" ] \
+  && "$MOUSE_PORT" != "/dev/gpmdata" ]; then
+  printf "\tInputDevice\t\"Generic Mouse\"\n" >&4
 fi
+printf "EndSection\n" >&4
 
 ### DRI
 
-if [ "$FORMAT" = "4" ]; then
-  fetch xserver-xfree86/config/write_dri_section
-  if [ "$RET" = "true" ]; then
-    cat > "$DEXCONFTMPDIR/DRI" << SECTION
+fetch xserver-xfree86/config/write_dri_section
+if [ "$RET" = "true" ]; then
+  exec 4>"$DEXCONFTMPDIR/DRI"
+  cat >&4 <<SECTION
 Section "DRI"
 	Mode	0666
 EndSection
 SECTION
-  fi
 fi
 
-# all done, spit it out
+# Tell debconf to stop listening to us.
+db_stop
 
-if [ "$FORMAT" = "3" ]; then
-  for SECTION in Header Files Module InputDeviceKeyboard InputDeviceMouse \
-                 Monitor Device ScreenAccel ScreenFBDev ScreenSVGA ScreenMono \
-                 ScreenVGA2 ScreenVGA16; do
-    if [ -e "$DEXCONFTMPDIR/$SECTION" ]; then
-      cat "$DEXCONFTMPDIR/$SECTION" >> "$DEXCONFTMPDIR/dexconf-out"
-    fi
-  done
-else # $FORMAT == 4
-  for SECTION in Header Files Module InputDeviceKeyboard InputDeviceMouse \
-                 Device Monitor Screen ServerLayout DRI; do
-    if [ -e "$DEXCONFTMPDIR/$SECTION" ]; then
-      cat "$DEXCONFTMPDIR/$SECTION" >> "$DEXCONFTMPDIR/dexconf-out"
-    fi
-  done
-fi
+# Write the configuration file.  Put a blank line before every section we write
+# except the first.
 
-# XXX: when xfree86v3 has migrated to the new configuration style and declares
-# a conflict with xserver-common (<< 4.2.1-10); the following if block can die,
-# leaving only the simple part in its else clause to be executed
-# unconditionally
-if [ "$FORMAT" = "3" ]; then
-  printf "### END DEBCONF SECTION\n" >> "$DEXCONFTMPDIR/dexconf-out"
-  TMP="$DEXCONFTMPDIR/${XF86CONFIG##*/}"
-  if [ -e "$XF86CONFIG" ]; then
-    # are we "clobbering" the existing config file?
-    db_get shared/xfree86v3/move_existing_nondebconf_config
-    if [ "$RET" = "true" ]; then
-      # the config script copied the config file to a backup, so we can stomp all
-      # over the existing one now
-      cp "$DEXCONFTMPDIR/dexconf-out" "$TMP"
-    else
-      # update the config file in place; does the file have debconf markers in
-      # it?
-      if egrep -q '^### BEGIN DEBCONF SECTION' < "$XF86CONFIG" && \
-         egrep -q '^### END DEBCONF SECTION' < "$XF86CONFIG"; then
-        sed -n '/^### BEGIN DEBCONF SECTION/q;p' < "$XF86CONFIG" > "$TMP"
-        cat "$DEXCONFTMPDIR/dexconf-out" >> "$TMP"
-        sed '1,/^### END DEBCONF SECTION/d' < "$XF86CONFIG" >> "$TMP"
-      else
-        bomb "existing \"$XF86CONFIG\" file has missing or half-open debconf " \
-             "region; not writing X server configuration file."
-      fi
-    fi
-  else
-    cp "$DEXCONFTMPDIR/dexconf-out" "$TMP"
+OUTFILE="$DEXCONFTMPDIR/dexconf-out"
+umask 022
+: >"$OUTFILE"
+
+SPACER=
+for SECTION in Header Files Module InputDeviceKeyboard InputDeviceMouse \
+               Device Monitor Screen ServerLayout DRI; do
+  if [ -e "$DEXCONFTMPDIR/$SECTION" ]; then
+    eval $SPACER
+    cat "$DEXCONFTMPDIR/$SECTION" >>"$OUTFILE"
+    SPACER='echo "" >>"$OUTFILE"'
   fi
-  if [ -n "$STDOUT" ]; then
-    cat "$DEXCONFTMPDIR/dexconf-out"
-  else
-    if ! mv "$TMP" "$XF86CONFIG"; then
-      bomb "unable to write to \"$XF86CONFIG\"."
-    fi
-  fi
-else
-  if [ -n "$STDOUT" ]; then
-    cat "$DEXCONFTMPDIR/dexconf-out"
-  else
-    if ! mv "$DEXCONFTMPDIR/dexconf-out" "$XF86CONFIG"; then
-      bomb "unable to write to \"$XF86CONFIG\"."
-    fi
-  fi
+done
+
+# Ensure we can write to our destination.
+if [ ! -w "$XF86CONFIG" ]; then
+  bomb "unable to write to \"$XF86CONFIG\""
 fi
 
+# Create a backup of the existing configuration file.
+cat "$XF86CONFIG" >"$DEXCONFTMPDIR/backup"
+
+# Move the new file into place.
+if ! cat "$OUTFILE" >"$XF86CONFIG"; then
+  # Failed; try to restore the backup.
+  cat "$DEXCONFTMPDIR/backup" >"$XF86CONFIG"
+fi
+
 rm -rf "$DEXCONFTMPDIR"
 
 exit 0
 
-# vim:ai:et:sts=2:sw=2:tw=0:
+# vim:set ai et sts=2 sw=2 tw=80:

Modified: trunk/debian/local/dexconf.1
===================================================================
--- trunk/debian/local/dexconf.1	2004-08-22 04:46:19 UTC (rev 1745)
+++ trunk/debian/local/dexconf.1	2004-08-23 14:50:25 UTC (rev 1746)
@@ -1,4 +1,5 @@
-.\" This manpage is copyright (C) 2000, 2001, 2003 Progeny Linux Systems, Inc.
+.\" This manpage is copyright (C) 2000, 2001, 2003, 2004 Progeny Linux
+.\" Systems, Inc.
 .\" Author: Branden Robinson <branden@progeny.com>
 .\"
 .\" $Id$
@@ -17,9 +18,9 @@
 .\" the Debian operating system, in /usr/share/common-licenses/GPL;  if
 .\" not, write to the Free Software Foundation, Inc., 59 Temple Place,
 .\" Suite 330, Boston, MA 02111-1307 USA
-.TH dexconf 1 "2004\-06\-03" "Debian Project"
+.TH dexconf 1 "2004\-08\-21" "Debian Project"
 .SH NAME
-dexconf \- generate XFree86 X server configuration file from debconf database values
+dexconf \- generate XFree86 X server configuration file from debconf data
 .SH SYNOPSIS
 .B dexconf
 [
@@ -27,114 +28,82 @@
 ]
 .SH DESCRIPTION
 .B dexconf
-retrieves values from debconf's database and uses them to build an
-XF86Config or XF86Config\-4 (depending on the default X server selected)
+retrieves values from
+.BR debconf (7)'s
+database and uses them to build an
+.I XF86Config\-4
 file.
 .PP
 The information that
 .B dexconf
 uses is typically entered via a debconf frontend (or possibly in part by
-hardware autodetection tools).  Note that
+hardware autodetection tools).
+Note that
 .B dexconf
 itself does
 .I not
-set any values in the debconf database; it only retrieves them.  If
-configuration parameters of the debconf database need to be changed,
+set any values in the debconf database; it only retrieves them.
+If configuration parameters of the debconf database need to be changed,
 .BR dpkg\-reconfigure (8)
 should be used to do so.
 .PP
 It is also important to note that
 .BR dexconf ,
 and the corresponding debconf questions whose answers it retrieves, are not
-intended to replace a full\-featured X server configuration tool; that is
-the province of
+intended to replace a full\-featured XFree86 X server configuration tool;
+that is the province of
 .BR xf86cfg (1),
-currently under development by the XFree86 Project, Inc.  In the meantime,
-however, users inexperienced with the syntax of the XF86Config (or
-XF86Config\-4) file may use
+currently under development by the XFree86 Project, Inc.
+In the meantime, however, users inexperienced with the syntax of the
+.I XF86Config\-4
+file may use
 .B dexconf
-to generate the X server configuration file with a minimal amount of
-detailed knowledge of their hardware characteristics.
+to generate the XFree86 X server configuration file with a minimal amount
+of detailed knowledge of their hardware characteristics.
 .PP
 More experienced users should feel free to use
 .BR dexconf \-generated
 configuration files as a starting point for their customizations, since
 individual preferences vary greatly.
-.PP
-.B dexconf
-decides which file (XF86Config or XF86Config\-4) to generate based upon the
-name of the default X server (a debconf question).
-.PP
-When updating an XF86Config file (for an XFree86 3.x X server),
-.B dexconf
-writes only to the area between
-.RS
-.B ### BEGIN DEBCONF SECTION
-.RE
-and
-.RS
-.B ### END DEBCONF SECTION
-.RE
-in the configuration file.  Anything outside this region is preserved.  If
-either or both of the above marker lines is missing,
-.B dexconf
-will exit with an error (see the diagnostics section below).
-.PP
-When updating an XF86Config\-4 file (for the XFree86 4.x X server),
-.B
-.B dexconf
-will unconditionally overwrite
-.I /etc/X11/XF86Config\-4
-(or the file specified by the
-.B \-o
-option) if it has sufficient access rights to do so.  This behavior will
-become the default for XF86Config files as well; see the \(oqFUTURE
-DIRECTIONS\(cq section below.
 .SH OPTIONS
 .TP
-.BI \-f\  version \fR,\fB\ \-\-format= version
-Write an X server configuration file in the format of XFree86
-.IR version .
-Note that attempting to write a configuration file in a format for which
-the debconf templates are missing or whose questions have not been answered
-will result in an error.
-.TP
 .B \-h\fR,\fB \-\-help
 Display a usage message and exit.
 .TP
 .BI \-o\  file \fR,\fB\ \-\-output= file
 By default,
 .B dexconf
-writes to the Debian default X server configuration file locations, which
-depend on the X server package being used (see the section on output files
-below).  This option instructs
+writes to
+.IR /etc/X11/XF86Config\-4 .
+This option instructs
 .B dexconf
 to write to
 .I file
 instead.
-.TP
-.B \-s\fR,\fB \-\-stdout
-Write the generated configuration file to standard output.
+Note that
+.B dexconf
+unconditionally overwrites its destination file if it has sufficient access
+rights to do so.
 .SH ENVIRONMENT
 .TP
 .B COLUMNS
 This variable is used to format diagnostic messages so that they fit the
-width of the terminal.  If not set, a terminal width of 80 columns is
-assumed.
+width of the terminal.
+If not set, a terminal width of 80 columns is assumed.
 .TP
 .B TMPDIR
 .B dexconf
 creates a subdirectory of the directory name stored in this variable, and
-uses that subdirectory as a scratch area.  If not set,
+uses that subdirectory as a scratch area.
+If not set,
 .I /tmp
 is used as the parent of the scratch directory.
 .SH OUTPUT FILES
 .TP
 .I /etc/X11/XF86Config\-4
-Configuration file for the XFree86 4.x X server.
-.TP
-.I /etc/X11/XF86Config
-Configuration file for XFree86 3.x X servers.
+Configuration file for the XFree86
+.RI 4. x
+X server.
 .SH DIAGNOSTICS
 .B dexconf
 produces several diagnostic messages if it encounters an error condition.
@@ -147,12 +116,13 @@
 .B dexconf
 follows.
 .TP
-.BI "argument " input " not understood"
-.B
-dexconf
-was given a command\-line option
-.RI ( input )
-it did not understand.  Use only the options documented.
+.B This option, and XFree86 3.x output, are no longer supported.
+.B dexconf
+no longer supports the
+.BR \-f ,
+.B \-\-format
+option.
+See the \(oqHISTORY\(cq section below.
 .TP
 .BI "cannot create temporary work directory; " dirname " does not exist or is not a directory"
 .B
@@ -160,7 +130,8 @@
 was unable to create a scratch directory to work in because the parent
 directory
 .RI ( dirname )
-was not does not exist or is not a directory.  Create
+was not does not exist or is not a directory.
+Create
 .I dirname
 and set its permissions properly, or set the
 .B TMPDIR
@@ -174,15 +145,16 @@
 .I dirname
 or set the
 .B TMPDIR
-environment variable to the of a writeable directior.
+environment variable to the of a writeable directory.
 .TP
 .BI "cannot generate configuration file; " question " not set"
 An answer to the indicated
 .I question
 was expected in the debconf database, but none was found.
 .B dexconf
-cannot write a valid configuration file without this information.  This
-problem can be rectified by reconfiguring the X server package with the
+cannot write a valid configuration file without this information.
+This problem can be rectified by reconfiguring the X server package with
+the
 .BR dpkg\-reconfigure (8)
 command.
 .TP
@@ -190,39 +162,39 @@
 .B dexconf
 was unable to create a scratch directory
 .RI ( dirname )
-to work in.  This diagnostic is only issued after
+to work in.
+This diagnostic is only issued after
 .B dexconf
 has checked to ensure that the parent directory of
 .I dirname
 is writable, and after the temporary directory to be used has been removed
-(if necessary).  This diagnostic message could indicate that something on
-the system is attempting to find or exploit security vulnerabilities in the
-temporary directory being used.
+(if necessary).
+This diagnostic message could indicate that something on the system is
+attempting to use a temporary\-file race condition to compromise the
+system's integrity.
 .TP
-.BI "existing " configfile " file has missing or half\-open debconf region; not writing X server configuration file"
-The
-.I configfile
-X server configuration file was not properly formatted for update by
-.BR dexconf .
+.B error while getting options
 .B dexconf
-refuses to write to files that have been edited in such a way that it
-appears that automatic updates are not desired.  Move the
-.I configfile
-out of the way or add the debconf \(oqregion markers\(cq as described
-above.
+received an error from
+.BR getopt (1)
+while attempting to interpret the command\-line arguments.
+Use only the documented options.
 .TP
-.B received signal
+.B received signal; aborting
 .B dexconf
 was sent a fatal signal; see the section on asynchronous events below.
 .TP
 .BI "this program does not know how to configure the " package " X server"
 .B dexconf
-only knows how to write configuration files for XFree86 version 3 and
-version 4 X servers.  The value of the
+only knows how to write configuration files for XFree86 version
+.RI 4. x
+X servers.
+The value of the
 .B shared/default\-x\-server
 debconf template was set to a package name that
 .B dexconf
-did not recognize.  A different tool will have to be used to configure the
+did not recognize.
+A different tool will have to be used to configure the
 selected X server, or
 .BR dpkg\-reconfigure (8)
 will have to be used to change the default X server.
@@ -231,7 +203,8 @@
 .B dexconf
 was unable to write to
 .I configfile
-because it lacked permissions to do so. Run
+because it lacked permissions to do so.
+Run
 .B dexconf
 as a user with permissions to write to
 .IR configfile,
@@ -240,6 +213,10 @@
 or
 .B \-\-output
 options.
+.TP
+.BI "unrecognized option " "option"
+An unrecongized option was specified.
+Use only the documented options.
 .SH "ASYNCHRONOUS EVENTS"
 .B dexconf
 traps the HUP, INT, QUIT, and TERM signals.
@@ -254,48 +231,68 @@
 1
 An error occurred, or
 .B dexconf
-was interrupted.  See the section on diagnostics above.
-.SH "FUTURE DIRECTIONS"
-The Debian XFree86 packages' method of maintaining their non-conffile
-configuration files (configuration files that are generated dynamically
-during package configuration, as opposed to unpacked to the filesystem as
-part of the package installation process) unfortunately proved to be too
-confusing for many users to tolerate.  Therefore, if the debconf database
-indicates that \(oqxserver\-xfree86\(cq or \(oqxserver\-xfree86\-dbg\(cq is
-the default X server,
+was interrupted.
+See the section on diagnostics above.
+.SH HISTORY
+Earlier versions of
 .B dexconf
-no longer cares about \(oqdebconf region markers\(cq, and will
-unconditionally overwrite the configuration file if the configuration
-file's permissions allow
-.B dexconf
-to do so.  The logic used by the \(oqxserver\-xfree86\(cq or
-\(oqxserver\-xfree86\-dbg\(cq package maintainer scripts attempts to make
-sure that user\-modified
-.I /etc/X11/XF86Config\-4
-files are not molested.  They do this by checking the MD5 checksum of the
-file every time the package is upgraded; if it has not changed since the
-last time the package was upgraded, the file is automatically updated if
-necessary and the new MD5 checksum stored.  Modifying the configuration
-file, deleting it, or deleting its MD5 checksum in
-.I /var/lib/xserver\-xfree86/XF86Config\-4.md5sum
-will cause the package maintainer scripts to bypass automatic update of the
-file, leaving the user's changes in place.
+supported an
+.BR \-f ,
+.B \-\-format
+option, but support for this option has been dropped along with support for
+XFree86
+.RI 3. x
+configuration files.
+The reasons for termination of XFree86
+.RI 3. x
+support are described in
+.IR "Debian X Window System Frequently Asked Questions" .
 .PP
-It is expected that the XFree86 3.x Debian packages will be updated to work
-the same way, but as of this writing they retain the previous behavior,
-which attempts to use \(oqdebconf markers\(cq to ascertain whether the
-.I /etc/X11/XF86Config
-file has been customized by the user.
+It is also worth noting that the \(oqdebconf section\(cq and \(oqmanage
+this file with debconf?\(cq approaches to handling the
+.I XF86Config\-4
+file on Debian systems which were in use from approximately versions
+4.0.1\-9 to 4.2.1\-9 of the
+.B xfree86
+Debian packages are no longer in use.
+For more information, see
+.IR "Debian X Window System Frequently Asked Questions" .
+.PP
+For a period prior to the release of Debian 3.1 (\(lqsarge\(rq),
+.B dexconf
+supported a
+.BR \-s ,
+.B \-\-stdout
+option which attempted to send the configuration file to standard output,
+but this was withdrawn because it was buggy (the output went to standard
+error instead), and it proved impractical to fix the bug due to
+.BR debconf 's
+creative handling of the standard output and standard error streams.
+If you need this functionality, use the
+.BR \-o ,
+.B \-\-output
+option.
+Note that using
+.I /dev/stdout
+as an option will not work for the same reason the
+.BR \-s ,
+.B \-\-stdout
+could not be implemented correctly in the first place.
+.I /dev/tty
+might not work either.
+It may be best to use a temporary file or known location.
 .SH AUTHOR
 .B dexconf
 was written by Branden Robinson for Progeny Linux Systems, Inc., and the
 Debian Project.
 .SH "SEE ALSO"
-.IR XF86Config (7),
-.IR XF86Config\-4 (5x),
-.IR XF86Config\-v3 (5x),
-.IR xf86cfg (1x),
-.IR dpkg\-reconfigure(8)
+.BR XF86Config\-4 (5x),
+.BR xf86cfg (1x),
+.BR dpkg\-reconfigure (8),
+.BR debconf (7)
+.PP
+.IR "Debian X Window System Frequently Asked Questions" :
+/usr/share/doc/xfree86\-common/FAQ.xhtml
 .\" OPERANDS
 .\" INPUT FILES
 .\" STDIN

Modified: trunk/debian/xserver-xfree86.postinst.in
===================================================================
--- trunk/debian/xserver-xfree86.postinst.in	2004-08-22 04:46:19 UTC (rev 1745)
+++ trunk/debian/xserver-xfree86.postinst.in	2004-08-23 14:50:25 UTC (rev 1746)
@@ -102,11 +102,10 @@
       # that's the way the user wants it
       if [ "$(md5sum "$XF86CONFIG")" = "$(cat "$XF86CONFIG_CHECKSUM")" ]; then
         # they match; prepare a new version of the config file
-        NEW_XF86CONFIG=$(tempfile)
-        if dexconf --stdout >>"$NEW_XF86CONFIG"; then
+        NEW_XF86CONFIG="$XF86CONFIG.dpkg-new"
+        if dexconf -o "$NEW_XF86CONFIG"; then
           if ! cmp -s "$XF86CONFIG" "$NEW_XF86CONFIG"; then
-            cp "$NEW_XF86CONFIG" "$XF86CONFIG.dpkg-new"
-            mv "$XF86CONFIG.dpkg-new" "$XF86CONFIG"
+            mv "$NEW_XF86CONFIG" "$XF86CONFIG"
             md5sum "$XF86CONFIG" > "$XF86CONFIG_CHECKSUM"
           fi
         else



Reply to: