X Strike Force XFree86 SVN commit: rev 702 - trunk/debian
Author: branden
Date: 2003-10-23 00:10:41 -0500 (Thu, 23 Oct 2003)
New Revision: 702
Modified:
trunk/debian/changelog
trunk/debian/xdm.postinst.in
trunk/debian/xdm.prerm.in
Log:
Fix xdm to handle case where alternative X display managers do not provide
a "daemon_name" debconf template (which is supposed to contain the file
specification of the display manager daemon). If that is true, assume
that the package name of the display manager is also the name of the
daemon executable, and try to find it with the "which" command. If that
fails as well, warn the user that we were unable to update the default X
display manager file.
- debian/xdm.postinst.in
- debian/xdm.prerm.in
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2003-10-23 04:44:36 UTC (rev 701)
+++ trunk/debian/changelog 2003-10-23 05:10:41 UTC (rev 702)
@@ -118,7 +118,7 @@
- debian/xbase-clients.postinst.in
- debian/xdm.postinst.in
- debian/xdm.postrm.in
- - debian/xdm.preint.in
+ - debian/xdm.preinst.in
- debian/xdm.prerm.in
- debian/xfs.preinst.in
- debian/xfree86-common.config.in
@@ -178,8 +178,18 @@
(partially addresses #207537)
- debian/xserver-xfree86.config.in
- -- Branden Robinson <branden@debian.org> Wed, 22 Oct 2003 23:39:27 -0500
+ * Fix xdm to handle case where alternative X display managers do not provide
+ a "daemon_name" debconf template (which is supposed to contain the file
+ specification of the display manager daemon). If that is true, assume
+ that the package name of the display manager is also the name of the
+ daemon executable, and try to find it with the "which" command. If that
+ fails as well, warn the user that we were unable to update the default X
+ display manager file.
+ - debian/xdm.postinst.in
+ - debian/xdm.prerm.in
+ -- Branden Robinson <branden@debian.org> Thu, 23 Oct 2003 00:04:45 -0500
+
xfree86 (4.2.1-12.1) unstable; urgency=low
* Fix typo in xlibs preinst. Closes: #213774, #213776
Modified: trunk/debian/xdm.postinst.in
===================================================================
--- trunk/debian/xdm.postinst.in 2003-10-23 04:44:36 UTC (rev 701)
+++ trunk/debian/xdm.postinst.in 2003-10-23 05:10:41 UTC (rev 702)
@@ -35,11 +35,24 @@
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
if [ ! -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
safe_debconf db_get shared/default-x-display-manager
- if [ -n "$RET" ]; then
- safe_debconf db_get "$RET"/daemon_name
- if [ -n "$RET" ]; then
- echo "$RET" > "$DEFAULT_DISPLAY_MANAGER_FILE"
+ DEFAULT_DISPLAY_MANAGER="$RET"
+ if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
+ safe_debconf db_get "$DEFAULT_DISPLAY_MANAGER"/daemon_name
+ DAEMON_NAME="$RET"
+ if [ ! -n "$DAEMON_NAME" ]; then
+ # if we were unable to determine the name of the selected daemon (for
+ # instance, if the selected default display manager doesn't provide a
+ # daemon_name question), guess
+ DAEMON_NAME=$(which "$DEFAULT_DISPLAY_MANAGER" 2>/dev/null)
+ if [ ! -n "$DAEMON_NAME" ]; then
+ warn "unable to determine path to default X display manager" \
+ "$DEFAULT_DISPLAY_MANAGER; not updating" \
+ "$DEFAULT_DISPLAY_MANAGER_FILE"
+ fi
fi
+ if [ -n "$DAEMON_NAME" ]; then
+ echo "$DAEMON_NAME" > "$DEFAULT_DISPLAY_MANAGER_FILE"
+ fi
fi
fi
Modified: trunk/debian/xdm.prerm.in
===================================================================
--- trunk/debian/xdm.prerm.in 2003-10-23 04:44:36 UTC (rev 701)
+++ trunk/debian/xdm.prerm.in 2003-10-23 05:10:41 UTC (rev 702)
@@ -92,11 +92,12 @@
safe_debconf db_metaget shared/default-x-display-manager owners
safe_debconf db_subst shared/default-x-display-manager choices "$RET"
safe_debconf db_get shared/default-x-display-manager
+ DEFAULT_DISPLAY_MANAGER="$RET"
# are we removing the currently selected display manager?
- if [ -n "$RET" ]; then
- if [ "$THIS_PACKAGE" = "$RET" ]; then
+ if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
+ if [ "$THIS_PACKAGE" = "$DEFAULT_DISPLAY_MANAGER" ]; then
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
- safe_debconf db_get "$RET/daemon_name"
+ safe_debconf db_get "$DEFAULT_DISPLAY_MANAGER/daemon_name"
# does the display manager file reference the current default? if
# so, remove it because it will now be wrong
if [ -n "$RET" ]; then
@@ -109,18 +110,31 @@
safe_debconf db_fset shared/default-x-display-manager seen false
safe_debconf db_input critical shared/default-x-display-manager
safe_debconf db_go
- # if the display manager file doesn't exist, write it with the path
- # to the new default display manager
+ # if the default display manager file doesn't exist, write it with
+ # the path to the new default display manager
if [ ! -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
safe_debconf db_get shared/default-x-display-manager
- if [ -n "$RET" ]; then
+ DEFAULT_DISPLAY_MANAGER="$RET"
+ if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
warn "new default display manager has been selected; please be" \
"sure to run \"dpkg-reconfigure $RET\" to ensure that it" \
"is configured"
- safe_debconf db_get "$RET"/daemon_name
- if [ -n "$RET" ]; then
- echo "$RET" > "$DEFAULT_DISPLAY_MANAGER_FILE"
+ safe_debconf db_get "$DEFAULT_DISPLAY_MANAGER"/daemon_name
+ DAEMON_NAME="$RET"
+ if [ ! -n "$DAEMON_NAME" ]; then
+ # if we were unable to determine the name of the selected daemon (for
+ # instance, if the selected default display manager doesn't provide a
+ # daemon_name question), guess
+ DAEMON_NAME=$(which "$DEFAULT_DISPLAY_MANAGER" 2>/dev/null)
+ if [ ! -n "$DAEMON_NAME" ]; then
+ warn "unable to determine path to default X display manager" \
+ "$DEFAULT_DISPLAY_MANAGER; not updating" \
+ "$DEFAULT_DISPLAY_MANAGER_FILE"
+ fi
fi
+ if [ -n "$DAEMON_NAME" ]; then
+ echo "$DAEMON_NAME" > "$DEFAULT_DISPLAY_MANAGER_FILE"
+ fi
fi
fi
fi
Reply to: