X Strike Force SVN commit: rev 426 - trunk/debian
Author: branden
Date: 2003-08-23 23:30:29 -0500 (Sat, 23 Aug 2003)
New Revision: 426
Modified:
trunk/debian/NEWS.Debian
trunk/debian/changelog
trunk/debian/xserver-common.preinst.in
trunk/debian/xserver-xfree86.preinst.in
Log:
debian/xserver-{common,xfree86}.preinst.in: rework migration logic:
- create the configuration file auxiliary directory /var/lib/xfree86
on all installs and upgrades if it doesn't already exist
- don't throw a warning if the path to the auxiliary directory exists
but
is not a directory; assume local admin cleverness
- don't migrate a configuration file if its debconf region markers have
been removed
debian/NEWS.Debian: fix up NEWS.Debian entry to describe additional case
where files are not migrated (debconf region markers removed)
Modified: trunk/debian/NEWS.Debian
===================================================================
--- trunk/debian/NEWS.Debian 2003-08-24 02:22:40 UTC (rev 425)
+++ trunk/debian/NEWS.Debian 2003-08-24 04:30:29 UTC (rev 426)
@@ -8,7 +8,9 @@
This new method attempts to detect changes to these files, and if they are
modified by the user, the files will be ignored by the packaging system
- henceforth.
+ henceforth. The debconf region markers (e.g. "### BEGIN DEBCONF SECTION")
+ formerly used in Xwrapper.config and XF86Config-4 are no longer used, are
+ disregarded if present, and will not be newly written.
The debconf templates in the xserver-common, xserver-xfree86, and
xserver-xfree86-dbg packages (the latter shares all of its templates with
@@ -17,20 +19,12 @@
packages' pre-installation scripts.
In the event that you have customized these configuration files, and have
- neglected to correct debconf's notion of whether it should manage those
- files before upgrading to xfree86 4.2.1-10 or later, backups are made and
- stored in the same directory, with the suffix ".dpkg-old". For example,
- if you have answered the "Manage XFree86 4.x server configuration file
- with debconf?" question in the affirmative, your /etc/X11/XF86Config-4
- file will be backed up in /etc/X11/XF86Config-4.dpkg-old. Note that this
- is only done *once*, on upgrades from xfree86 package versions prior to
- 4.2.1-10. If you do not like the new /etc/X11/XF86Config-4 that gets
- written, for example, either edit it or rename the .dpkg-old file to it.
+ neglected both to correct debconf's notion of whether it should manage
+ those files, and (in the case of Xwrapper.config and XF86Config-4) have
+ not removed the "debconf region markers" before upgrading to xfree86
+ 4.2.1-10 or later, backups are made and stored in the same directory, with
+ the suffix ".dpkg-old".
- The "debconf region markers" (e.g. "### BEGIN DEBCONF SECTION") formerly
- used in /etc/X11/Xwrapper.config and /etc/X11/XF86Config-4 are no longer
- used, are disregarded if present, and will not be newly written.
-
See the Debian X FAQ at <http://people.debian.org/~branden/xsf/FAQ> or in
the file /usr/share/doc/xfree86-common/FAQ.gz after this upgrade is
complete for more information on the Debian XFree86 packages' new method
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2003-08-24 02:22:40 UTC (rev 425)
+++ trunk/debian/changelog 2003-08-24 04:30:29 UTC (rev 426)
@@ -19,8 +19,16 @@
alias for en_US.UTF-8) to Xlib; includes Compose file updates from Gustavo
Noronha Silva (Closes: #204148)
- -- Branden Robinson <branden@debian.org> Sat, 23 Aug 2003 20:47:15 -0500
+ * debian/xserver-{common,xfree86}.preinst.in: rework migration logic:
+ - create the configuration file auxiliary directory /var/lib/xfree86
+ on all installs and upgrades if it doesn't already exist
+ - don't throw a warning if the path to the auxiliary directory exists but
+ is not a directory; assume local admin cleverness
+ - don't migrate a configuration file if its debconf region markers have
+ been removed
+ -- Branden Robinson <branden@debian.org> Sat, 23 Aug 2003 23:09:50 -0500
+
xfree86 (4.2.1-10) unstable; urgency=medium
* patch #000_stolen_from_HEAD_xlib: fix for buffer overflow in
Modified: trunk/debian/xserver-common.preinst.in
===================================================================
--- trunk/debian/xserver-common.preinst.in 2003-08-24 02:22:40 UTC (rev 425)
+++ trunk/debian/xserver-common.preinst.in 2003-08-24 04:30:29 UTC (rev 426)
@@ -36,42 +36,42 @@
mv /etc/X11/Xserver /etc/X11/Xserver.xserver-common-backup
fi
- # if upgrading from < 4.2.1-10, migrate Xwrapper.config to (simplified)
+ # create the configuration files' auxiliary directory if it doesn't exist
+ if [ ! -e "$CONFIG_AUX_DIR" ]; then
+ mkdir --mode=755 --parents "$CONFIG_AUX_DIR"
+ fi
+
+ # if upgrading from < 4.2.1-10, migrate X wrapper config file to (simplified)
# ucf-style handling
if dpkg --compare-versions "$2" lt-nl "4.2.1-10"; then
- # was the user letting the debconf "manage" the file?
- if db_get xserver-common/manage_config_with_debconf; then
- if [ "$RET" = "true" ]; then
- # yes; attempt to pre-seed the md5sum file based on the current content
- # of the file
- WRITE_CHECKSUM=yes
- # if the config file doesn't even exist, don't bother
- if [ -e "$XWRAPPER_CONFIG" ]; then
- # create the configuration files' auxiliary directory if it doesn't
- # exist
- if [ ! -e "$CONFIG_AUX_DIR" ]; then
- mkdir --mode=755 "$CONFIG_AUX_DIR"
- else
- # if the checksum pathname does exist but is not a directory, give
- # up; we will assume the user has reasons for setting things up
- # this way
- if [ ! -d "$CONFIG_AUX_DIR" ]; then
- message "Warning: cannot store MD5 checksum of" \
- "$XWRAPPER_CONFIG; $CONFIG_AUX_DIR exists but is not a" \
- "directory."
- WRITE_CHECKSUM=
+ # do we have a configuration file to work with?
+ if [ -e "$XWRAPPER_CONFIG" ]; then
+ # only proceed if config file auxiliary directory exists
+ if [ -d "$CONFIG_AUX_DIR" ]; then
+ # attempt to pre-seed the md5sum file based on the current content of
+ # the file
+ if db_get xserver-xfree86/manage_config_with_debconf; then
+ if [ "$RET" = "true" ]; then
+ # if the config file doesn't even exist, don't bother
+ if [ -e "$XWRAPPER_CONFIG" ]; then
+ # make sure the "debconf markers" are there, too; if they've been
+ # removed, the user didn't want the file molested
+ if egrep -q '^### BEGIN DEBCONF SECTION' "$XWRAPPER_CONFIG" && \
+ egrep -q '^### END DEBCONF SECTION' "$XWRAPPER_CONFIG"; then
+ # finally, people were letting debconf "manage" the config file
+ # even though they complained when it did so and did not follow
+ # the instructions that would make the maintainer scripts ignore
+ # it, so store a backup so they can rescue themselves from their
+ # own ignorance
+ message "Note: migrating $XWRAPPER_CONFIG away from" \
+ "management by debconf; backup stored in" \
+ "$XWRAPPER_CONFIG.dpkg-old and checksum stored in" \
+ "$XWRAPPER_CONFIG_CHECKSUM."
+ md5sum "$XWRAPPER_CONFIG" > "$XWRAPPER_CONFIG_CHECKSUM"
+ cp "$XWRAPPER_CONFIG" "$XWRAPPER_CONFIG.dpkg-old"
+ fi
fi
fi
- if [ -n "$WRITE_CHECKSUM" ]; then
- # people were letting debconf "manage" the config file even though
- # they complained when it did so, so store a backup to keep people
- # quiet
- message "Note: migrating $XWRAPPER_CONFIG away from management" \
- "by debconf; backup stored in $XWRAPPER_CONFIG.dpkg-old" \
- "and MD5 checksum stored in $XWRAPPER_CONFIG_CHECKSUM."
- md5sum "$XWRAPPER_CONFIG" > "$XWRAPPER_CONFIG_CHECKSUM"
- cp "$XWRAPPER_CONFIG" "$XWRAPPER_CONFIG.dpkg-old"
- fi
fi
fi
fi
Modified: trunk/debian/xserver-xfree86.preinst.in
===================================================================
--- trunk/debian/xserver-xfree86.preinst.in 2003-08-24 02:22:40 UTC (rev 425)
+++ trunk/debian/xserver-xfree86.preinst.in 2003-08-24 04:30:29 UTC (rev 426)
@@ -24,71 +24,74 @@
THIS_SERVER=/usr/bin/X11/XFree86
if [ "$1" = "install" -o "$1" = "upgrade" ]; then
+ # create the configuration files' auxiliary directory if it doesn't exist
+ if [ ! -e "$CONFIG_AUX_DIR" ]; then
+ mkdir --mode=755 --parents "$CONFIG_AUX_DIR"
+ fi
+
# if upgrading from < 4.2.1-10, migrate X server symlink and XF86Config-4
# to (simplified) ucf-style handling
if dpkg --compare-versions "$2" lt-nl "4.2.1-10"; then
# do we have any configuration files to work with?
if [ -e "$SERVER_SYMLINK" -o -e "$XF86CONFIG" ]; then
- # create the configuration files' auxiliary directory if it doesn't exist
- if [ ! -e "$CONFIG_AUX_DIR" ]; then
- mkdir --mode=755 "$CONFIG_AUX_DIR"
- else
- # checksum pathname exists; only proceed if it is a directory
- if [ -d "$CONFIG_AUX_DIR" ]; then
+ # only proceed if config file auxiliary directory exists
+ if [ -d "$CONFIG_AUX_DIR" ]; then
- # first, migrate the X server symlink
- if [ -e "$SERVER_SYMLINK" ]; then
- # attempt to pre-seed the md5sum file based on the current content
- # of the file; first, is this package selected as the one
- # containing the default X server?
- if db_get shared/default-x-server; then
- if [ "$RET" = "$THIS_PACKAGE" ]; then
- # next, does the symlink point to the server executable
- # provided by this package?
- CURRENT_SYMLINK_TARGET=$(readlink "$SERVER_SYMLINK")
- if [ "$CURRENT_SYMLINK_TARGET" = "$THIS_SERVER" ]; then
- # people were letting debconf "manage" the config file even
- # though they complained when it did so, so store a backup to
- # keep people quiet
- message "Note: migrating $SERVER_SYMLINK away from" \
- "management by debconf; backup stored in" \
- "$SERVER_SYMLINK.dpkg-old and MD5 checksum stored" \
- "in $SERVER_SYMLINK_CHECKSUM."
- echo "$CURRENT_SYMLINK_TARGET" | md5sum > "$SERVER_SYMLINK_CHECKSUM"
- ln -s "$CURRENT_SYMLINK_TARGET" "$SERVER_SYMLINK.dpkg-old"
- fi
+ # first, migrate the X server symlink
+ if [ -e "$SERVER_SYMLINK" ]; then
+ # attempt to pre-seed the md5sum file based on the current content of
+ # the file; first, is this package selected as the one containing the
+ # default X server?
+ if db_get shared/default-x-server; then
+ if [ "$RET" = "$THIS_PACKAGE" ]; then
+ # next, does the symlink point to the server executable provided
+ # by this package?
+ CURRENT_SYMLINK_TARGET=$(readlink "$SERVER_SYMLINK")
+ if [ "$CURRENT_SYMLINK_TARGET" = "$THIS_SERVER" ]; then
+ # people were letting debconf "manage" the config file even
+ # though they complained when it did so, so store a backup to
+ # keep people quiet
+ message "Note: migrating $SERVER_SYMLINK away from management" \
+ "by debconf; backup stored in" \
+ "$SERVER_SYMLINK.dpkg-old and checksum stored in" \
+ "$SERVER_SYMLINK_CHECKSUM." \
+ echo "$CURRENT_SYMLINK_TARGET" | md5sum > \
+ "$SERVER_SYMLINK_CHECKSUM"
+ ln -s "$CURRENT_SYMLINK_TARGET" "$SERVER_SYMLINK.dpkg-old"
fi
fi
fi
+ fi
- # next, migrate XF86Config-4
- if [ -e "$XF86CONFIG" ]; then
- # attempt to pre-seed the md5sum file based on the current content
- # of the file
- if db_get xserver-xfree86/manage_config_with_debconf; then
- if [ "$RET" = "true" ]; then
- # if the config file doesn't even exist, don't bother
- if [ -e "$XF86CONFIG" ]; then
- # people were letting debconf "manage" the config file even
- # though they complained when it did so, so store a backup to
- # keep people quiet
+ # next, migrate XF86Config-4
+ if [ -e "$XF86CONFIG" ]; then
+ # attempt to pre-seed the md5sum file based on the current content of
+ # the file
+ if db_get xserver-xfree86/manage_config_with_debconf; then
+ if [ "$RET" = "true" ]; then
+ # if the config file doesn't even exist, don't bother
+ if [ -e "$XF86CONFIG" ]; then
+ # make sure the "debconf markers" are there, too; if they've
+ # been removed, the user didn't want the file molested
+ if egrep -q '^### BEGIN DEBCONF SECTION' "$XF86CONFIG" && \
+ egrep -q '^### END DEBCONF SECTION' "$XF86CONFIG"; then
+ # finally, people were letting debconf "manage" the config
+ # file even though they complained when it did so and did not
+ # follow the instructions that would make the maintainer
+ # scripts ignore it, so store a backup so they can rescue
+ # themselves from their own ignorance
message "Note: migrating $XF86CONFIG away from management" \
- "by debconf; backup stored in $XF86CONFIG.dpkg-old" \
- "and MD5 checksum stored in $XF86CONFIG_CHECKSUM."
+ "by debconf; backup stored in" \
+ "$XF86CONFIG.dpkg-old and checksum stored in" \
+ "$XF86CONFIG_CHECKSUM."
md5sum "$XF86CONFIG" > "$XF86CONFIG_CHECKSUM"
cp "$XF86CONFIG" "$XF86CONFIG.dpkg-old"
fi
fi
fi
fi
+ fi
- else
- # the checksum pathname does exist but is not a directory; we assume
- # the user has reasons for setting things up this way
- message "Warning: cannot store MD5 checksums of $THIS_PACKAGE's" \
- "configuration files; $CONFIG_AUX_DIR exists but is not a" \
- "directory."
- fi
fi
fi
Reply to: