Author: branden Date: 2003-09-12 08:53:03 -0500 (Fri, 12 Sep 2003) New Revision: 510
Modified: trunk/debian/changelog trunk/debian/xfree86-common.config.in trunk/debian/xfree86-common.postinst.in trunk/debian/xfree86-common.postrm.in trunk/debian/xfree86-common.preinst.in Log: Robustify xfree86-common maintainer scripts. - debian/xfree86-common.{config,preinst,postinst,postrm}.in: + improve comments + remove long-commented-out fiddling with rgb.txt + convert informational messages to debugging messages + add debugging messages for tracing of various operations + move removal of long-obsoleted /etc/X11/window-managers file from postinst to preinst - debian/xfree86-common.config.in: + wrap db_* commands with safe_debconf - debian/xfree86-common.preinst.in: + Stop removing /usr/doc/X11 and /usr/X11R6/lib/X11/doc symlinks; after taking a look at old xfree86 package releases (potato, slink, hamm), I've concluded that old packages get these symlinks out of the way adequately. If the local admin wants to install symlinks here, it's no sweat off me. + conditionalize removal of long-obsoleted /etc/X11/window-managers file on upgrades/installs over xfree86-common 3.3.6-5 Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2003-09-12 12:44:01 UTC (rev 509) +++ trunk/debian/changelog 2003-09-12 13:53:03 UTC (rev 510) @@ -133,8 +133,27 @@ any effort to stop it, if pidof doesn't report any xdm processes running - -- Branden Robinson <[EMAIL PROTECTED]> Wed, 10 Sep 2003 17:39:00 -0500 + * Robustify xfree86-common maintainer scripts. + - debian/xfree86-common.{config,preinst,postinst,postrm}.in: + + improve comments + + remove long-commented-out fiddling with rgb.txt + + convert informational messages to debugging messages + + add debugging messages for tracing of various operations + + move removal of long-obsoleted /etc/X11/window-managers file from + postinst to preinst + - debian/xfree86-common.config.in: + + wrap db_* commands with safe_debconf + - debian/xfree86-common.preinst.in: + + Stop removing /usr/doc/X11 and /usr/X11R6/lib/X11/doc symlinks; after + taking a look at old xfree86 package releases (potato, slink, hamm), + I've concluded that old packages get these symlinks out of the way + adequately. If the local admin wants to install symlinks here, it's + no sweat off me. + + conditionalize removal of long-obsoleted /etc/X11/window-managers file + on upgrades/installs over xfree86-common 3.3.6-5 + -- Branden Robinson <[EMAIL PROTECTED]> Thu, 11 Sep 2003 20:21:05 -0500 + xfree86 (4.2.1-11) unstable; urgency=medium * urgency set to medium because bug #206790 bites a lot of people (but, Modified: trunk/debian/xfree86-common.config.in =================================================================== --- trunk/debian/xfree86-common.config.in 2003-09-12 12:44:01 UTC (rev 509) +++ trunk/debian/xfree86-common.config.in 2003-09-12 13:53:03 UTC (rev 510) @@ -18,10 +18,12 @@ # is this an unofficial Debian package? if [ -z "$OFFICIAL_BUILD" ]; then - db_register xfree86-common/experimental_packages xfree86-common/nag - db_input high xfree86-common/nag || true - db_go - db_unregister xfree86-common/nag + debugmsg "unofficial build detected; issuing debconf note as warning" + safe_debconf db_register xfree86-common/experimental_packages \ + xfree86-common/nag + safe_debconf db_input high xfree86-common/nag + safe_debconf db_go + safe_debconf db_unregister xfree86-common/nag fi exit 0 Modified: trunk/debian/xfree86-common.postinst.in =================================================================== --- trunk/debian/xfree86-common.postinst.in 2003-09-12 12:44:01 UTC (rev 509) +++ trunk/debian/xfree86-common.postinst.in 2003-09-12 13:53:03 UTC (rev 510) @@ -21,34 +21,25 @@ /usr/include/X11 \ /usr/lib/X11 -# window-managers file is obsolete; get rid of it -if [ -e /etc/X11/window-managers ]; then - message "Note: Removing obsolete /etc/X11/window-managers file." - rm /etc/X11/window-managers -fi - # ensure that /etc/X11/Xresources is now a directory (see preinst) if [ ! -d /etc/X11/Xresources ]; then - errormsg "ERROR: /etc/X11/Xresources is not a directory. " \ + errormsg "/etc/X11/Xresources is not a directory. " \ "Either the package didn't ship the directory (a bug in the" \ "package), or dpkg failed to unpack it to the filesystem (a" \ "bug in dpkg)." fi -#### finish migration started in preinst -###if [ -e /usr/X11R6/lib/X11/rgb.txt.moved-by-preinst -a -L /usr/X11R6/lib/X11/rgb.txt ]; then -### rm /usr/X11R6/lib/X11/rgb.txt.moved-by-preinst -###fi - +debugmsg "committing removal of obsolete conffile" \ + "/etc/X11/Xsession.d/40xfree86-common_xmodmap" remove_conffile_commit /etc/X11/Xsession.d/40xfree86-common_xmodmap if [ -e /etc/init.d/xfree86-common ]; then - update-rc.d $THIS_PACKAGE start 70 S . + update-rc.d "$THIS_PACKAGE" start 70 S . fi #DEBHELPER# -invoke-rc.d $THIS_PACKAGE start || true +invoke-rc.d "$THIS_PACKAGE" start || true exit 0 Modified: trunk/debian/xfree86-common.postrm.in =================================================================== --- trunk/debian/xfree86-common.postrm.in 2003-09-12 12:44:01 UTC (rev 509) +++ trunk/debian/xfree86-common.postrm.in 2003-09-12 13:53:03 UTC (rev 510) @@ -15,10 +15,8 @@ #INCLUDE_SHELL_LIB# if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ]; then -### if [ -e /usr/X11R6/lib/X11/rgb.txt.moved-by-preinst -a -L /usr/X11R6/lib/X11/rgb.txt ]; then -### rm /usr/X11R6/lib/X11/rgb.txt -### mv /etc/X11/rgb.txt.moved-by-preinst /usr/X11R6/lib/X11/rgb.txt -### fi + debugmsg "rolling back removal of obsolete conffile" \ + "/etc/X11/Xsession.d/40xfree86-common_xmodmap" remove_conffile_rollback /etc/X11/Xsession.d/40xfree86-common_xmodmap fi @@ -27,7 +25,7 @@ if [ "$1" = "purge" ]; then update-rc.d xfree86-common remove for DIR in /etc/X11/Xresources /etc/X11/Xsession.d /etc/X11; do - rmdir $DIR 2> /dev/null || true + rmdir "$DIR" 2> /dev/null || true done fi Modified: trunk/debian/xfree86-common.preinst.in =================================================================== --- trunk/debian/xfree86-common.preinst.in 2003-09-12 12:44:01 UTC (rev 509) +++ trunk/debian/xfree86-common.preinst.in 2003-09-12 13:53:03 UTC (rev 510) @@ -15,31 +15,13 @@ #INCLUDE_SHELL_LIB# if [ "$1" = "install" -o "$1" = "upgrade" ]; then - # as of xfree86-common 4.x, rgb.txt is a conffile -### if [ -e /usr/X11R6/lib/X11/rgb.txt -a ! -L /usr/X11R6/lib/X11/rgb.txt ]; then -### message "Note: Removing obsolete /usr/X11R6/lib/X11/rgb.txt file." -### mv /usr/X11R6/lib/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt.moved-by-preinst -### fi - - if dpkg --compare-versions "$2" lt "4.1.0-7"; then - remove_conffile_prepare /etc/X11/Xsession.d/40xfree86-common_xmodmap \ - b370a42803aec72f27da67ca6a225402 - fi - - check_symlinks_and_warn /usr/bin/X11 \ - /usr/include/X11 \ - /usr/lib/X11 - - for SYMLINK in /usr/doc/X11 /usr/X11R6/lib/X11/doc; do - if [ -L $SYMLINK ]; then - message "Note: Removing obsolete symbolic link $SYMLINK." - rm $SYMLINK - fi - done - - # in xbase 3.3.2.3a-2, /etc/X11/Xresources became a directory + # In xbase 3.3.2.3a-2 (October 1998), /etc/X11/Xresources became a directory. + # Prior to that, it was a symbolic link to /usr/X11R6/lib/X11/doc. Because + # dpkg will unpack through symlinks to directories and we must avoid this, + # refuse to install if /etc/X11/Xresources exists and is not a directory when + # this package is installed. if [ -e /etc/X11/Xresources -a ! -d /etc/X11/Xresources ]; then - ERRMSG="ERROR: /etc/X11/Xresources exists and is not a directory. " + ERRMSG="/etc/X11/Xresources exists and is not a directory. " ERRMSG="$ERRMSG The xfree86-common package cannot be installed until this" if [ -f /etc/X11/Xresources ]; then ERRMSG="$ERRMSG file" @@ -48,8 +30,24 @@ fi ERRMSG="$ERRMSG is removed. " ERRMSG="$ERRMSG Aborting installation of $THIS_PACKAGE package." - errormsg $ERRMSG + errormsg "$ERRMSG" fi + + if dpkg --compare-versions "$2" lt "3.3.6-5"; then + debugmsg "removing obsolete /etc/X11/window-managers file" + rm -f /etc/X11/window-managers + fi + + if dpkg --compare-versions "$2" lt "4.1.0-7"; then + debugmsg "preparing obsolete conffile" \ + "/etc/X11/Xsession.d/40xfree86-common_xmodmap for removal" + remove_conffile_prepare /etc/X11/Xsession.d/40xfree86-common_xmodmap \ + b370a42803aec72f27da67ca6a225402 + fi + + check_symlinks_and_warn /usr/bin/X11 \ + /usr/include/X11 \ + /usr/lib/X11 fi #DEBHELPER# -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]