#!/bin/sh # Debian x11-common package post-installation script # Copyright 1998--2001, 2003 Branden Robinson. # Licensed under the GNU General Public License, version 2. See the file # /usr/share/common-licenses/GPL or . # Acknowlegements to Stephen Early, Mark Eichin, and Manoj Srivastava. set -e . /usr/share/debconf/confmodule THIS_PACKAGE=x11-common THIS_SCRIPT=postinst CONFIG_DIR=/etc/X11 XWRAPPER_CONFIG="$CONFIG_DIR/Xwrapper.config" CONFIG_AUX_DIR=/var/lib/x11 XWRAPPER_CONFIG_CHECKSUM_BASE="${XWRAPPER_CONFIG##*/}.md5sum" XWRAPPER_CONFIG_CHECKSUM="$CONFIG_AUX_DIR/$XWRAPPER_CONFIG_CHECKSUM_BASE" XWRAPPER_CONFIG_ROSTER_BASE="${XWRAPPER_CONFIG##*/}.roster" XWRAPPER_CONFIG_ROSTER="$CONFIG_AUX_DIR/$XWRAPPER_CONFIG_ROSTER_BASE" #INCLUDE_SHELL_LIB# case "$1" in configure) if dpkg --compare-versions "$2" lt-nl "1:7.6+7ubuntu1"; then remove_conffile_commit "/etc/gdm/failsafe-xorg.conf" remove_conffile_commit "/etc/gdm/failsafeBlacklist" remove_conffile_commit "/etc/gdm/failsafeDexconf" remove_conffile_commit "/etc/gdm/failsafeDexconf.old" remove_conffile_commit "/etc/gdm/failsafeHelpmsg" remove_conffile_commit "/etc/gdm/failsafeInstall" remove_conffile_commit "/etc/gdm/failsafeXServer" remove_conffile_commit "/etc/gdm/failsafeXinit" fi if dpkg --compare-versions "$2" lt-nl "1:7.6+7ubuntu7"; then remove_conffile_commit "/etc/init/failsafe-x.conf" fi esac # only mess with config file it exists; otherwise, assume that's the way the # user wants it, but only if upgrading if [ -e "$XWRAPPER_CONFIG" ] || [ -z "$UPGRADE" ]; then ALLOWED_USERS= if db_get x11-common/xwrapper/actual_allowed_users; then ALLOWED_USERS="$RET" fi if [ -n "$ALLOWED_USERS" ]; then NEW_XWRAPPER_CONFIG=$(tempfile -m 644) if ! [ -e "$XWRAPPER_CONFIG" ]; then cat >>"$NEW_XWRAPPER_CONFIG" << EOF # Xwrapper.config (Debian X Window System server wrapper configuration file) # # This file was generated by the post-installation script of the x11-common # package using values from the debconf database. # # See the Xwrapper.config(5) manual page for more information. # # This file is automatically updated on upgrades of the x11-common package # *only* if it has not been modified since the last upgrade of that package. # # If you have edited this file but would like it to be automatically updated # again, run the following command as root: # dpkg-reconfigure x11-common allowed_users=$ALLOWED_USERS EOF else sed -e '/^allowed_users.*/d' < "$XWRAPPER_CONFIG" > "$NEW_XWRAPPER_CONFIG" echo "allowed_users=$ALLOWED_USERS" >> "$NEW_XWRAPPER_CONFIG" fi if ! cmp -s "$XWRAPPER_CONFIG" "$NEW_XWRAPPER_CONFIG"; then cp "$NEW_XWRAPPER_CONFIG" "$XWRAPPER_CONFIG.dpkg-new" mv "$XWRAPPER_CONFIG.dpkg-new" "$XWRAPPER_CONFIG" fi rm -f "$NEW_XWRAPPER_CONFIG" else observe "not updating $XWRAPPER_CONFIG; problems communicating" \ "with debconf database" fi else observe "not updating $XWRAPPER_CONFIG; file does not exist" fi # get rid of obsolete X server wrapper config roster and checksum if dpkg --compare-versions "$2" lt-nl 1:7.6~3; then rm -f "$XWRAPPER_CONFIG_ROSTER" rm -f "$XWRAPPER_CONFIG_CHECKSUM" rmdir "$CONFIG_AUX_DIR" 2>/dev/null || : fi if dpkg --compare-versions "$2" lt-nl 1:7.4+2; then db_unregister x11-common/xwrapper/nice_value || : db_unregister x11-common/xwrapper/nice_value/error || : db_unregister x11-common/upgrade_issues || : db_unregister x11-common/x11r6_bin_not_empty || : fi #DEBHELPER# exit 0 # vim:set ai et sts=2 sw=2 tw=80: