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

xorg: Changes to 'debian-unstable'



 debian/changelog                |    3 
 debian/po/POTFILES.in           |    1 
 debian/xserver-xorg.postinst.in |  327 ----------------------------------------
 debian/xserver-xorg.templates   |   32 ---
 4 files changed, 8 insertions(+), 355 deletions(-)

New commits:
commit b388fd52a22a6ba9d402ff1b59326f9f61f95a41
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon May 25 15:22:57 2009 +0200

    Get rid of the remaining xserver-xorg debconf question (Bus ID).
    
    Detection of the primary device should happen in the kernel and/or X
    server.  With this change, we don't generate any xorg.conf anymore.

diff --git a/debian/changelog b/debian/changelog
index 6e235f9..5bfb609 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,9 @@ xorg (1:7.4+2) UNRELEASED; urgency=low
     correctly.
   * Mention the requirement for a CONFIG_INPUT_EVDEV-enabled kernel in
     xserver-xorg.NEWS.
+  * Get rid of the remaining xserver-xorg debconf question (Bus ID).
+    Detection of the primary device should happen in the kernel and/or X
+    server.  With this change, we don't generate any xorg.conf anymore.
 
   [ Debconf translations ]
   * Bengali added
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
index f9eebe3..0116585 100644
--- a/debian/po/POTFILES.in
+++ b/debian/po/POTFILES.in
@@ -1,2 +1 @@
-[type: gettext/rfc822deb] xserver-xorg.templates
 [type: gettext/rfc822deb] x11-common.templates
diff --git a/debian/xserver-xorg.postinst.in b/debian/xserver-xorg.postinst.in
index 37c2c5f..3c01a09 100644
--- a/debian/xserver-xorg.postinst.in
+++ b/debian/xserver-xorg.postinst.in
@@ -20,12 +20,6 @@ if [ -e /etc/default/xorg ]; then
   . /etc/default/xorg
 fi
 
-if [ "x$XORG_CONFIG" = "xcustom" ]; then
-  # leave configuration alone
-  warn "not updating configuration as per \$XORG_CUSTOM"
-  exit 0
-fi
-
 # the error-out function
 bomb () {
   echo "$PROGNAME: error: $*" | fold -s -w "${COLUMNS:-80}" >&2
@@ -51,297 +45,13 @@ XORGCONFIG_CHECKSUM="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.md5sum"
 XORGCONFIG_ROSTER="$CONFIG_AUX_DIR/${XORGCONFIG##*/}.roster"
 THIS_SERVER=/usr/bin/Xorg
 
-MULTIHEAD=
-
-# get machine architecture
-ARCH=$(dpkg --print-installation-architecture)
-
 debug_report_status () {
   # Syntax: debug_report_status command exit_status
   debug_echo "$1 exited with status $2"
 }
 
-validate_bus_id_db_input () {
-  # Syntax: validate_bus_id_db_input priority template
-  #
-  # validate BusID input
-  if [ $# -ne 2 ]; then
-    echo "internal error: validate_bus_id_db_input() called with wrong number of arguments: $*" >&2
-    exit 1
-  fi
-  PRIORITY=$1
-  TEMPLATE=$2
-  db_get "$TEMPLATE"
-  SAFE="$RET"
-  set +e
-  while :; do
-    db_input "$PRIORITY" "$TEMPLATE"
-    # is the question going to be asked?
-    if [ $? -eq 30 ]; then
-      break # no; bail out of validation loop
-    fi
-    db_go
-    db_get "$TEMPLATE"
-    case "$RET" in
-      "")
-        # An empty string is valid.
-        break
-        ;;
-      PCI:*)
-        # Looks like a PCI bus ID specification; validate it.  (We can use &&
-        # outside a conditional here because of the "set +e" above.)
-        (expr "$RET" : "PCI:[0-9]\{1,3\}@[0-9]\{1,3\}:[0-9]\{1,3\}:[0-9]\{1,3\}$" >/dev/null 2>&1 \
-        || expr "$RET" : "PCI:[0-9]\{1,3\}:[0-9]\{1,3\}:[0-9]\{1,3\}$" >/dev/null 2>&1) \
-        && break
-        ;;
-      SBUS:*)
-        # Looks like an SBUS bus ID specification; validate it.  (We can use &&
-        # outside a conditional here because of the "set +e" above.)
-        #
-        # According to upstream (xf86ParseSbusBusString() in
-        # xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c):
-        #
-        # The format is assumed to be one of:
-        # * "fbN", e.g. "fb1", which means the device corresponding to /dev/fbN
-        # * "nameN", e.g. "cgsix0", which means Nth instance of card NAME
-        # * "/prompath", e.g. "/sbus@0,10001000/cgsix@3,0" which is
-        #   PROM pathname to the device.
-        #
-        # Well, okay.
-        #
-        # Accept any non-null sequence of lowercase letters followed by a
-        # non-null sequence of decimal digits.  This handles "fbN" and "nameN".
-        expr "$RET" : "SBUS:[a-z]\+[0-9]\+" >/dev/null 2>&1 && break
-        # Now for the PROM path.  I am lazy; accept a slash followed a non-null
-        # sequence of letters and commas, an at sign, a non-null sequence of
-        # hexadecimal digits, a comma, and another non-null sequence of
-        # hexadecimal digits.  Furthermore, accept multiple occurences of this
-        # entire sequence.  Whew.
-        expr "$RET" : "SBUS:\(/[A-Za-z,]\+@[0-9A-Fa-f]\+,[0-9A-Fa-f]\+\)\+$" \
-          >/dev/null 2>&1 && break
-        ;;
-      [0-9])
-        # Accept a simple decimal integer for legacy buses that haven't been
-        # properly implemented (e.g., for SGI Indigo2 XL).
-        break
-        ;;
-      *)
-    esac
-    # we only get to this point if the input was invalid; restore the known good
-    # value in case we are interrupted before the user provides a valid one
-    db_set "$TEMPLATE" "$SAFE"
-    db_fset "$TEMPLATE" seen false
-    # now show the user the error message
-    db_fset xserver-xorg/config/device/bus_id_error seen false
-    db_input critical xserver-xorg/config/device/bus_id_error
-    db_go
-  done
-  set -e
-}
-
-auto_answer () {
-  # Syntax: auto_answer input_command priority template default_answer
-  #
-  # Used to auto-answer questions that don't have reasonable defaults.  Some
-  # people insist on running the xserver-xorg config script with the
-  # non-interactive frontend.  For this to work, the debconf database will need
-  # to be pre-loaded with answers to several questions.  You have been
-  # warned...
-  if [ $# -ne 4 ]; then
-    echo "internal error: auto_answer() called with wrong number of arguments: $*" >&2
-    exit 1
-  fi
-  INPUT_COMMAND=$1
-  PRIORITY=$2
-  TEMPLATE=$3
-  DEFAULT_ANSWER=$4
-  set +e
-  debug_echo "auto_answer() \"$INPUT_COMMAND $PRIORITY $TEMPLATE\" with default \"$DEFAULT_ANSWER\""
-  db_fget "$TEMPLATE" seen
-  # are we re-configuring?
-  if [ -z "$FIRSTINST" ] && [ "$RET" = "true" ]; then
-    # yes, we are reconfiguring
-    db_get "$TEMPLATE"
-    debug_echo "auto_answer: (reconfiguring) preserving existing answer \"$RET\""
-  else
-    # not reconfiguring; has the question been seen before?
-    if [ "$RET" = "true" ]; then
-      db_get "$TEMPLATE"
-      debug_echo "auto_answer: (not reconfiguring) preserving existing answer \"$RET\""
-    else
-      debug_echo "auto_answer: auto-answering with \"$DEFAULT_ANSWER\""
-      db_set $TEMPLATE "$DEFAULT_ANSWER"
-    fi
-  fi
-  "$INPUT_COMMAND" "$PRIORITY" "$TEMPLATE"
-  if [ $? -eq 30 ]; then
-    debug_echo "auto_answer: $TEMPLATE is not being asked"
-  else
-    debug_echo "auto_answer: asking $TEMPLATE"
-  fi
-  set -e
-  db_go
-  db_get "$TEMPLATE"
-  debug_echo "auto_answer: $TEMPLATE is \"$RET\""
-}
-
-priority_ceil() {
-  # syntax: priority_ceil requested_priority
-  #
-  # Given a variable PRIORITY_CEILING and a "requested_priority" argument, echo
-  # a debconf priority string corresponding to the lesser of the two.
-
-  # Implementation note: a clever version of this could be done using "eval",
-  # or embedding a Perl script, but those would be more difficult to maintain.
-  # Better just to go the simple and stupid route.  Yes, I know this is not
-  # very efficient.
-
-  # Validate arguments.
-  if [ $# -ne 1 ]; then
-    debug_echo "priority_ceil() called with empty or bogus arguments \"$*\";" \
-               "assuming argument of \"low\""
-    _requested_priority=low
-  else
-    _requested_priority="$1"
-  fi
-
-  # If PRIORITY_CEILING is null or unset, it's same as not having one at all;
-  # the sky's the limit.  We use a locally scoped priority_ceiling variable
-  # because we don't want to affect the value of the global one.
-  _priority_ceiling=${PRIORITY_CEILING:-"critical"}
-
-  # Ensure the value of _priority_ceiling is reasonable.
-  if [ "$_priority_ceiling" != "critical" ] && \
-       [ "$_priority_ceiling" != "high" ] && \
-       [ "$_priority_ceiling" != "medium" ] && \
-       [ "$_priority_ceiling" != "low" ]; then
-    debug_echo "priority_ceil() called with bogus value of \$PRIORITY_CEILING" \
-               "\"$_priority_ceiling\"; treating as \"critical\""
-    _priority_ceiling=critical
-  fi
-
-  case "$_requested_priority" in
-    critical)
-      # This is the highest priority, so there is nowhere to go but down.
-      echo "$_priority_ceiling"
-      ;;
-    high)
-      case "$_priority_ceiling" in
-        critical)
-          echo "$_requested_priority"
-          ;;
-        high|medium|low)
-          echo "$_priority_ceiling"
-          ;;
-      esac
-      ;;
-    medium)
-      case "$_priority_ceiling" in
-        critical|high)
-          echo "$_requested_priority"
-          ;;
-        medium|low)
-          echo "$_priority_ceiling"
-          ;;
-      esac
-      ;;
-    low)
-      # This is the lowest priority, so we can't go any lower.
-      echo "$_requested_priority"
-      ;;
-    *)
-      debug_echo "priority_ceil() called with bogus argument" \
-                 "\"$_requested_priority\"; returning \"low\""
-      echo low
-      ;;
-  esac
-}
-
-# analyze arguments; used by auto_answer()
-if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
-  RECONFIGURE=true
-else
-  RECONFIGURE=
-fi
-
-if [ -z "$2" ]; then
-  FIRSTINST=yes
-fi
-
 debug_echo "Configuring $THIS_PACKAGE."
 
-if [ -n "$FIRSTINST" ] || [ -n "$RECONFIGURE" ]; then
-  # BusID
-  PRIORITY=low
-  DEFAULT=
-
-  if [ `lspci -n 2>/dev/null | grep ' 0300: '| wc -l` -gt 1 ]; then
-    MULTIHEAD=yes
-  fi
-
-  # Some PowerPCs need to be told where to find the video card even if there is
-  # only one in the machine (broken PCI bus code in the XFree86 X server, most
-  # likely).  If there are multiple video cards, we need to configure one as the
-  # primary head.
-  if [ "$ARCH" = "powerpc" ] || [ "$MULTIHEAD" = "yes" ]; then
-    PRIORITY=medium
-    if which lspci > /dev/null 2>&1; then
-      # Try to guess the correct BusID.
-      VIDEO_CARD=$(LC_ALL=C lspci -n | grep -E "(Class )?0300:" | sort -n | head -n 1 \
-        | cut -d\  -f1)
-      if [ -n "$VIDEO_CARD" ]; then
-        # Recent versions of lspci report a four-digit domain as the first field.
-        if expr "$VIDEO_CARD" : ".*:.*:.*\..*" >/dev/null 2>&1; then
-          # We have an entry in "hex:hex:hex.hex" format; we need
-          # "PCI:decimal@decimal:decimal:decimal".
-          DOMAIN=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f1) )
-          BUS=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f2) )
-          DEVICE=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f3 | cut -d. -f1) )
-          FUNCTION=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d. -f2) )
-          DEFAULT="PCI:$BUS@$DOMAIN:$DEVICE:$FUNCTION"
-        elif expr "$VIDEO_CARD" : ".*:.*\..*" >/dev/null 2>&1; then
-          # We have an entry in "hex:hex.hex" format; we need
-          # "PCI:decimal:decimal:decimal".
-          BUS=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f1) )
-          DEVICE=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d: -f2 | cut -d. -f1) )
-          FUNCTION=$(printf "%d" 0x$(echo $VIDEO_CARD | cut -d. -f2) )
-          DEFAULT="PCI:$BUS:$DEVICE:$FUNCTION"
-        else
-          warn "unrecognized output from lspci: \"$VIDEO_CARD\""
-        fi
-      fi
-    fi
-  fi
-
-  # SGI Indigo2 XLs require a special hack, per Guido Guenther (see Debian
-  # #249614).
-  if [ -e /proc/cpuinfo ]; then
-    if grep -q "system type.*:.*SGI Indigo2" /proc/cpuinfo; then
-      PRIORITY=medium
-      DEFAULT=1
-    fi
-  fi
-
-  # For most people, asking this question at all is a bad idea. Only do it
-  # if we have a need to do so, as defined by setting the priority
-  if [ "$PRIORITY" = "medium" ]; then
-    # this question requires input validation
-    if [ -n "$DEFAULT" ]; then
-      auto_answer validate_bus_id_db_input "$(priority_ceil $PRIORITY)" xserver-xorg/config/device/bus_id "$DEFAULT"
-    else
-      validate_bus_id_db_input "$(priority_ceil $PRIORITY)" xserver-xorg/config/device/bus_id || debug_report_status "validate_bus_id_db_input $(priority_ceil $PRIORITY) xserver-xorg/config/device/bus_id" "$?"
-    fi
-  else
-    db_set xserver-xorg/config/device/bus_id ""
-  fi
-fi
-
-# files and dri sections
-if [ -e "$CONFIG_AUX_DIR/.migrateconfig" ]; then
-  AUTODETECT_VIDEO="yes"
-  rm -f $CONFIG_AUX_DIR/.migrateconfig
-fi
-
 #DEBHELPER#
 
 # register this package as a (potential) handler of the X server symlink and
@@ -408,38 +118,13 @@ if [ -n "$UPGRADE" ]; then
 	db_unregister $QUESTION || true
       done
     fi
+    if dpkg --compare-versions "$2" lt-nl 1:7.4+2; then
+      db_unregister xserver-xorg/config/device/bus_id || true
+      db_unregister xserver-xorg/config/device/bus_id_error || true
+    fi
 fi
 
-# no debconf interaction should be done after this point
-# (the dexconf call below invokes db_stop)
-
-# Don't touch the config on upgrades except to deal with known issues with old
-# configs.
-if [ -n "$RECONFIGURE" ]; then
-  # prepare a new version
-  NEW_XORGCONFIG="$XORGCONFIG.dpkg-new"
-  if [ -n "$RECONFIGURE" ] && [ -e "$XORGCONFIG" ]; then
-    BACKUP_XORGCONFIG="$XORGCONFIG.$(date '+%Y%m%d%H%M%S')"
-    if [ -e "$BACKUP_XORGCONFIG" ]; then
-      bomb "backup xorg.conf file $BACKUP_XORGCONFIG already" \
-           "exists; please remove it and try again"
-    fi
-    cp "$XORGCONFIG" "$BACKUP_XORGCONFIG"
-    warn "overwriting possibly-customised configuration file; backup" \
-         "in $BACKUP_XORGCONFIG"
-  fi
-  if dexconf -o "$NEW_XORGCONFIG"; then
-    if ! cmp -s "$XORGCONFIG" "$NEW_XORGCONFIG"; then
-      mv "$NEW_XORGCONFIG" "$XORGCONFIG"
-      md5sum "$XORGCONFIG" > "$XORGCONFIG_CHECKSUM"
-    fi
-  else
-    warn "error while preparing new Xorg X server configuration" \
-         "file in $NEW_XORGCONFIG; not attempting to update existing" \
-         "configuration"
-  fi
-  rm -f "$NEW_XORGCONFIG"
-elif dpkg --compare-versions "$2" lt-nl "1:7.4~3"; then
+if dpkg --compare-versions "$2" lt-nl "1:7.4~3"; then
   # We're upgrading from pre-7.4.  We need to replace i810 with intel, and
   # via with openchrome.
   if [ -e "$XORGCONFIG" ]; then
@@ -467,8 +152,6 @@ elif dpkg --compare-versions "$2" lt-nl "1:7.4~3"; then
       rm ${XORGCONFIG}.madwizard-new
     fi
   fi
-else
-  debug_echo "not updating $XORGCONFIG; we're upgrading"
 fi
 
 case "$1" in
diff --git a/debian/xserver-xorg.templates b/debian/xserver-xorg.templates
deleted file mode 100644
index aa1dff2..0000000
--- a/debian/xserver-xorg.templates
+++ /dev/null
@@ -1,32 +0,0 @@
-# These debconf templates have been proofread by the debian-l10n-english
-# team.
-#
-# Please consider interacting with the team if you intend
-# to modify the templates or add new templates
-
-Template: xserver-xorg/config/device/bus_id
-Type: string
-#flag:translate!:4
-_Description: Video card's bus identifier:
- Users of PowerPC machines, and users of any computer with multiple video
- devices, should specify the BusID of the video card in an accepted
- bus-specific format.
- .
- Examples:
- .
-  PCI:0:16:0
-  SBUS:/iommu@0,10000000/sbus@0,10001000/SUNW,tcx@2,800000
- .
- For users of multi-head setups, this option will configure only one of the
- heads.  Further configuration will have to be done manually in the X server
- configuration file, /etc/X11/xorg.conf.
- .
- You may wish to use the "lspci" command to determine the bus location of
- your PCI, AGP, or PCI-Express video card.
- .
- When possible, this question has been pre-answered for you and you should
- accept the default unless you know it doesn't work.
-
-Template: xserver-xorg/config/device/bus_id_error
-Type: note
-_Description: Incorrect format for the bus identifier


Reply to: